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

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

Issue 293963009: Fixing GraphicsContext state checks to support oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: removed change to test expectations Created 6 years, 7 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 02af6b47f1201460f733dcbcf36ccf8566019a05..ac792ec18e8434c9ad3bbf39becfb03b997adc4f 100644
--- a/Source/platform/graphics/GraphicsContext.cpp
+++ b/Source/platform/graphics/GraphicsContext.cpp
@@ -122,6 +122,7 @@ GraphicsContext::GraphicsContext(SkCanvas* canvas, DisabledMode disableContextOr
#if !ASSERT_DISABLED
, m_annotationCount(0)
, m_layerCount(0)
+ , m_disableDestructionChecks(false)
#endif
, m_disabledState(disableContextOrPainting)
, m_trackOpaqueRegion(false)
@@ -144,20 +145,15 @@ GraphicsContext::GraphicsContext(SkCanvas* canvas, DisabledMode disableContextOr
GraphicsContext::~GraphicsContext()
{
-#if !ENABLE(OILPAN)
- // FIXME: Oilpan: These asserts are not true for
- // CanvasRenderingContext2D. Therefore, there is debug mode code
- // in the CanvasRenderingContext2D that forces this to be true so
- // that the assertions can be here for all the other cases. With
- // Oilpan we cannot run that code in the CanvasRenderingContext2D
- // destructor because it touches other objects that are already
- // dead. We need to find another way of doing these asserts when
- // Oilpan is enabled.
- ASSERT(!m_paintStateIndex);
- ASSERT(!m_paintState->saveCount());
- ASSERT(!m_annotationCount);
- ASSERT(!m_layerCount);
- ASSERT(m_recordingStateStack.isEmpty());
+#if !ASSERT_DISABLED
+ if (!m_disableDestructionChecks) {
+ ASSERT(!m_paintStateIndex);
+ ASSERT(!m_paintState->saveCount());
+ ASSERT(!m_annotationCount);
+ ASSERT(!m_layerCount);
+ ASSERT(m_recordingStateStack.isEmpty());
+ ASSERT(m_canvasStateStack.isEmpty());
+ }
#endif
}
« 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