Changeset 76717 in webkit
- Timestamp:
- Jan 26, 2011 2:06:45 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r76713 r76717 1 2011-01-26 Kenneth Russell <kbr@google.com> 2 3 Reviewed by James Robinson. 4 5 Fix multisampling support in DrawingBuffer 6 https://bugs.webkit.org/show_bug.cgi?id=53154 7 8 In DrawingBuffer's multisampling code path, fixed enum usage and a 9 bug where it would incorrectly redefine the depth and stencil 10 buffers. Hooked up multisampling code path in Chromium port. 11 12 Tested manually with some accelerated 2D canvas content. 13 Multisampling isn't being switched on for the accelerated 2D 14 canvas at the current time because it will increase fill rate 15 requirements and cause a large number of rebaselines. 16 17 * platform/graphics/Extensions3D.h: 18 * platform/graphics/chromium/DrawingBufferChromium.cpp: 19 (WebCore::DrawingBuffer::publishToPlatformLayer): 20 * platform/graphics/chromium/Extensions3DChromium.h: 21 * platform/graphics/gpu/DrawingBuffer.cpp: 22 (WebCore::DrawingBuffer::create): 23 (WebCore::DrawingBuffer::reset): 24 * platform/graphics/opengl/Extensions3DOpenGL.cpp: 25 (WebCore::Extensions3DOpenGL::supports): 26 1 27 2011-01-26 Tony Chang <tony@chromium.org> 2 28 -
trunk/Source/WebCore/platform/graphics/Extensions3D.h
r76324 r76717 53 53 // GL_OES_texture_float 54 54 // GL_OES_standard_derivatives 55 // GL_OES_rgb8_rgba8 55 56 56 57 // Takes full name of extension; for example, … … 88 89 // GL_OES_standard_derivatives names 89 90 FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B, 91 92 // GL_OES_rgb8_rgba8 names 93 RGB8_OES = 0x8051, 94 RGBA8_OES = 0x8058, 90 95 }; 91 96 -
trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp
r76658 r76717 120 120 if (m_callback) 121 121 m_callback->willPublish(); 122 if (multisample()) 123 commit(); 122 124 unsigned parentTexture = m_internal->platformLayer->textureId(); 123 125 // FIXME: We do the copy in the canvas' (child) context so that it executes in the correct order relative to -
trunk/Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
r73806 r76717 45 45 virtual void ensureEnabled(const String&); 46 46 virtual int getGraphicsResetStatusARB(); 47 virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter) { }48 virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) { }47 virtual void blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter); 48 virtual void renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height); 49 49 50 50 enum { -
trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp
r76658 r76717 42 42 { 43 43 Extensions3D* extensions = context->getExtensions(); 44 bool multisampleSupported = extensions->supports("GL_ANGLE_framebuffer_blit") && extensions->supports("GL_ANGLE_framebuffer_multisample") ;44 bool multisampleSupported = extensions->supports("GL_ANGLE_framebuffer_blit") && extensions->supports("GL_ANGLE_framebuffer_multisample") && extensions->supports("GL_OES_rgb8_rgba8"); 45 45 if (multisampleSupported) { 46 46 extensions->ensureEnabled("GL_ANGLE_framebuffer_blit"); 47 47 extensions->ensureEnabled("GL_ANGLE_framebuffer_multisample"); 48 extensions->ensureEnabled("GL_OES_rgb8_rgba8"); 48 49 } 49 50 bool packedDepthStencilSupported = extensions->supports("GL_OES_packed_depth_stencil"); … … 154 155 155 156 const GraphicsContext3D::Attributes& attributes = m_context->getContextAttributes(); 156 unsigned long internalColorFormat, colorFormat ;157 unsigned long internalColorFormat, colorFormat, internalRenderbufferFormat; 157 158 if (attributes.alpha) { 158 159 internalColorFormat = GraphicsContext3D::RGBA; 159 160 colorFormat = GraphicsContext3D::RGBA; 161 internalRenderbufferFormat = Extensions3D::RGBA8_OES; 160 162 } else { 161 163 internalColorFormat = GraphicsContext3D::RGB; 162 164 colorFormat = GraphicsContext3D::RGB; 165 internalRenderbufferFormat = Extensions3D::RGB8_OES; 163 166 } 164 167 … … 174 177 175 178 m_context->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer); 176 m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, internal ColorFormat, m_size.width(), m_size.height());179 m_context->getExtensions()->renderbufferStorageMultisample(GraphicsContext3D::RENDERBUFFER, sampleCount, internalRenderbufferFormat, m_size.width(), m_size.height()); 177 180 m_context->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::RENDERBUFFER, m_multisampleColorBuffer); 178 181 resizeDepthStencil(sampleCount); … … 191 194 m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0); 192 195 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0); 193 resizeDepthStencil(0); 196 if (!multisample()) 197 resizeDepthStencil(0); 194 198 if (m_context->checkFramebufferStatus(GraphicsContext3D::FRAMEBUFFER) != GraphicsContext3D::FRAMEBUFFER_COMPLETE) { 195 199 // Cleanup -
trunk/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp
r76600 r76717 80 80 return m_availableExtensions.contains("GL_EXT_framebuffer_multisample"); 81 81 82 // Desktop GL always supports GL_OES_rgb8_rgba8. 83 if (name == "GL_OES_rgb8_rgba8") 84 return true; 85 82 86 // If GL_ARB_texture_float is available then we report GL_OES_texture_float and 83 87 // GL_OES_texture_half_float as available. -
trunk/Source/WebKit/chromium/ChangeLog
r76713 r76717 1 2011-01-26 Kenneth Russell <kbr@google.com> 2 3 Reviewed by James Robinson. 4 5 Fix multisampling support in DrawingBuffer 6 https://bugs.webkit.org/show_bug.cgi?id=53154 7 8 Plumbed GL_ANGLE_framebuffer_multisample and 9 GL_ANGLE_framebuffer_blit (exposed as the unified extension 10 GL_CHROMIUM_framebuffer_multisample) through WebGraphicsContext3D. 11 12 * public/WebGraphicsContext3D.h: 13 * src/Extensions3DChromium.cpp: 14 (WebCore::Extensions3DChromium::blitFramebuffer): 15 (WebCore::Extensions3DChromium::renderbufferStorageMultisample): 16 * src/GraphicsContext3DChromium.cpp: 17 (WebCore::GraphicsContext3DInternal::supportsExtension): 18 (WebCore::GraphicsContext3DInternal::ensureExtensionEnabled): 19 * src/GraphicsContext3DInternal.h: 20 1 21 2011-01-26 Tony Chang <tony@chromium.org> 2 22 -
trunk/Source/WebKit/chromium/public/WebGraphicsContext3D.h
r75553 r76717 141 141 virtual void requestExtensionCHROMIUM(const char*) = 0; 142 142 143 // GL_CHROMIUM_framebuffer_multisample 144 virtual void blitFramebufferCHROMIUM(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0, int dstX1, int dstY1, unsigned mask, unsigned filter) = 0; 145 virtual void renderbufferStorageMultisampleCHROMIUM(unsigned long target, int samples, unsigned internalformat, unsigned width, unsigned height) = 0; 146 143 147 // The entry points below map directly to the OpenGL ES 2.0 API. 144 148 // See: http://www.khronos.org/registry/gles/ -
trunk/Source/WebKit/chromium/src/Extensions3DChromium.cpp
r76600 r76717 63 63 } 64 64 65 void Extensions3DChromium::blitFramebuffer(long srcX0, long srcY0, long srcX1, long srcY1, long dstX0, long dstY0, long dstX1, long dstY1, unsigned long mask, unsigned long filter) 66 { 67 m_internal->blitFramebufferCHROMIUM(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); 68 } 69 70 void Extensions3DChromium::renderbufferStorageMultisample(unsigned long target, unsigned long samples, unsigned long internalformat, unsigned long width, unsigned long height) 71 { 72 m_internal->renderbufferStorageMultisampleCHROMIUM(target, samples, internalformat, width, height); 73 } 74 65 75 void* Extensions3DChromium::mapBufferSubDataCHROMIUM(unsigned target, int offset, int size, unsigned access) 66 76 { -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r76600 r76717 365 365 } 366 366 367 #define DELEGATE_TO_IMPL_10(name, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10) \ 368 void GraphicsContext3DInternal::name(t1 a1, t2 a2, t3 a3, t4 a4, t5 a5, t6 a6, t7 a7, t8 a8, t9 a9, t10 a10) \ 369 { \ 370 m_impl->name(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10); \ 371 } 372 367 373 DELEGATE_TO_IMPL_R(makeContextCurrent, bool) 368 374 … … 692 698 } 693 699 700 String mapExtensionName(const String& name) 701 { 702 if (name == "GL_ANGLE_framebuffer_blit" 703 || name == "GL_ANGLE_framebuffer_multisample") 704 return "GL_CHROMIUM_framebuffer_multisample"; 705 return name; 706 } 707 694 708 } // anonymous namespace 695 709 … … 711 725 { 712 726 initializeExtensions(); 713 return m_enabledExtensions.contains(name) || m_requestableExtensions.contains(name); 727 String mappedName = mapExtensionName(name); 728 return m_enabledExtensions.contains(mappedName) || m_requestableExtensions.contains(mappedName); 714 729 } 715 730 … … 718 733 initializeExtensions(); 719 734 720 if (m_enabledExtensions.contains(name)) 735 String mappedName = mapExtensionName(name); 736 if (m_enabledExtensions.contains(mappedName)) 721 737 return true; 722 738 723 if (m_requestableExtensions.contains( name)) {724 m_impl->requestExtensionCHROMIUM( name.ascii().data());739 if (m_requestableExtensions.contains(mappedName)) { 740 m_impl->requestExtensionCHROMIUM(mappedName.ascii().data()); 725 741 m_enabledExtensions.clear(); 726 742 m_requestableExtensions.clear(); … … 729 745 730 746 initializeExtensions(); 731 return m_enabledExtensions.contains( name);747 return m_enabledExtensions.contains(mappedName); 732 748 } 733 749 … … 737 753 DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*) 738 754 DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, Platform3DObject, Platform3DObject) 755 DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum) 756 DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei) 739 757 740 758 //---------------------------------------------------------------------- -
trunk/Source/WebKit/chromium/src/GraphicsContext3DInternal.h
r76549 r76717 259 259 void copyTextureToParentTextureCHROMIUM(Platform3DObject texture, Platform3DObject parentTexture); 260 260 261 // GL_CHROMIUM_framebuffer_multisample 262 void blitFramebufferCHROMIUM(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter); 263 void renderbufferStorageMultisampleCHROMIUM(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height); 264 261 265 private: 262 266 OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
Note: See TracChangeset
for help on using the changeset viewer.