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

Unified Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 293963009: Fixing GraphicsContext state checks to support oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: response to review comments 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
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 737f7fb5fea854996ca309abbd6bfbdc52ab697f..ed3bc2c48ea8520ba9d9e16c10236bc755b74f4f 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -98,7 +98,9 @@ HTMLCanvasElement::~HTMLCanvasElement()
HashSet<RawPtr<CanvasObserver> >::iterator end = m_observers.end();
for (HashSet<RawPtr<CanvasObserver> >::iterator it = m_observers.begin(); it != end; ++it)
(*it)->canvasDestroyed(this);
- m_context.clear(); // Ensure this goes away before the ImageBuffer.
+ // Ensure these go away before the ImageBuffer.
+ m_contextStateSaver.clear();
zerny-chromium 2014/05/28 06:17:26 This should be outside the #if !ENABLE(OILPAN) sin
+ m_context.clear();
#endif
}
@@ -515,6 +517,9 @@ void HTMLCanvasElement::createImageBufferInternal()
// See CanvasRenderingContext2D::State::State() for more information.
m_imageBuffer->context()->setMiterLimit(10);
m_imageBuffer->context()->setStrokeThickness(1);
+#if !ASSERT_DISABLED
+ m_imageBuffer->context()->disableDestructionChecks(); // 2D canvas is allowed to leave context in an unfinalized state.
+#endif
m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer->context()));
if (m_context)

Powered by Google App Engine
This is Rietveld 408576698