Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(787)

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 672593002: 2D canvas: fix shadow rendering with "copy" compositing mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/canvas/canvas-composite-shadow.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 29696c39d42fabcaef2088546aa73dbe86ebc3aa..3519f0f55d9aae21a0cd50f8a6ff5149b6a69c89 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -1033,7 +1033,9 @@ void CanvasRenderingContext2D::fillInternal(const Path& path, const String& wind
didDraw(clipBounds);
} else if (state().m_globalComposite == CompositeCopy) {
clearCanvas();
+ c->clearShadow();
c->fillPath(path);
+ applyShadow(DrawShadowAndForeground);
didDraw(clipBounds);
} else {
FloatRect dirtyRect;
@@ -1083,7 +1085,9 @@ void CanvasRenderingContext2D::strokeInternal(const Path& path)
didDraw(clipBounds);
} else if (state().m_globalComposite == CompositeCopy) {
clearCanvas();
+ c->clearShadow();
c->strokePath(path);
+ applyShadow(DrawShadowAndForeground);
didDraw(clipBounds);
} else {
FloatRect bounds = path.boundingRect();
@@ -1313,7 +1317,9 @@ void CanvasRenderingContext2D::fillRect(float x, float y, float width, float hei
didDraw(clipBounds);
} else if (state().m_globalComposite == CompositeCopy) {
clearCanvas();
+ c->clearShadow();
c->fillRect(rect);
+ applyShadow(DrawShadowAndForeground);
didDraw(clipBounds);
} else {
FloatRect dirtyRect;
@@ -1352,7 +1358,9 @@ void CanvasRenderingContext2D::strokeRect(float x, float y, float width, float h
didDraw(clipBounds);
} else if (state().m_globalComposite == CompositeCopy) {
clearCanvas();
+ c->clearShadow();
c->strokeRect(rect);
+ applyShadow(DrawShadowAndForeground);
didDraw(clipBounds);
} else {
FloatRect boundingRect = rect;
@@ -2212,7 +2220,9 @@ void CanvasRenderingContext2D::drawTextInternal(const String& text, float x, flo
didDraw(clipBounds);
} else if (state().m_globalComposite == CompositeCopy) {
clearCanvas();
+ c->clearShadow();
c->drawBidiText(font, textRunPaintInfo, location, Font::UseFallbackIfFontNotReady);
+ applyShadow(DrawShadowAndForeground);
didDraw(clipBounds);
} else {
FloatRect dirtyRect;
« no previous file with comments | « LayoutTests/fast/canvas/canvas-composite-shadow.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698