Changeset 86667 in webkit
- Timestamp:
- May 17, 2011 4:36:55 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r86666 r86667 1 2011-05-17 Andreas Kling <andreas.kling@nokia.com> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 [Qt] Support shadowed text in fast font path. 6 https://bugs.webkit.org/show_bug.cgi?id=60462 7 8 * platform/graphics/Font.cpp: 9 (WebCore::Font::drawText): Remove complex path shortcut for shadowed text. 10 11 * platform/graphics/qt/FontQt.cpp: 12 (WebCore::Font::drawGlyphs): Paint shadows for simple text. 13 1 14 2011-05-17 Andreas Kling <kling@webkit.org> 2 15 -
trunk/Source/WebCore/platform/graphics/Font.cpp
r85853 r86667 29 29 #include "FontTranscoder.h" 30 30 #if PLATFORM(QT) && HAVE(QRAWFONT) 31 #include "ContextShadow.h"32 31 #include "GraphicsContext.h" 33 32 #endif … … 147 146 148 147 #if PLATFORM(QT) && HAVE(QRAWFONT) 149 if (context->textDrawingMode() & TextModeStroke || context->contextShadow()->m_type != ContextShadow::NoShadow)148 if (context->textDrawingMode() & TextModeStroke) 150 149 codePathToUse = Complex; 151 150 #endif -
trunk/Source/WebCore/platform/graphics/qt/FontQt.cpp
r85853 r86667 340 340 positions.reserve(numGlyphs); 341 341 342 float x= 0;342 float width = 0; 343 343 344 344 for (int i = 0; i < numGlyphs; ++i) { … … 348 348 continue; 349 349 glyphIndexes.append(glyph); 350 positions.append(QPointF(x, 0)); 351 x += advance; 352 } 350 positions.append(QPointF(width, 0)); 351 width += advance; 352 } 353 354 QRawFont rawFont(fontData->platformData().rawFont()); 353 355 354 356 QGlyphs qtGlyphs; 355 357 qtGlyphs.setGlyphIndexes(glyphIndexes); 356 358 qtGlyphs.setPositions(positions); 357 qtGlyphs.setFont( fontData->platformData().rawFont());359 qtGlyphs.setFont(rawFont); 358 360 359 361 QPainter* painter = context->platformContext(); 362 363 ContextShadow* shadow = context->contextShadow(); 364 switch (shadow->m_type) { 365 case ContextShadow::SolidShadow: { 366 QPen previousPen = painter->pen(); 367 painter->setPen(shadow->m_color); 368 painter->translate(shadow->offset()); 369 painter->drawGlyphs(point, qtGlyphs); 370 painter->translate(-shadow->offset()); 371 painter->setPen(previousPen); 372 break; 373 } 374 case ContextShadow::BlurShadow: { 375 qreal height = rawFont.ascent() + rawFont.descent() + 1; 376 QRectF boundingRect(point.x(), point.y() - rawFont.ascent(), width, height); 377 QPainter* shadowPainter = shadow->beginShadowLayer(context, boundingRect); 378 if (shadowPainter) { 379 shadowPainter->setPen(shadow->m_color); 380 shadowPainter->drawGlyphs(point, qtGlyphs); 381 shadow->endShadowLayer(context); 382 } 383 break; 384 } 385 case ContextShadow::NoShadow: 386 break; 387 default: 388 ASSERT_NOT_REACHED(); 389 break; 390 } 360 391 361 392 QPen previousPen = painter->pen();
Note: See TracChangeset
for help on using the changeset viewer.