Changeset 87365 in webkit
- Timestamp:
- May 26, 2011 12:01:06 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87363 r87365 1 2011-05-26 Alok Priyadarshi <alokp@chromium.org> 2 3 Reviewed by James Robinson. 4 5 [chromium] Cannot create stencil render-buffer for accelerated drawing on desktop GL 6 https://bugs.webkit.org/show_bug.cgi?id=61444 7 8 Used DEPTH24_STENCIL8 format for stencil buffer instead of STENCIL_INDEX8. 9 Packed depth-stencil buffer is the most common format supported by graphics cards. 10 It is not very robust to rely on just one format being supported, 11 so long term the task of creating FBO should be delegated to SKIA, 12 which has necessary code to iterate through all possible formats. 13 14 * platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp: 15 (WebCore::LayerTextureUpdaterSkPicture::deleteFrameBuffer): 16 (WebCore::LayerTextureUpdaterSkPicture::createFrameBuffer): 17 1 18 2011-05-25 Jer Noble <jer.noble@apple.com> 2 19 -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.cpp
r87167 r87365 31 31 #include "LayerTextureUpdaterCanvas.h" 32 32 33 #include "Extensions3D.h" 33 34 #include "GraphicsContext.h" 34 35 #include "LayerPainterChromium.h" … … 96 97 , m_createFrameBuffer(false) 97 98 , m_fbo(0) 98 , m_ stencilBuffer(0)99 , m_depthStencilBuffer(0) 99 100 { 100 101 } … … 160 161 m_canvas.clear(); 161 162 162 if (m_stencilBuffer) 163 context()->deleteRenderbuffer(m_stencilBuffer); 164 if (m_fbo) 163 if (m_depthStencilBuffer) { 164 context()->deleteRenderbuffer(m_depthStencilBuffer); 165 m_depthStencilBuffer = 0; 166 } 167 if (m_fbo) { 165 168 context()->deleteFramebuffer(m_fbo); 169 m_fbo = 0; 170 } 166 171 } 167 172 … … 177 182 return false; 178 183 184 // SKIA only needs color and stencil buffers, not depth buffer. 185 // But it is very uncommon for cards to support color + stencil FBO config. 186 // The most common config is color + packed-depth-stencil. 187 // Instead of iterating through all possible FBO configs, we only try the 188 // most common one here. 189 // FIXME: Delegate the task of creating frame-buffer to SKIA. 190 // It has all necessary code to iterate through all possible configs 191 // and choose the one most suitable for its purposes. 192 Extensions3D* extensions = context()->getExtensions(); 193 if (!extensions->supports("GL_OES_packed_depth_stencil")) 194 return false; 195 extensions->ensureEnabled("GL_OES_packed_depth_stencil"); 196 179 197 // Create and bind a frame-buffer-object. 180 198 m_fbo = context()->createFramebuffer(); … … 186 204 // The color buffer (texture) will be provided by tiles. 187 205 // SKIA does not need depth buffer. 188 m_ stencilBuffer = context()->createRenderbuffer();189 if (!m_ stencilBuffer) {190 context()->deleteFramebuffer(m_fbo);191 m_fbo = 0;192 return false;193 }194 context()-> bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);195 context()-> renderbufferStorage(GraphicsContext3D::RENDERBUFFER, GraphicsContext3D::STENCIL_INDEX8, m_bufferSize.width(), m_bufferSize.height());196 context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D:: STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_stencilBuffer);206 m_depthStencilBuffer = context()->createRenderbuffer(); 207 if (!m_depthStencilBuffer) { 208 deleteFrameBuffer(); 209 return false; 210 } 211 context()->bindRenderbuffer(GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer); 212 context()->renderbufferStorage(GraphicsContext3D::RENDERBUFFER, Extensions3D::DEPTH24_STENCIL8, m_bufferSize.width(), m_bufferSize.height()); 213 context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::STENCIL_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer); 214 context()->framebufferRenderbuffer(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::DEPTH_ATTACHMENT, GraphicsContext3D::RENDERBUFFER, m_depthStencilBuffer); 197 215 198 216 // Create a skia gpu canvas. -
trunk/Source/WebCore/platform/graphics/chromium/LayerTextureUpdaterCanvas.h
r87167 r87365 100 100 IntSize m_bufferSize; // Frame buffer size. 101 101 Platform3DObject m_fbo; // Frame buffer id. 102 Platform3DObject m_ stencilBuffer;102 Platform3DObject m_depthStencilBuffer; 103 103 OwnPtr<SkCanvas> m_canvas; // GPU accelerated canvas. 104 104 };
Note: See TracChangeset
for help on using the changeset viewer.