Changeset 64308 in webkit
- Timestamp:
- Jul 29, 2010 2:35:23 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64304 r64308 1 2010-07-29 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Simon Fraser. 4 5 Ask a canvas' rendering context if it is accelerated instead tying it directly to webgl 6 https://bugs.webkit.org/show_bug.cgi?id=43206 7 8 This unifies the logic for whether a canvas is accelerated or not into one place 9 and makes it easier to expand the logic in the future to, for example, cover some 10 2d canvases. 11 12 Just a refactoring, no change in behavior so no new tests. 13 14 * html/canvas/CanvasRenderingContext.h: 15 (WebCore::CanvasRenderingContext::isAccelerated): 16 * html/canvas/WebGLRenderingContext.h: 17 (WebCore::WebGLRenderingContext::isAccelerated): 18 * rendering/RenderHTMLCanvas.cpp: 19 (WebCore::RenderHTMLCanvas::requiresLayer): 20 * rendering/RenderLayerCompositor.cpp: 21 (WebCore::RenderLayerCompositor::requiresCompositingForCanvas): 22 1 23 2010-07-29 Anders Carlsson <andersca@apple.com> 2 24 -
trunk/WebCore/html/canvas/CanvasRenderingContext.h
r50181 r64308 47 47 virtual bool is2d() const { return false; } 48 48 virtual bool is3d() const { return false; } 49 virtual bool isAccelerated() const { return false; } 49 50 50 51 private: -
trunk/WebCore/html/canvas/WebGLRenderingContext.h
r63505 r64308 59 59 60 60 virtual bool is3d() const { return true; } 61 virtual bool isAccelerated() const { return true; } 61 62 62 63 // Helper to return the size in bytes of OpenGL data types -
trunk/WebCore/rendering/RenderHTMLCanvas.cpp
r47843 r64308 27 27 #include "RenderHTMLCanvas.h" 28 28 29 #include "CanvasRenderingContext.h" 29 30 #include "Document.h" 30 31 #include "GraphicsContext.h" … … 49 50 return true; 50 51 51 #if ENABLE(3D_CANVAS)52 52 HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(node()); 53 return canvas && canvas->is3D(); 54 #else 55 return false; 56 #endif 53 return canvas && canvas->renderingContext() && canvas->renderingContext()->isAccelerated(); 57 54 } 58 55 -
trunk/WebCore/rendering/RenderLayerCompositor.cpp
r64078 r64308 30 30 31 31 #include "AnimationController.h" 32 #include "CanvasRenderingContext.h" 32 33 #include "CSSPropertyNames.h" 33 34 #include "Chrome.h" … … 1186 1187 bool RenderLayerCompositor::requiresCompositingForCanvas(RenderObject* renderer) const 1187 1188 { 1188 #if ENABLE(3D_CANVAS)1189 1189 if (renderer->isCanvas()) { 1190 1190 HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(renderer->node()); 1191 return canvas->is3D(); 1192 } 1193 #else 1194 UNUSED_PARAM(renderer); 1195 #endif 1191 return canvas->renderingContext() && canvas->renderingContext()->isAccelerated(); 1192 } 1196 1193 return false; 1197 1194 }
Note: See TracChangeset
for help on using the changeset viewer.