The code I added to ~CanvasRenderingContext2D() to unwind the graphics stack can end up allocating a new image buffer, which is bad.
<rdar://problem/9362156>
Created attachment 92273 [details] Patch
Comment on attachment 92273 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=92273&action=review > Source/WebCore/html/HTMLCanvasElement.h:103 > - GraphicsContext* drawingContext() const; > + enum ImageBufferCreation { AllowImageBufferCreation, DisallowImageBufferCreation }; > + GraphicsContext* drawingContext(ImageBufferCreation allowBufferCreation = AllowImageBufferCreation) const; Can we just add a second function with this behavior? Or maybe just a function that returns a boolean to tell us if we already have a buffer? I think that adding this argument is unnecessary given how simple the function is.
Comment on attachment 92273 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=92273&action=review >> Source/WebCore/html/HTMLCanvasElement.h:103 >> + GraphicsContext* drawingContext(ImageBufferCreation allowBufferCreation = AllowImageBufferCreation) const; > > Can we just add a second function with this behavior? Or maybe just a function that returns a boolean to tell us if we already have a buffer? I think that adding this argument is unnecessary given how simple the function is. One possible name for a new function would be existingDrawingContext. But I think that the hasImageBuffer solution would be fine.
Comment on attachment 92273 [details] Patch Yeah, sounds good.
Created attachment 92278 [details] Patch
http://trac.webkit.org/changeset/85760