Changeset 141333 in webkit
- Timestamp:
- Jan 30, 2013 3:34:57 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141332 r141333 1 2013-01-30 Tim Horton <timothy_horton@apple.com> 2 3 [mac] ImageBuffer should create accelerated buffers for small canvases, but we shouldn't force them to create compositing layers 4 https://bugs.webkit.org/show_bug.cgi?id=107804 5 <rdar://problem/11752381> 6 7 Reviewed by Simon Fraser. 8 9 Make all canvases IOSurface-backed if requested, instead of having a size threshold 10 under which we won't use accelerated canvas. 11 12 Make requiresCompositingForCanvas take the size of the canvas into account, using 13 the threshold which was previously in ImageBuffer to determine whether or not a 14 canvas should be forced into a compositing layer. 15 16 This improves canvas performance on some benchmarks 17 (http://www.mikechambers.com/html5/javascript/QuadTree/examples/collision.html, for example) 18 significantly, in cases where canvases which fall below the size limit 19 (and thus are unaccelerated) are being drawn rapidly into either accelerated 20 tiles or another accelerated canvas, by preventing excessive copying to/from the GPU. 21 22 * platform/graphics/cg/ImageBufferCG.cpp: 23 (WebCore): 24 (WebCore::ImageBuffer::ImageBuffer): 25 * rendering/RenderLayerCompositor.cpp: 26 (WebCore::RenderLayerCompositor::requiresCompositingForCanvas): 27 1 28 2013-01-30 Alec Flett <alecflett@chromium.org> 2 29 -
trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp
r137397 r141333 63 63 #if USE(IOSURFACE_CANVAS_BACKING_STORE) 64 64 static const int maxIOSurfaceDimension = 4096; 65 static const int minIOSurfaceArea = 50 * 100;66 65 67 66 static RetainPtr<IOSurfaceRef> createIOSurface(const IntSize& size) … … 137 136 138 137 #if USE(IOSURFACE_CANVAS_BACKING_STORE) 139 if (width.unsafeGet() >= maxIOSurfaceDimension || height.unsafeGet() >= maxIOSurfaceDimension || (width * height).unsafeGet() < minIOSurfaceArea)138 if (width.unsafeGet() >= maxIOSurfaceDimension || height.unsafeGet() >= maxIOSurfaceDimension) 140 139 accelerateRendering = false; 141 140 #else -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r141330 r141333 81 81 #endif 82 82 83 #if !PLATFORM(MAC) && !PLATFORM(IOS) 84 #define WTF_USE_COMPOSITING_FOR_SMALL_CANVASES 1 85 #endif 86 87 static const int canvasAreaThresholdRequiringCompositing = 50 * 100; 88 83 89 namespace WebCore { 84 90 … … 1907 1913 if (renderer->isCanvas()) { 1908 1914 HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(renderer->node()); 1909 return canvas->renderingContext() && canvas->renderingContext()->isAccelerated(); 1915 #if USE(COMPOSITING_FOR_SMALL_CANVASES) 1916 bool isCanvasLargeEnoughToForceCompositing = true; 1917 #else 1918 bool isCanvasLargeEnoughToForceCompositing = canvas->size().area() >= canvasAreaThresholdRequiringCompositing; 1919 #endif 1920 return canvas->renderingContext() && canvas->renderingContext()->isAccelerated() && (canvas->renderingContext()->is3d() || isCanvasLargeEnoughToForceCompositing); 1910 1921 } 1911 1922 return false;
Note: See TracChangeset
for help on using the changeset viewer.