Changeset 117379 in webkit
- Timestamp:
- May 16, 2012 7:18:41 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r117377 r117379 1 2012-05-16 James Robinson <jamesr@chromium.org> 2 3 GraphicsContext3D interface should not be aware of CanvasRenderingContext 4 https://bugs.webkit.org/show_bug.cgi?id=86550 5 6 Reviewed by Darin Adler. 7 8 GraphicsContext3D is a WebCore/platform API construct. CanvasRenderingContext is a WebCore/html concept. Thus, 9 the former shouldn't depend on the latter. In turns out that all everyone ever wants from a 10 CanvasRenderingContext in GraphicsContext3D is its underlying ImageBuffer, which is a WebCore/platform concept, 11 so this just updates the APIs and implementations to use that instead. 12 13 Refactor only, no new tests. 14 15 * html/canvas/WebGLRenderingContext.cpp: 16 (WebCore::WebGLRenderingContext::paintRenderingResultsToCanvas): 17 * platform/graphics/GraphicsContext3D.h: 18 * platform/graphics/cairo/DrawingBufferCairo.cpp: 19 (WebCore::DrawingBuffer::paintCompositedResultsToCanvas): 20 * platform/graphics/chromium/DrawingBufferChromium.cpp: 21 (WebCore::DrawingBuffer::paintCompositedResultsToCanvas): 22 * platform/graphics/clutter/DrawingBufferClutter.cpp: 23 (WebCore::DrawingBuffer::paintCompositedResultsToCanvas): 24 * platform/graphics/efl/GraphicsContext3DEfl.cpp: 25 (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): 26 (WebCore::GraphicsContext3D::paintCompositedResultsToCanvas): 27 * platform/graphics/gpu/DrawingBuffer.h: 28 * platform/graphics/gpu/qt/DrawingBufferQt.cpp: 29 (WebCore::DrawingBuffer::paintCompositedResultsToCanvas): 30 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: 31 (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): 32 (WebCore::GraphicsContext3D::paintCompositedResultsToCanvas): 33 1 34 2012-05-16 Joshua Bell <jsbell@chromium.org> 2 35 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r116374 r117379 691 691 // happened after it was composited should be ignored by the compositor. 692 692 if (m_context->layerComposited() && !m_attributes.preserveDrawingBuffer) { 693 m_context->paintCompositedResultsToCanvas( this);693 m_context->paintCompositedResultsToCanvas(canvas()->buffer()); 694 694 695 695 #if USE(ACCELERATED_COMPOSITING) && PLATFORM(CHROMIUM) 696 696 if (m_drawingBuffer) 697 m_drawingBuffer->paintCompositedResultsToCanvas( this);697 m_drawingBuffer->paintCompositedResultsToCanvas(canvas()->buffer()); 698 698 #endif 699 699 … … 711 711 if (m_drawingBuffer) 712 712 m_drawingBuffer->commit(); 713 m_context->paintRenderingResultsToCanvas( this, m_drawingBuffer.get());713 m_context->paintRenderingResultsToCanvas(canvas()->buffer(), m_drawingBuffer.get()); 714 714 715 715 if (m_drawingBuffer) { -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r114268 r117379 93 93 94 94 namespace WebCore { 95 class CanvasRenderingContext;96 95 class DrawingBuffer; 97 96 class Extensions3D; … … 808 807 bool layerComposited() const; 809 808 810 void paintRenderingResultsToCanvas( CanvasRenderingContext*, DrawingBuffer*);809 void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*); 811 810 PassRefPtr<ImageData> paintRenderingResultsToImageData(DrawingBuffer*); 812 bool paintCompositedResultsToCanvas( CanvasRenderingContext*);811 bool paintCompositedResultsToCanvas(ImageBuffer*); 813 812 814 813 // Support for buffer creation and deletion -
trunk/Source/WebCore/platform/graphics/cairo/DrawingBufferCairo.cpp
r114961 r117379 99 99 } 100 100 101 void DrawingBuffer::paintCompositedResultsToCanvas( CanvasRenderingContext* context)101 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer*) 102 102 { 103 103 } -
trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
r114983 r117379 207 207 208 208 #if USE(ACCELERATED_COMPOSITING) 209 void DrawingBuffer::paintCompositedResultsToCanvas( CanvasRenderingContext* context)209 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer* imageBuffer) 210 210 { 211 211 if (!m_context->makeContextCurrent() || m_context->getExtensions()->getGraphicsResetStatusARB() != GraphicsContext3D::NO_ERROR) … … 225 225 226 226 Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(m_context->getExtensions()); 227 extensions->paintFramebufferToCanvas(framebuffer, framebufferSize.width(), framebufferSize.height(), !m_context->getContextAttributes().premultipliedAlpha, context->canvas()->buffer());227 extensions->paintFramebufferToCanvas(framebuffer, framebufferSize.width(), framebufferSize.height(), !m_context->getContextAttributes().premultipliedAlpha, imageBuffer); 228 228 m_context->deleteFramebuffer(framebuffer); 229 229 -
trunk/Source/WebCore/platform/graphics/clutter/DrawingBufferClutter.cpp
r113493 r117379 72 72 } 73 73 74 void DrawingBuffer::paintCompositedResultsToCanvas( CanvasRenderingContext* context)74 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer*) 75 75 { 76 76 } -
trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DEfl.cpp
r109838 r117379 726 726 } 727 727 728 void GraphicsContext3D::paintRenderingResultsToCanvas( CanvasRenderingContext* context, DrawingBuffer* drawingBuffer)728 void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer* drawingBuffer) 729 729 { 730 730 notImplemented(); … … 737 737 } 738 738 739 bool GraphicsContext3D::paintCompositedResultsToCanvas( CanvasRenderingContext*)739 bool GraphicsContext3D::paintCompositedResultsToCanvas(ImageBuffer*) 740 740 { 741 741 return false; -
trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.h
r114983 r117379 45 45 46 46 namespace WebCore { 47 class CanvasRenderingContext;48 47 class GraphicsContext3D; 49 48 class ImageData; … … 128 127 bool requiresCopyFromBackToFrontBuffer() const; 129 128 unsigned frontColorBuffer() const; 130 void paintCompositedResultsToCanvas( CanvasRenderingContext*);129 void paintCompositedResultsToCanvas(ImageBuffer*); 131 130 #endif 132 131 -
trunk/Source/WebCore/platform/graphics/gpu/qt/DrawingBufferQt.cpp
r114961 r117379 102 102 } 103 103 104 void DrawingBuffer::paintCompositedResultsToCanvas( CanvasRenderingContext* context)104 void DrawingBuffer::paintCompositedResultsToCanvas(ImageBuffer*) 105 105 { 106 106 } -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
r114992 r117379 31 31 #include "GraphicsContext3D.h" 32 32 33 #include "CanvasRenderingContext.h"34 33 #include "Extensions3DOpenGL.h" 35 34 #include "GraphicsContext.h" 36 #include "HTMLCanvasElement.h"37 35 #include "ImageBuffer.h" 38 36 #include "ImageData.h" … … 110 108 } 111 109 112 void GraphicsContext3D::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer*) 113 { 114 HTMLCanvasElement* canvas = context->canvas(); 115 ImageBuffer* imageBuffer = canvas->buffer(); 116 110 void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer*) 111 { 117 112 int rowBytes = m_currentWidth * 4; 118 113 int totalBytes = rowBytes * m_currentHeight; … … 134 129 135 130 paintToCanvas(pixels.get(), m_currentWidth, m_currentHeight, 136 canvas->width(), canvas->height(), imageBuffer->context()->platformContext());137 } 138 139 bool GraphicsContext3D::paintCompositedResultsToCanvas( CanvasRenderingContext*)131 imageBuffer->internalSize().width(), imageBuffer->internalSize().height(), imageBuffer->context()->platformContext()); 132 } 133 134 bool GraphicsContext3D::paintCompositedResultsToCanvas(ImageBuffer*) 140 135 { 141 136 // Not needed at the moment, so return that nothing was done. -
trunk/Source/WebKit/chromium/ChangeLog
r117341 r117379 1 2012-05-16 James Robinson <jamesr@chromium.org> 2 3 GraphicsContext3D interface should not be aware of CanvasRenderingContext 4 https://bugs.webkit.org/show_bug.cgi?id=86550 5 6 Reviewed by Darin Adler. 7 8 Updates chromium implementation of GraphicsContext3D for API change and removes a bunch of unnecessary 9 #includes. 10 11 * src/GraphicsContext3DChromium.cpp: 12 (WebCore::GraphicsContext3DPrivate::paintRenderingResultsToCanvas): 13 (WebCore::GraphicsContext3DPrivate::paintCompositedResultsToCanvas): 14 (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): 15 * src/GraphicsContext3DPrivate.h: 16 (GraphicsContext3DPrivate): 17 1 18 2012-05-16 Joshua Bell <jsbell@chromium.org> 2 19 -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r117190 r117379 35 35 #include "GraphicsContext3D.h" 36 36 37 #include "CachedImage.h"38 #include "CanvasRenderingContext.h"39 #include "Chrome.h"40 #include "ChromeClientImpl.h"41 37 #include "DrawingBuffer.h" 42 38 #include "Extensions3DChromium.h" … … 44 40 #include "GrGLInterface.h" 45 41 #include "GraphicsContext3DPrivate.h" 46 #include "HTMLCanvasElement.h"47 #include "HTMLImageElement.h"48 42 #include "ImageBuffer.h" 49 43 #include "ImageData.h" … … 54 48 #include <wtf/FastMalloc.h> 55 49 #include <wtf/text/CString.h> 50 #include <wtf/text/StringHash.h> 56 51 57 52 … … 257 252 } 258 253 259 void GraphicsContext3DPrivate::paintRenderingResultsToCanvas(CanvasRenderingContext* context, DrawingBuffer* drawingBuffer) 260 { 261 ImageBuffer* imageBuffer = context->canvas()->buffer(); 254 void GraphicsContext3DPrivate::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer* drawingBuffer) 255 { 262 256 Platform3DObject framebufferId; 263 257 int width, height; … … 266 260 } 267 261 268 bool GraphicsContext3DPrivate::paintCompositedResultsToCanvas( CanvasRenderingContext* context)262 bool GraphicsContext3DPrivate::paintCompositedResultsToCanvas(ImageBuffer*) 269 263 { 270 264 return false; … … 1205 1199 } 1206 1200 1207 void GraphicsContext3D::paintRenderingResultsToCanvas( CanvasRenderingContext* context, DrawingBuffer* drawingBuffer)1208 { 1209 return m_private->paintRenderingResultsToCanvas( context, drawingBuffer);1201 void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer, DrawingBuffer* drawingBuffer) 1202 { 1203 return m_private->paintRenderingResultsToCanvas(imageBuffer, drawingBuffer); 1210 1204 } 1211 1205 … … 1215 1209 } 1216 1210 1217 DELEGATE_TO_INTERNAL_1R(paintCompositedResultsToCanvas, CanvasRenderingContext*, bool)1211 DELEGATE_TO_INTERNAL_1R(paintCompositedResultsToCanvas, ImageBuffer*, bool) 1218 1212 1219 1213 DELEGATE_TO_INTERNAL_R(createBuffer, Platform3DObject) -
trunk/Source/WebKit/chromium/src/GraphicsContext3DPrivate.h
r117190 r117379 77 77 void markLayerComposited(); 78 78 79 void paintRenderingResultsToCanvas( CanvasRenderingContext*, DrawingBuffer*);79 void paintRenderingResultsToCanvas(ImageBuffer*, DrawingBuffer*); 80 80 void paintFramebufferToCanvas(int framebuffer, int width, int height, bool premultiplyAlpha, ImageBuffer*); 81 81 PassRefPtr<ImageData> paintRenderingResultsToImageData(DrawingBuffer*); 82 bool paintCompositedResultsToCanvas( CanvasRenderingContext*);82 bool paintCompositedResultsToCanvas(ImageBuffer*); 83 83 84 84 void prepareTexture();
Note: See TracChangeset
for help on using the changeset viewer.