[mac] ImageBuffer should create accelerated buffers for small canvases, but we should...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 23:34:57 +0000 (23:34 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2013 23:34:57 +0000 (23:34 +0000)
commit9a70ceeadc74b403e280e1ec1ac67f4a54e61622
treee3345930c3b95c9f38139cac63e58fdade7f1824
parentefa6574f8ce4755691bbc6f860a8ea515862989c
[mac] ImageBuffer should create accelerated buffers for small canvases, but we shouldn't force them to create compositing layers
https://bugs.webkit.org/show_bug.cgi?id=107804
<rdar://problem/11752381>

Reviewed by Simon Fraser.

Make all canvases IOSurface-backed if requested, instead of having a size threshold
under which we won't use accelerated canvas.

Make requiresCompositingForCanvas take the size of the canvas into account, using
the threshold which was previously in ImageBuffer to determine whether or not a
canvas should be forced into a compositing layer.

This improves canvas performance on some benchmarks
(http://www.mikechambers.com/html5/javascript/QuadTree/examples/collision.html, for example)
significantly, in cases where canvases which fall below the size limit
(and thus are unaccelerated) are being drawn rapidly into either accelerated
tiles or another accelerated canvas, by preventing excessive copying to/from the GPU.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore):
(WebCore::ImageBuffer::ImageBuffer):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForCanvas):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@141333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp