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

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

Issue 178113003: Revert of Use SkLayerDrawLooper::Builder to construct SkLayerDrawLooper. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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 | « Source/platform/graphics/GraphicsContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.cpp
diff --git a/Source/platform/graphics/GraphicsContext.cpp b/Source/platform/graphics/GraphicsContext.cpp
index dfa7e60dbd6ed1052dc459636b300f9782748e77..6ec5e4130dfe01f38c39a3fe0ce0de214fe7b34b 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -326,8 +326,8 @@
}
void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color,
- DrawLooperBuilder::ShadowTransformMode shadowTransformMode,
- DrawLooperBuilder::ShadowAlphaMode shadowAlphaMode)
+ DrawLooper::ShadowTransformMode shadowTransformMode,
+ DrawLooper::ShadowAlphaMode shadowAlphaMode)
{
if (paintingDisabled())
return;
@@ -337,18 +337,18 @@
return;
}
- OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
- drawLooperBuilder->addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
- drawLooperBuilder->addUnmodifiedContent();
- setDrawLooper(drawLooperBuilder.release());
-}
-
-void GraphicsContext::setDrawLooper(PassOwnPtr<DrawLooperBuilder> drawLooperBuilder)
-{
- if (paintingDisabled())
- return;
-
- mutableState()->m_looper = drawLooperBuilder->detachDrawLooper();
+ DrawLooper drawLooper;
+ drawLooper.addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
+ drawLooper.addUnmodifiedContent();
+ setDrawLooper(drawLooper);
+}
+
+void GraphicsContext::setDrawLooper(const DrawLooper& drawLooper)
+{
+ if (paintingDisabled())
+ return;
+
+ mutableState()->m_looper = drawLooper.skDrawLooper();
}
void GraphicsContext::clearDrawLooper()
@@ -772,10 +772,10 @@
clip(rect.rect());
}
- OwnPtr<DrawLooperBuilder> drawLooperBuilder = DrawLooperBuilder::create();
- drawLooperBuilder->addShadow(shadowOffset, shadowBlur, shadowColor,
- DrawLooperBuilder::ShadowRespectsTransforms, DrawLooperBuilder::ShadowIgnoresAlpha);
- setDrawLooper(drawLooperBuilder.release());
+ DrawLooper drawLooper;
+ drawLooper.addShadow(shadowOffset, shadowBlur, shadowColor,
+ DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
+ setDrawLooper(drawLooper);
fillRectWithRoundedHole(outerRect, roundedHole, fillColor);
restore();
clearDrawLooper();
« no previous file with comments | « Source/platform/graphics/GraphicsContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698