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

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

Issue 413313002: Treat calls to CanvasRenderingContext2D.clearRect as operations that clear the canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: regionTrackingEnabled Created 6 years, 5 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/blink_platform.gypi ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.h
diff --git a/Source/platform/graphics/GraphicsContext.h b/Source/platform/graphics/GraphicsContext.h
index e16b781b1d6c4a4bc5e842751a1cc7884e096f3a..719c3ff76889a5770a16385d4fdfb66ed3285408 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -37,7 +37,7 @@
#include "platform/graphics/ImageOrientation.h"
#include "platform/graphics/GraphicsContextAnnotation.h"
#include "platform/graphics/GraphicsContextState.h"
-#include "platform/graphics/skia/OpaqueRegionSkia.h"
+#include "platform/graphics/RegionTracker.h"
#include "wtf/FastAllocBase.h"
#include "wtf/Forward.h"
#include "wtf/Noncopyable.h"
@@ -223,8 +223,14 @@ public:
// The opaque region is empty until tracking is turned on.
// It is never clerared by the context.
- void setTrackOpaqueRegion(bool track) { m_trackOpaqueRegion = track; }
- const OpaqueRegionSkia& opaqueRegion() const { return m_opaqueRegion; }
+ enum RegionTrackingMode {
+ RegionTrackingDisabled = 0,
+ RegionTrackingOpaque,
+ RegionTrackingOverwrite
+ };
+ void setRegionTrackingMode(RegionTrackingMode);
+ bool regionTrackingEnabled() { return m_regionTrackingMode != RegionTrackingDisabled; }
+ const RegionTracker& opaqueRegion() const { return m_trackedRegion; }
// The text region is empty until tracking is turned on.
// It is never clerared by the context.
@@ -520,7 +526,7 @@ private:
bool m_disableDestructionChecks;
#endif
// Tracks the region painted opaque via the GraphicsContext.
- OpaqueRegionSkia m_opaqueRegion;
+ RegionTracker m_trackedRegion;
// Tracks the region where text is painted via the GraphicsContext.
SkRect m_textRegion;
@@ -530,7 +536,7 @@ private:
float m_deviceScaleFactor;
// Activation for the above region tracking features
- bool m_trackOpaqueRegion : 1;
+ unsigned m_regionTrackingMode : 2;
bool m_trackTextRegion : 1;
// FIXME: Make this go away: crbug.com/236892
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698