Changeset 166840 in webkit
- Timestamp:
- Apr 5, 2014 2:34:44 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r166836 r166840 1 2014-04-05 Dirk Schulze <krit@webkit.org> 2 3 Canvas strokeText and fillText with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors 4 https://bugs.webkit.org/show_bug.cgi?id=66766 5 6 Reviewed by Andreas Kling. 7 8 330 tests check compositing on Canvas with text. 9 10 * fast/canvas/canvas-composite-text-alpha-expected.txt: Added. 11 * fast/canvas/canvas-composite-text-alpha.html: Added. 12 1 13 2014-04-05 Dirk Schulze <krit@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r166839 r166840 1 2014-04-05 Dirk Schulze <krit@webkit.org> 2 3 Canvas strokeText and fillText with SourceIn, DestinationIn, SourceOut, DestinationAtop and Copy have errors 4 https://bugs.webkit.org/show_bug.cgi?id=66766 5 6 Reviewed by Andreas Kling. 7 8 Use transparency layers to draw text with certain compositing modes on 9 the canvas. This follows the Canvas specification and makes WebKit fully 10 compatible with IE. It also makes it more compatible with Firefox, even though 11 Firefox still has some bugs. 12 13 Test: fast/canvas/canvas-composite-text-alpha.html 14 15 * html/canvas/CanvasRenderingContext2D.cpp: 16 (WebCore::CanvasRenderingContext2D::drawTextInternal): 17 1 18 2014-04-05 Andreas Kling <akling@apple.com> 2 19 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r166836 r166840 2335 2335 c->setTextDrawingMode(fill ? TextModeFill : TextModeStroke); 2336 2336 2337 GraphicsContextStateSaver stateSaver(*c); 2337 2338 if (useMaxWidth) { 2338 GraphicsContextStateSaver stateSaver(*c);2339 2339 c->translate(location.x(), location.y()); 2340 2340 // We draw when fontWidth is 0 so compositing operations (eg, a "copy" op) still work. 2341 2341 c->scale(FloatSize((fontWidth > 0 ? (width / fontWidth) : 0), 1)); 2342 c->drawBidiText(font, textRun, FloatPoint(0, 0), Font::UseFallbackIfFontNotReady); 2343 } else 2342 location = FloatPoint(); 2343 } 2344 2345 if (isFullCanvasCompositeMode(state().m_globalComposite)) { 2346 c->beginTransparencyLayer(1); 2344 2347 c->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady); 2345 2346 didDraw(textRect); 2348 c->endTransparencyLayer(); 2349 didDrawEntireCanvas(); 2350 } else if (state().m_globalComposite == CompositeCopy) { 2351 clearCanvas(); 2352 c->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady); 2353 didDrawEntireCanvas(); 2354 } else { 2355 c->drawBidiText(font, textRun, location, Font::UseFallbackIfFontNotReady); 2356 didDraw(textRect); 2357 } 2347 2358 } 2348 2359
Note: See TracChangeset
for help on using the changeset viewer.