Changeset 181468 in webkit
- Timestamp:
- Mar 12, 2015, 7:01:42 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 deleted
- 14 edited
-
CMakeLists.txt (modified) (1 diff)
-
ChangeLog (modified) (1 diff)
-
PlatformEfl.cmake (modified) (1 diff)
-
PlatformGTK.cmake (modified) (1 diff)
-
WebCore.vcxproj/WebCore.vcxproj (modified) (2 diffs)
-
WebCore.vcxproj/WebCore.vcxproj.filters (modified) (2 diffs)
-
WebCore.xcodeproj/project.pbxproj (modified) (6 diffs)
-
html/canvas/WebGL2RenderingContext.cpp (modified) (1 diff)
-
html/canvas/WebGLRenderingContext.cpp (modified) (1 diff)
-
html/canvas/WebGLRenderingContextBase.cpp (modified) (27 diffs)
-
html/canvas/WebGLRenderingContextBase.h (modified) (3 diffs)
-
platform/graphics/GraphicsContext.h (modified) (1 diff)
-
platform/graphics/GraphicsContext3D.h (modified) (2 diffs)
-
platform/graphics/cairo/DrawingBufferCairo.cpp (deleted)
-
platform/graphics/gpu/DrawingBuffer.cpp (deleted)
-
platform/graphics/gpu/DrawingBuffer.h (deleted)
-
platform/graphics/gpu/mac (deleted)
-
platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r181408 r181468 3075 3075 platform/graphics/GraphicsContext3D.cpp 3076 3076 platform/graphics/FormatConverter.cpp 3077 3078 platform/graphics/gpu/DrawingBuffer.cpp3079 3077 ) 3080 3078 endif () -
trunk/Source/WebCore/ChangeLog
r181465 r181468 1 2015-03-12 Zan Dobersek <zdobersek@igalia.com> 2 3 Remove DrawingBuffer 4 https://bugs.webkit.org/show_bug.cgi?id=142641 5 6 Reviewed by Darin Adler. 7 8 Remove the DrawingBuffer class. Objects of this type were only held in the 9 WebGLRenderingContext (later renamed to WebGLRenderingContextBase) on the 10 Chromium port, with the relevant code removed in r147888. Since then, the 11 m_drawingBuffer member variable has always been null. 12 13 * CMakeLists.txt: 14 * PlatformEfl.cmake: 15 * PlatformGTK.cmake: 16 * WebCore.vcxproj/WebCore.vcxproj: 17 * WebCore.vcxproj/WebCore.vcxproj.filters: 18 * WebCore.xcodeproj/project.pbxproj: 19 * html/canvas/WebGL2RenderingContext.cpp: 20 (WebCore::WebGL2RenderingContext::copyTexImage2D): 21 * html/canvas/WebGLRenderingContext.cpp: 22 (WebCore::WebGLRenderingContext::copyTexImage2D): 23 * html/canvas/WebGLRenderingContextBase.cpp: 24 (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): 25 (WebCore::WebGLRenderingContextBase::initializeNewContext): 26 (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D): 27 (WebCore::WebGLRenderingContextBase::markContextChanged): 28 (WebCore::WebGLRenderingContextBase::clearIfComposited): 29 (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas): 30 (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData): 31 (WebCore::WebGLRenderingContextBase::reshape): 32 (WebCore::WebGLRenderingContextBase::drawingBufferWidth): 33 (WebCore::WebGLRenderingContextBase::drawingBufferHeight): 34 (WebCore::WebGLRenderingContextBase::activeTexture): 35 (WebCore::WebGLRenderingContextBase::bindFramebuffer): 36 (WebCore::WebGLRenderingContextBase::bindTexture): 37 (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): 38 (WebCore::WebGLRenderingContextBase::deleteFramebuffer): 39 (WebCore::WebGLRenderingContextBase::disable): 40 (WebCore::WebGLRenderingContextBase::enable): 41 (WebCore::WebGLRenderingContextBase::getContextAttributes): 42 (WebCore::WebGLRenderingContextBase::readPixels): 43 (WebCore::WebGLRenderingContextBase::loseContextImpl): 44 (WebCore::WebGLRenderingContextBase::getBoundFramebufferWidth): 45 (WebCore::WebGLRenderingContextBase::getBoundFramebufferHeight): 46 (WebCore::WebGLRenderingContextBase::maybeRestoreContext): 47 * html/canvas/WebGLRenderingContextBase.h: 48 (WebCore::ScopedDrawingBufferBinder::ScopedDrawingBufferBinder): Deleted. 49 (WebCore::ScopedDrawingBufferBinder::~ScopedDrawingBufferBinder): Deleted. 50 * platform/graphics/GraphicsContext.h: 51 * platform/graphics/GraphicsContext3D.h: 52 * platform/graphics/cairo/DrawingBufferCairo.cpp: Removed. 53 * platform/graphics/gpu/DrawingBuffer.cpp: Removed. 54 * platform/graphics/gpu/DrawingBuffer.h: Removed. 55 * platform/graphics/gpu/mac/DrawingBufferMac.mm: Removed. 56 * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: 57 (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): 58 (WebCore::GraphicsContext3D::paintRenderingResultsToImageData): 59 1 60 2015-03-12 Ryosuke Niwa <rniwa@webkit.org> 2 61 -
trunk/Source/WebCore/PlatformEfl.cmake
r181385 r181468 114 114 platform/graphics/cairo/BitmapImageCairo.cpp 115 115 platform/graphics/cairo/CairoUtilities.cpp 116 platform/graphics/cairo/DrawingBufferCairo.cpp117 116 platform/graphics/cairo/FontCairo.cpp 118 117 platform/graphics/cairo/FontCairoHarfbuzzNG.cpp -
trunk/Source/WebCore/PlatformGTK.cmake
r181385 r181468 72 72 platform/graphics/cairo/BitmapImageCairo.cpp 73 73 platform/graphics/cairo/CairoUtilities.cpp 74 platform/graphics/cairo/DrawingBufferCairo.cpp75 74 platform/graphics/cairo/FloatRectCairo.cpp 76 75 platform/graphics/cairo/FontCairo.cpp -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r181408 r181468 7433 7433 </ClCompile> 7434 7434 <ClCompile Include="..\platform\graphics\egl\GLContextEGL.cpp" /> 7435 <ClCompile Include="..\platform\graphics\gpu\DrawingBuffer.cpp" />7436 7435 <ClCompile Include="..\platform\graphics\gpu\Texture.cpp" /> 7437 7436 <ClCompile Include="..\platform\graphics\gpu\TilingData.cpp" /> … … 19450 19449 </ClInclude> 19451 19450 <ClInclude Include="..\platform\graphics\egl\GLContextEGL.h" /> 19452 <ClInclude Include="..\platform\graphics\gpu\DrawingBuffer.h" />19453 19451 <ClInclude Include="..\platform\graphics\gpu\Texture.h" /> 19454 19452 <ClInclude Include="..\platform\graphics\gpu\TilingData.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r181408 r181468 6512 6512 <Filter>platform\graphics</Filter> 6513 6513 </ClCompile> 6514 <ClCompile Include="..\platform\graphics\gpu\DrawingBuffer.cpp">6515 <Filter>platform\graphics\gpu</Filter>6516 </ClCompile>6517 6514 <ClCompile Include="..\platform\graphics\gpu\Texture.cpp"> 6518 6515 <Filter>platform\graphics\gpu</Filter> … … 13889 13886 <ClInclude Include="..\platform\graphics\OpenGLShims.h"> 13890 13887 <Filter>platform\graphics</Filter> 13891 </ClInclude>13892 <ClInclude Include="..\platform\graphics\gpu\DrawingBuffer.h">13893 <Filter>platform\graphics\gpu</Filter>13894 13888 </ClInclude> 13895 13889 <ClInclude Include="..\platform\graphics\gpu\Texture.h"> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r181423 r181468 1666 1666 498391580F1E776900C23782 /* WebKitCSSMatrix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498391550F1E776900C23782 /* WebKitCSSMatrix.cpp */; }; 1667 1667 498391590F1E776900C23782 /* WebKitCSSMatrix.h in Headers */ = {isa = PBXBuildFile; fileRef = 498391560F1E776900C23782 /* WebKitCSSMatrix.h */; }; 1668 498770DB1242C535002226BA /* DrawingBuffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770C21242C535002226BA /* DrawingBuffer.cpp */; };1669 498770DC1242C535002226BA /* DrawingBuffer.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770C31242C535002226BA /* DrawingBuffer.h */; };1670 1668 498770F01242C535002226BA /* Texture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770D71242C535002226BA /* Texture.cpp */; }; 1671 1669 498770F11242C535002226BA /* Texture.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770D81242C535002226BA /* Texture.h */; }; 1672 1670 498770F21242C535002226BA /* TilingData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 498770D91242C535002226BA /* TilingData.cpp */; }; 1673 1671 498770F31242C535002226BA /* TilingData.h in Headers */ = {isa = PBXBuildFile; fileRef = 498770DA1242C535002226BA /* TilingData.h */; }; 1674 498771531243F9FA002226BA /* DrawingBufferMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 498771521243F9FA002226BA /* DrawingBufferMac.mm */; };1675 1672 4998AEC613F9D0EA0090B1AA /* RequestAnimationFrameCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 4998AEC413F9D0EA0090B1AA /* RequestAnimationFrameCallback.h */; }; 1676 1673 4998AECD13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4998AECB13F9D6C90090B1AA /* JSRequestAnimationFrameCallback.cpp */; }; … … 8799 8796 498391560F1E776900C23782 /* WebKitCSSMatrix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSMatrix.h; sourceTree = "<group>"; }; 8800 8797 498391570F1E776900C23782 /* WebKitCSSMatrix.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebKitCSSMatrix.idl; sourceTree = "<group>"; }; 8801 498770C21242C535002226BA /* DrawingBuffer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawingBuffer.cpp; path = gpu/DrawingBuffer.cpp; sourceTree = "<group>"; };8802 498770C31242C535002226BA /* DrawingBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawingBuffer.h; path = gpu/DrawingBuffer.h; sourceTree = "<group>"; };8803 8798 498770D71242C535002226BA /* Texture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Texture.cpp; path = gpu/Texture.cpp; sourceTree = "<group>"; }; 8804 8799 498770D81242C535002226BA /* Texture.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Texture.h; path = gpu/Texture.h; sourceTree = "<group>"; }; 8805 8800 498770D91242C535002226BA /* TilingData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TilingData.cpp; path = gpu/TilingData.cpp; sourceTree = "<group>"; }; 8806 8801 498770DA1242C535002226BA /* TilingData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TilingData.h; path = gpu/TilingData.h; sourceTree = "<group>"; }; 8807 498771521243F9FA002226BA /* DrawingBufferMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DrawingBufferMac.mm; path = gpu/mac/DrawingBufferMac.mm; sourceTree = "<group>"; };8808 8802 4998AEC413F9D0EA0090B1AA /* RequestAnimationFrameCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RequestAnimationFrameCallback.h; sourceTree = "<group>"; }; 8809 8803 4998AEC513F9D0EA0090B1AA /* RequestAnimationFrameCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = RequestAnimationFrameCallback.idl; sourceTree = "<group>"; }; … … 16073 16067 children = ( 16074 16068 498771161242CD7F002226BA /* mac */, 16075 498770C21242C535002226BA /* DrawingBuffer.cpp */,16076 498770C31242C535002226BA /* DrawingBuffer.h */,16077 16069 498770D71242C535002226BA /* Texture.cpp */, 16078 16070 498770D81242C535002226BA /* Texture.h */, … … 16081 16073 ); 16082 16074 name = gpu; 16083 sourceTree = "<group>";16084 };16085 498771161242CD7F002226BA /* mac */ = {16086 isa = PBXGroup;16087 children = (16088 498771521243F9FA002226BA /* DrawingBufferMac.mm */,16089 );16090 name = mac;16091 16075 sourceTree = "<group>"; 16092 16076 }; … … 24445 24429 A7CFB3D20B7ED10A0070C32D /* DragImage.h in Headers */, 24446 24430 81F65FF613788FAA00FF6F2D /* DragState.h in Headers */, 24447 498770DC1242C535002226BA /* DrawingBuffer.h in Headers */,24448 24431 E1BA66F11742BD8600C20251 /* DynamicLinkerInterposing.h in Headers */, 24449 24432 CE1252451A16C22500864480 /* DynamicLinkerSPI.h in Headers */, … … 27959 27942 0FDA7C23188330A900C954B5 /* DragImageIOS.mm in Sources */, 27960 27943 A7CFB3D50B7ED1180070C32D /* DragImageMac.mm in Sources */, 27961 498770DB1242C535002226BA /* DrawingBuffer.cpp in Sources */,27962 498771531243F9FA002226BA /* DrawingBufferMac.mm in Sources */,27963 27944 FD6ED2C7136B8E66003CF072 /* DynamicsCompressor.cpp in Sources */, 27964 27945 FD537356137B653B00008DCE /* DynamicsCompressorKernel.cpp in Sources */, -
trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp
r180285 r181468 1093 1093 } 1094 1094 clearIfComposited(); 1095 if (isResourceSafe()) { 1096 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 1095 if (isResourceSafe()) 1097 1096 m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); 1098 } else { 1099 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 1097 else { 1100 1098 GC3Dint clippedX, clippedY; 1101 1099 GC3Dsizei clippedWidth, clippedHeight; -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r180285 r181468 442 442 } 443 443 clearIfComposited(); 444 if (isResourceSafe()) { 445 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 444 if (isResourceSafe()) 446 445 m_context->copyTexImage2D(target, level, internalformat, x, y, width, height, border); 447 } else { 448 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 446 else { 449 447 GC3Dint clippedX, clippedY; 450 448 GC3Dsizei clippedWidth, clippedHeight; -
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp
r180839 r181468 430 430 , ActiveDOMObject(&passedCanvas->document()) 431 431 , m_context(0) 432 , m_drawingBuffer(0)433 432 , m_dispatchContextLostEventTimer(*this, &WebGLRenderingContextBase::dispatchContextLostEvent) 434 433 , m_restoreAllowed(false) … … 449 448 , ActiveDOMObject(&passedCanvas->document()) 450 449 , m_context(context) 451 , m_drawingBuffer(0)452 450 , m_dispatchContextLostEventTimer(*this, &WebGLRenderingContextBase::dispatchContextLostEvent) 453 451 , m_restoreAllowed(false) … … 470 468 m_maxViewportDims[0] = m_maxViewportDims[1] = 0; 471 469 m_context->getIntegerv(GraphicsContext3D::MAX_VIEWPORT_DIMS, m_maxViewportDims); 472 473 if (m_drawingBuffer)474 m_drawingBuffer->bind();475 470 476 471 setupFlags(); … … 548 543 549 544 IntSize canvasSize = clampedCanvasSize(); 550 if (m_drawingBuffer)551 m_drawingBuffer->reset(canvasSize);552 553 545 m_context->reshape(canvasSize.width(), canvasSize.height()); 554 546 m_context->viewport(0, 0, canvasSize.width(), canvasSize.height()); … … 624 616 return; 625 617 626 // The drawing buffer holds a context reference. It must also be destroyed627 // in order for the context to be released.628 if (m_drawingBuffer)629 m_drawingBuffer.clear();630 631 618 if (m_context) { 632 619 m_context->setContextLostCallback(nullptr); … … 642 629 643 630 m_context->markContextChanged(); 644 645 if (m_drawingBuffer)646 m_drawingBuffer->markContentsChanged();647 631 648 632 m_layerCleared = false; … … 698 682 m_context->stencilMaskSeparate(GraphicsContext3D::FRONT, 0xFFFFFFFF); 699 683 } 700 if (m_drawingBuffer) 701 m_drawingBuffer->clearFramebuffers(clearMask); 702 else { 703 if (m_framebufferBinding) 704 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0); 705 m_context->clear(clearMask); 706 } 684 if (m_framebufferBinding) 685 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0); 686 m_context->clear(clearMask); 707 687 708 688 restoreStateAfterClear(); … … 760 740 m_markedCanvasDirty = false; 761 741 762 if (m_drawingBuffer) 763 m_drawingBuffer->commit(); 764 m_context->paintRenderingResultsToCanvas(canvas()->buffer(), m_drawingBuffer.get()); 765 766 if (m_drawingBuffer) { 767 if (m_framebufferBinding) 768 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); 769 else 770 m_drawingBuffer->bind(); 771 } 742 m_context->paintRenderingResultsToCanvas(canvas()->buffer()); 772 743 } 773 744 … … 777 748 return nullptr; 778 749 clearIfComposited(); 779 if (m_drawingBuffer) 780 m_drawingBuffer->commit(); 781 RefPtr<ImageData> imageData = m_context->paintRenderingResultsToImageData(m_drawingBuffer.get()); 782 783 if (m_drawingBuffer) { 784 if (m_framebufferBinding) 785 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, objectOrZero(m_framebufferBinding.get())); 786 else 787 m_drawingBuffer->bind(); 788 } 789 790 return imageData; 750 return m_context->paintRenderingResultsToImageData(); 791 751 } 792 752 … … 816 776 // We don't have to mark the canvas as dirty, since the newly created image buffer will also start off 817 777 // clear (and this matches what reshape will do). 818 if (m_drawingBuffer) { 819 m_drawingBuffer->reset(IntSize(width, height)); 820 restoreStateAfterClear(); 821 } else 822 m_context->reshape(width, height); 778 m_context->reshape(width, height); 823 779 824 780 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, objectOrZero(m_textureUnits[m_activeTextureUnit].texture2DBinding.get())); … … 830 786 int WebGLRenderingContextBase::drawingBufferWidth() const 831 787 { 832 if (m_drawingBuffer)833 return m_drawingBuffer->size().width();834 835 788 return m_context->getInternalFramebufferSize().width(); 836 789 } … … 838 791 int WebGLRenderingContextBase::drawingBufferHeight() const 839 792 { 840 if (m_drawingBuffer)841 return m_drawingBuffer->size().height();842 843 793 return m_context->getInternalFramebufferSize().height(); 844 794 } … … 877 827 m_activeTextureUnit = texture - GraphicsContext3D::TEXTURE0; 878 828 m_context->activeTexture(texture); 879 880 if (m_drawingBuffer)881 m_drawingBuffer->setActiveTextureUnit(texture);882 829 } 883 830 … … 969 916 } 970 917 m_framebufferBinding = buffer; 971 if (m_drawingBuffer) 972 m_drawingBuffer->setFramebufferBinding(objectOrZero(m_framebufferBinding.get())); 973 if (!m_framebufferBinding && m_drawingBuffer) { 974 // Instead of binding fb 0, bind the drawing buffer. 975 m_drawingBuffer->bind(); 976 } else 977 m_context->bindFramebuffer(target, objectOrZero(buffer)); 918 m_context->bindFramebuffer(target, objectOrZero(buffer)); 978 919 if (buffer) 979 920 buffer->setHasEverBeenBound(); … … 1015 956 m_textureUnits[m_activeTextureUnit].texture2DBinding = texture; 1016 957 maxLevel = m_maxTextureLevel; 1017 1018 if (m_drawingBuffer && !m_activeTextureUnit)1019 m_drawingBuffer->setTexture2DBinding(objectOrZero(texture));1020 1021 958 } else if (target == GraphicsContext3D::TEXTURE_CUBE_MAP) { 1022 959 m_textureUnits[m_activeTextureUnit].textureCubeMapBinding = texture; … … 1431 1368 } 1432 1369 clearIfComposited(); 1433 if (isResourceSafe()) { 1434 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 1370 if (isResourceSafe()) 1435 1371 m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 1436 }else {1372 else { 1437 1373 GC3Dint clippedX, clippedY; 1438 1374 GC3Dsizei clippedWidth, clippedHeight; … … 1456 1392 } 1457 1393 m_context->texSubImage2D(target, level, xoffset, yoffset, width, height, format, type, zero.get()); 1458 if (clippedWidth > 0 && clippedHeight > 0) { 1459 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 1394 if (clippedWidth > 0 && clippedHeight > 0) 1460 1395 m_context->copyTexSubImage2D(target, level, xoffset + clippedX - x, yoffset + clippedY - y, 1461 1396 clippedX, clippedY, clippedWidth, clippedHeight); 1462 } 1463 } else { 1464 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get()); 1397 } else 1465 1398 m_context->copyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); 1466 }1467 1399 } 1468 1400 } … … 1566 1498 if (framebuffer == m_framebufferBinding) { 1567 1499 m_framebufferBinding = 0; 1568 if (m_drawingBuffer) { 1569 m_drawingBuffer->setFramebufferBinding(0); 1570 // Have to call bindFramebuffer here to bind back to internal fbo. 1571 m_drawingBuffer->bind(); 1572 } else 1573 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0); 1500 m_context->bindFramebuffer(GraphicsContext3D::FRAMEBUFFER, 0); 1574 1501 } 1575 1502 } … … 1659 1586 return; 1660 1587 } 1661 if (cap == GraphicsContext3D::SCISSOR_TEST) {1588 if (cap == GraphicsContext3D::SCISSOR_TEST) 1662 1589 m_scissorEnabled = false; 1663 if (m_drawingBuffer)1664 m_drawingBuffer->setScissorEnabled(m_scissorEnabled);1665 }1666 1590 m_context->disable(cap); 1667 1591 } … … 1953 1877 return; 1954 1878 } 1955 if (cap == GraphicsContext3D::SCISSOR_TEST) {1879 if (cap == GraphicsContext3D::SCISSOR_TEST) 1956 1880 m_scissorEnabled = true; 1957 if (m_drawingBuffer)1958 m_drawingBuffer->setScissorEnabled(m_scissorEnabled);1959 }1960 1881 m_context->enable(cap); 1961 1882 } … … 2204 2125 // Also, we need to enforce requested values of "false" for depth 2205 2126 // and stencil, regardless of the properties of the underlying 2206 // GraphicsContext3D or DrawingBuffer.2127 // GraphicsContext3D. 2207 2128 RefPtr<WebGLContextAttributes> attributes = WebGLContextAttributes::create(m_context->getContextAttributes()); 2208 2129 if (!m_attributes.depth) … … 2210 2131 if (!m_attributes.stencil) 2211 2132 attributes->setStencil(false); 2212 if (m_drawingBuffer) {2213 // The DrawingBuffer obtains its parameters from GraphicsContext3D::getContextAttributes(),2214 // but it makes its own determination of whether multisampling is supported.2215 attributes->setAntialias(m_drawingBuffer->multisample());2216 }2217 2133 return attributes.release(); 2218 2134 } … … 2868 2784 2869 2785 { 2870 ScopedDrawingBufferBinder binder(m_drawingBuffer.get(), m_framebufferBinding.get());2871 2786 if (m_isRobustnessEXTSupported) 2872 2787 m_context->getExtensions()->readnPixelsEXT(x, y, width, height, format, type, pixels->byteLength(), data); … … 3828 3743 3829 3744 detachAndRemoveAllObjects(); 3830 3831 if (m_drawingBuffer) {3832 // Make absolutely sure we do not refer to an already-deleted texture or framebuffer.3833 m_drawingBuffer->setTexture2DBinding(0);3834 m_drawingBuffer->setFramebufferBinding(0);3835 }3836 3745 3837 3746 // There is no direct way to clear errors from a GL implementation and … … 4119 4028 if (m_framebufferBinding && m_framebufferBinding->object()) 4120 4029 return m_framebufferBinding->getColorBufferWidth(); 4121 return m_ drawingBuffer ? m_drawingBuffer->size().width() : m_context->getInternalFramebufferSize().width();4030 return m_context->getInternalFramebufferSize().width(); 4122 4031 } 4123 4032 … … 4126 4035 if (m_framebufferBinding && m_framebufferBinding->object()) 4127 4036 return m_framebufferBinding->getColorBufferHeight(); 4128 return m_ drawingBuffer ? m_drawingBuffer->size().height() : m_context->getInternalFramebufferSize().height();4037 return m_context->getInternalFramebufferSize().height(); 4129 4038 } 4130 4039 … … 4841 4750 synthesizeGLError(GraphicsContext3D::INVALID_OPERATION, "", "error restoring context"); 4842 4751 return; 4843 }4844 4845 // Construct a new drawing buffer with the new GraphicsContext3D.4846 if (m_drawingBuffer) {4847 m_drawingBuffer->discardResources();4848 DrawingBuffer::PreserveDrawingBuffer preserve = m_attributes.preserveDrawingBuffer ? DrawingBuffer::Preserve : DrawingBuffer::Discard;4849 DrawingBuffer::AlphaRequirement alpha = m_attributes.alpha ? DrawingBuffer::Alpha : DrawingBuffer::Opaque;4850 m_drawingBuffer = DrawingBuffer::create(context.get(), m_drawingBuffer->size(), preserve, alpha);4851 m_drawingBuffer->bind();4852 4752 } 4853 4753 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h
r180801 r181468 29 29 #include "ActiveDOMObject.h" 30 30 #include "CanvasRenderingContext.h" 31 #include "DrawingBuffer.h"32 31 #include "GraphicsContext3D.h" 33 32 #include "ImageBuffer.h" … … 87 86 typedef int ExceptionCode; 88 87 89 class ScopedDrawingBufferBinder {90 public:91 ScopedDrawingBufferBinder(DrawingBuffer* drawingBuffer, WebGLFramebuffer* framebufferBinding)92 : m_drawingBuffer(drawingBuffer)93 , m_framebufferBinding(framebufferBinding)94 {95 // Commit DrawingBuffer if needed (e.g., for multisampling)96 if (!m_framebufferBinding && m_drawingBuffer)97 m_drawingBuffer->commit();98 }99 100 ~ScopedDrawingBufferBinder()101 {102 // Restore DrawingBuffer if needed103 if (!m_framebufferBinding && m_drawingBuffer)104 m_drawingBuffer->bind();105 }106 107 private:108 DrawingBuffer* m_drawingBuffer;109 WebGLFramebuffer* m_framebufferBinding;110 };111 112 88 inline void clip1D(GC3Dint start, GC3Dsizei range, GC3Dsizei sourceRange, GC3Dint* clippedStart, GC3Dsizei* clippedRange) 113 89 { … … 456 432 RefPtr<GraphicsContext3D> m_context; 457 433 RefPtr<WebGLContextGroup> m_contextGroup; 458 459 // Optional structure for rendering to a DrawingBuffer, instead of directly460 // to the back-buffer of m_context.461 RefPtr<DrawingBuffer> m_drawingBuffer;462 434 463 435 // Dispatches a context lost event once it is determined that one is needed. -
trunk/Source/WebCore/platform/graphics/GraphicsContext.h
r180523 r181468 74 74 75 75 class AffineTransform; 76 class DrawingBuffer;77 76 class FloatRoundedRect; 78 77 class Gradient; -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r180609 r181468 85 85 86 86 namespace WebCore { 87 class DrawingBuffer;88 87 class Extensions3D; 89 88 #if USE(OPENGL_ES_2) … … 1133 1132 void forceContextLost(); 1134 1133 1135 void paintRenderingResultsToCanvas(ImageBuffer* , DrawingBuffer*);1136 PassRefPtr<ImageData> paintRenderingResultsToImageData( DrawingBuffer*);1134 void paintRenderingResultsToCanvas(ImageBuffer*); 1135 PassRefPtr<ImageData> paintRenderingResultsToImageData(); 1137 1136 bool paintCompositedResultsToCanvas(ImageBuffer*); 1138 1137 -
trunk/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp
r181323 r181468 146 146 } 147 147 148 void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer , DrawingBuffer*)148 void GraphicsContext3D::paintRenderingResultsToCanvas(ImageBuffer* imageBuffer) 149 149 { 150 150 int rowBytes = m_currentWidth * 4; … … 185 185 } 186 186 187 PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData( DrawingBuffer*)187 PassRefPtr<ImageData> GraphicsContext3D::paintRenderingResultsToImageData() 188 188 { 189 189 // Reading premultiplied alpha would involve unpremultiplying, which is
Note:
See TracChangeset
for help on using the changeset viewer.