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

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

Issue 23507002: Revert 156733 "Refactoring DrawLooper so that it can apply shado..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 7 years, 4 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: trunk/Source/core/platform/graphics/GraphicsContext.cpp
===================================================================
--- trunk/Source/core/platform/graphics/GraphicsContext.cpp (revision 156736)
+++ trunk/Source/core/platform/graphics/GraphicsContext.cpp (working copy)
@@ -282,18 +282,18 @@
return;
}
- RefPtr<DrawLooper> drawLooper = adoptRef(new DrawLooper);
- drawLooper->addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
- drawLooper->addUnmodifiedContent();
- setDrawLooper(drawLooper.release());
+ DrawLooper drawLooper;
+ drawLooper.addShadow(offset, blur, color, shadowTransformMode, shadowAlphaMode);
+ drawLooper.addUnmodifiedContent();
+ setDrawLooper(drawLooper);
}
-void GraphicsContext::setDrawLooper(PassRefPtr<DrawLooper> drawLooper)
+void GraphicsContext::setDrawLooper(const DrawLooper& drawLooper)
{
if (paintingDisabled())
return;
- m_state->m_looper = drawLooper;
+ m_state->m_looper = drawLooper.skDrawLooper();
}
void GraphicsContext::clearDrawLooper()
@@ -638,8 +638,8 @@
clip(rect.rect());
}
- RefPtr<DrawLooper> drawLooper = adoptRef(new DrawLooper);
- drawLooper->addShadow(shadowOffset, shadowBlur, shadowColor,
+ DrawLooper drawLooper;
+ drawLooper.addShadow(shadowOffset, shadowBlur, shadowColor,
DrawLooper::ShadowRespectsTransforms, DrawLooper::ShadowIgnoresAlpha);
setDrawLooper(drawLooper);
fillRectWithRoundedHole(outerRect, roundedHole, fillColor);
@@ -1718,7 +1718,7 @@
paint->setAntiAlias(m_state->m_shouldAntialias);
paint->setXfermodeMode(m_state->m_xferMode);
- paint->setLooper(m_state->m_looper ? m_state->m_looper->skDrawLooper() : 0);
+ paint->setLooper(m_state->m_looper.get());
}
void GraphicsContext::drawOuterPath(const SkPath& path, SkPaint& paint, int width)
« no previous file with comments | « trunk/Source/core/platform/graphics/GraphicsContext.h ('k') | trunk/Source/core/platform/graphics/GraphicsContextState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698