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

Unified Diff: Source/platform/graphics/paint/SkPictureBuilder.h

Issue 1160183003: Use SkPictureBuilder in SVGShapePainter, and generalize SkPictureBuilder. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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/paint/DisplayItemListContextRecorder.h ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/paint/SkPictureBuilder.h
diff --git a/Source/platform/graphics/paint/SkPictureBuilder.h b/Source/platform/graphics/paint/SkPictureBuilder.h
index d07824566013d96558d75e25b06c498da79402ee..8a3234414ad7e9e8fccece8b92f0d2cc2fcedc78 100644
--- a/Source/platform/graphics/paint/SkPictureBuilder.h
+++ b/Source/platform/graphics/paint/SkPictureBuilder.h
@@ -18,9 +18,13 @@ class SkPictureBuilder {
WTF_MAKE_NONCOPYABLE(SkPictureBuilder);
STACK_ALLOCATED();
public:
- SkPictureBuilder(const FloatRect& bounds, GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisabled, SkMetaData* metaData = 0)
+ SkPictureBuilder(const FloatRect& bounds, SkMetaData* metaData = 0, GraphicsContext* containingContext = 0)
: m_bounds(bounds)
{
+ GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisabled;
+ if (containingContext && containingContext->contextDisabled())
+ disabledMode = GraphicsContext::FullyDisabled;
+
if (RuntimeEnabledFeatures::slimmingPaintEnabled()) {
m_displayItemList = DisplayItemList::create();
m_context = adoptPtr(new GraphicsContext(m_displayItemList.get(), disabledMode, metaData));
@@ -28,6 +32,11 @@ public:
m_context = GraphicsContext::deprecatedCreateWithCanvas(nullptr, disabledMode, metaData);
m_context->beginRecording(m_bounds);
}
+
+ if (containingContext) {
+ m_context->setDeviceScaleFactor(containingContext->deviceScaleFactor());
+ m_context->setPrinting(containingContext->printing());
+ }
}
GraphicsContext& context() { return *m_context; }
« no previous file with comments | « Source/platform/graphics/paint/DisplayItemListContextRecorder.h ('k') | Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698