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

Unified Diff: Source/platform/mac/LocalCurrentGraphicsContext.mm

Issue 1170523002: Removing GraphicsContext from ImageBuffer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix for shape bug 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/mac/LocalCurrentGraphicsContext.h ('k') | Source/platform/scroll/ScrollbarThemeMacCommon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/mac/LocalCurrentGraphicsContext.mm
diff --git a/Source/platform/mac/LocalCurrentGraphicsContext.mm b/Source/platform/mac/LocalCurrentGraphicsContext.mm
index 773d16e28307f3686e6fedc867165847b8d4f196..3497070e56a3233ff53388206fce8d0ebae24731 100644
--- a/Source/platform/mac/LocalCurrentGraphicsContext.mm
+++ b/Source/platform/mac/LocalCurrentGraphicsContext.mm
@@ -29,26 +29,32 @@
namespace blink {
LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphicsContext, const IntRect& dirtyRect)
- : LocalCurrentGraphicsContext(graphicsContext, nullptr, dirtyRect)
+ : LocalCurrentGraphicsContext(graphicsContext->canvas(), graphicsContext->deviceScaleFactor(), nullptr, dirtyRect)
{
}
LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(GraphicsContext* graphicsContext, const IntRect* interestRect,
const IntRect& dirtyRect)
+ : LocalCurrentGraphicsContext(graphicsContext->canvas(), graphicsContext->deviceScaleFactor(), interestRect, dirtyRect)
+{
+}
+
+LocalCurrentGraphicsContext::LocalCurrentGraphicsContext(SkCanvas* canvas, float deviceScaleFactor, const IntRect* interestRect,
+ const IntRect& dirtyRect)
: m_didSetGraphicsContext(false)
, m_inflatedDirtyRect(ThemeMac::inflateRectForAA(dirtyRect))
- , m_skiaBitLocker(graphicsContext->canvas(),
+ , m_skiaBitLocker(canvas,
m_inflatedDirtyRect,
- graphicsContext->deviceScaleFactor())
+ deviceScaleFactor)
{
- m_savedGraphicsContext = graphicsContext;
- graphicsContext->save();
+ m_savedCanvas = canvas;
+ canvas->save();
bool clipToInterest = interestRect && RuntimeEnabledFeatures::slimmingPaintEnabled() && !interestRect->contains(m_inflatedDirtyRect);
if (clipToInterest) {
- IntRect clippedBounds(m_inflatedDirtyRect);
- clippedBounds.intersect(*interestRect);
- graphicsContext->clipRect(clippedBounds, NotAntiAliased, SkRegion::kIntersect_Op);
+ IntRect clippedBounds(m_inflatedDirtyRect);
+ clippedBounds.intersect(*interestRect);
+ canvas->clipRect(clippedBounds, SkRegion::kIntersect_Op);
}
CGContextRef cgContext = this->cgContext();
@@ -70,7 +76,7 @@ LocalCurrentGraphicsContext::~LocalCurrentGraphicsContext()
[m_savedNSGraphicsContext release];
}
- m_savedGraphicsContext->restore();
+ m_savedCanvas->restore();
}
CGContextRef LocalCurrentGraphicsContext::cgContext()
« no previous file with comments | « Source/platform/mac/LocalCurrentGraphicsContext.h ('k') | Source/platform/scroll/ScrollbarThemeMacCommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698