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

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: updated 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
Index: Source/core/html/HTMLCanvasElement.cpp
diff --git a/Source/core/html/HTMLCanvasElement.cpp b/Source/core/html/HTMLCanvasElement.cpp
index 88f05be55e4d05be983401dbf35925bde4185a00..466788272dc19f3fde9044ed0db6c295d71232ac 100644
--- a/Source/core/html/HTMLCanvasElement.cpp
+++ b/Source/core/html/HTMLCanvasElement.cpp
@@ -97,7 +97,9 @@ HTMLCanvasElement::~HTMLCanvasElement()
(*it)->canvasDestroyed(this);
#if !ENABLE(OILPAN)
- m_context.clear(); // Ensure this goes away before the ImageBuffer.
+ // Ensure these go away before the ImageBuffer.
+ m_contextStateSaver.clear();
+ m_context.clear();
#endif
}
@@ -514,6 +516,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.
f(malita) 2014/05/27 20:28:22 If we have exclusive control of the initialization
Justin Novosad 2014/05/27 22:25:25 Right no ImageBuffer is not explicitly aware that
+#endif
m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer->context()));
if (m_context)

Powered by Google App Engine
This is Rietveld 408576698