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

Unified Diff: Source/platform/graphics/GraphicsContextState.cpp

Issue 669123002: Fixed Shadow blur for transparent objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added opacity check 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
Index: Source/platform/graphics/GraphicsContextState.cpp
diff --git a/Source/platform/graphics/GraphicsContextState.cpp b/Source/platform/graphics/GraphicsContextState.cpp
index 657d0df5fb03942dbf1f6e356445b25f861889f6..1424bf473c4006f6ca58b8f2a11e92685da6057c 100644
--- a/Source/platform/graphics/GraphicsContextState.cpp
+++ b/Source/platform/graphics/GraphicsContextState.cpp
@@ -47,6 +47,7 @@ GraphicsContextState::GraphicsContextState(const GraphicsContextState& other)
, m_fillGradient(other.m_fillGradient)
, m_fillPattern(other.m_fillPattern)
, m_looper(other.m_looper)
+ , m_imageFilter(other.m_imageFilter)
, m_textDrawingMode(other.m_textDrawingMode)
, m_alpha(other.m_alpha)
, m_colorFilter(other.m_colorFilter)
@@ -204,6 +205,21 @@ void GraphicsContextState::clearDrawLooper()
m_fillPaint.setLooper(0);
}
+// Shadow. (This will need tweaking if we use image filters for other things.)
Stephen White 2014/10/23 01:45:47 Pls remove this comment.
sugoi1 2014/10/23 17:43:17 Done.
+void GraphicsContextState::setImageFilter(PassRefPtr<SkImageFilter> imageFilter)
+{
+ m_imageFilter = imageFilter;
+ m_strokePaint.setImageFilter(m_imageFilter.get());
Stephen White 2014/10/23 01:45:47 I don't think this is correct. If we set an image
sugoi1 2014/10/23 17:43:17 Done.
+ m_fillPaint.setImageFilter(m_imageFilter.get());
+}
+
+void GraphicsContextState::clearImageFilter()
+{
+ m_imageFilter.clear();
+ m_strokePaint.setImageFilter(0);
Stephen White 2014/10/23 01:45:47 Same here.
sugoi1 2014/10/23 17:43:17 Done.
+ m_fillPaint.setImageFilter(0);
+}
+
void GraphicsContextState::setAlphaAsFloat(float alpha)
{
if (alpha < 0) {

Powered by Google App Engine
This is Rietveld 408576698