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

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

Issue 44253005: 2D Canvas: Refactor code re-attempting to allocate an imageBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@convertL
Patch Set: Merge with CL 74533004 to test on win and mac. Created 7 years, 1 month 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.h
diff --git a/Source/core/html/HTMLCanvasElement.h b/Source/core/html/HTMLCanvasElement.h
index 02be7589efe49ee0d7f1217fda849c1d9e43dd15..68876411c6f58bfa3695183b4c9c1ae0f2b3ec06 100644
--- a/Source/core/html/HTMLCanvasElement.h
+++ b/Source/core/html/HTMLCanvasElement.h
@@ -120,7 +120,7 @@ public:
bool is3D() const;
- bool hasCreatedImageBuffer() const { return m_hasCreatedImageBuffer; }
+ bool hasImageBuffer() const { return m_imageBuffer.get(); }
bool shouldAccelerate(const IntSize&) const;
@@ -164,8 +164,9 @@ private:
float m_deviceScaleFactor; // FIXME: This is always 1 and should probable be deleted
bool m_originClean;
- // m_createdImageBuffer means we tried to malloc the buffer. We didn't necessarily get it.
- mutable bool m_hasCreatedImageBuffer;
+ // It prevents HTMLCanvasElement::buffer() from continuously re-attempting to allocate an imageBuffer
+ // after the first attempt failed.
+ mutable bool m_didFailToCreateImageBuffer;
mutable bool m_didClearImageBuffer;
OwnPtr<ImageBuffer> m_imageBuffer;
mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver;
« no previous file with comments | « LayoutTests/fast/canvas/script-tests/canvas-extremely-large-dimensions.js ('k') | Source/core/html/HTMLCanvasElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698