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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp

Issue 1543593002: Forward fill and stroke styles from 2d canvas to canvas filters (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
index bdd146bfa44b7834b5677e5df53ce1c8c7d12998..3e17c95b6e5774367fcaf87523a531bb0bd341d3 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DState.cpp
@@ -18,6 +18,7 @@
#include "platform/graphics/DrawLooperBuilder.h"
#include "platform/graphics/filters/SkiaImageFilterBuilder.h"
#include "platform/graphics/skia/SkiaUtils.h"
+#include "third_party/skia/include/core/SkShader.h"
#include "third_party/skia/include/effects/SkDashPathEffect.h"
#include "third_party/skia/include/effects/SkDropShadowImageFilter.h"
@@ -356,12 +357,10 @@ SkImageFilter* CanvasRenderingContext2DState::getFilter(Element* styleResolution
StyleResolverState resolverState(styleResolutionHost->document(), styleResolutionHost, filterStyle.get());
resolverState.setStyle(filterStyle);
- // TODO(junov): crbug.com/502877 Feed m_fillStyle and m_strokeStyle into FillPaint and
- // StrokePaint respectively for filters that reference SVG.
StyleBuilder::applyProperty(CSSPropertyWebkitFilter, resolverState, m_filterValue.get());
RefPtrWillBeRawPtr<FilterEffectBuilder> filterEffectBuilder = FilterEffectBuilder::create();
const double effectiveZoom = 1.0; // Deliberately ignore zoom on the canvas element
- filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), effectiveZoom);
+ filterEffectBuilder->build(styleResolutionHost, filterStyle->filter(), effectiveZoom, m_fillStyle->asShader(), m_strokeStyle->asShader());
SkiaImageFilterBuilder imageFilterBuilder;
RefPtrWillBeRawPtr<FilterEffect> lastEffect = filterEffectBuilder->lastEffect();

Powered by Google App Engine
This is Rietveld 408576698