Changeset 93901 in webkit
- Timestamp:
- Aug 26, 2011, 12:11:59 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r93898 r93901 1 2011-08-23 Stephen White <senorblanco@chromium.org> 2 3 Assertion fires if canvas is resized while save() active 4 https://bugs.webkit.org/show_bug.cgi?id=66710 5 6 Reviewed by Simon Fraser. 7 8 * fast/canvas/resize-while-save-active-expected.txt: Added. 9 * fast/canvas/resize-while-save-active.html: Added. 10 1 11 2011-08-26 Martin Robinson <mrobinson@igalia.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r93900 r93901 1 2011-08-23 Stephen White <senorblanco@chromium.org> 2 3 Assertion fires if canvas is resized while save() active 4 https://bugs.webkit.org/show_bug.cgi?id=66710 5 6 Reviewed by Simon Fraser. 7 8 Test: fast/canvas/resize-while-save-active.html 9 10 * html/HTMLCanvasElement.cpp: 11 (WebCore::HTMLCanvasElement::reset): 12 Call CanvasRenderingContext2D::reset() before resizing the canvas, 13 so that the GraphicsContext state stack can be unwound. 14 * html/canvas/CanvasRenderingContext2D.cpp: 15 (WebCore::CanvasRenderingContext2D::unwindStateStack): 16 (WebCore::CanvasRenderingContext2D::~CanvasRenderingContext2D): 17 Refactor the state stack unwinding code from the destructor to 18 unwindStateStack() (new). 19 (WebCore::CanvasRenderingContext2D::reset): 20 Unwind the GraphicsContext state stack when the context is reset. 21 * html/canvas/CanvasRenderingContext2D.h: 22 1 23 2011-08-26 Darin Adler <darin@apple.com> 2 24 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r93303 r93901 238 238 h = DefaultHeight; 239 239 240 if (m_context && m_context->is2d()) { 241 CanvasRenderingContext2D* context2D = static_cast<CanvasRenderingContext2D*>(m_context.get()); 242 context2D->reset(); 243 } 244 240 245 IntSize oldSize = size(); 241 246 setSurfaceSize(IntSize(w, h)); // The image buffer gets cleared here. … … 245 250 static_cast<WebGLRenderingContext*>(m_context.get())->reshape(width(), height()); 246 251 #endif 247 248 if (m_context && m_context->is2d()) {249 CanvasRenderingContext2D* context2D = static_cast<CanvasRenderingContext2D*>(m_context.get());250 context2D->reset();251 }252 252 253 253 if (RenderObject* renderer = this->renderer()) { -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r93873 r93901 128 128 } 129 129 130 CanvasRenderingContext2D::~CanvasRenderingContext2D() 131 { 132 #if !ASSERT_DISABLED 130 void CanvasRenderingContext2D::unwindStateStack() 131 { 133 132 // Ensure that the state stack in the ImageBuffer's context 134 133 // is cleared before destruction, to avoid assertions in the … … 140 139 } 141 140 } 141 } 142 143 CanvasRenderingContext2D::~CanvasRenderingContext2D() 144 { 145 #if !ASSERT_DISABLED 146 unwindStateStack(); 142 147 #endif 143 148 } … … 171 176 void CanvasRenderingContext2D::reset() 172 177 { 178 unwindStateStack(); 173 179 m_stateStack.resize(1); 174 180 m_stateStack.first() = State(); -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.h
r93275 r93901 274 274 GraphicsContext* drawingContext() const; 275 275 276 void unwindStateStack(); 277 276 278 void applyStrokePattern(); 277 279 void applyFillPattern();
Note:
See TracChangeset
for help on using the changeset viewer.