Changeset 83355 in webkit
- Timestamp:
- Apr 8, 2011 4:01:29 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r83353 r83355 1 2011-04-08 Jeff Timanus <twiz@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Fall back to software rendering for Canvas2D when requesting a DrawingBuffer larger than supported by the GL environment. 6 https://bugs.webkit.org/show_bug.cgi?id=57768 7 8 * platform/chromium/test_expectations.txt: 9 1 10 2011-04-08 Daniel Cheng <dcheng@chromium.org> 2 11 -
trunk/LayoutTests/platform/chromium/test_expectations.txt
r83336 r83355 2915 2915 BUGNONE SLOW GPU DEBUG WIN : fast/canvas/canvas-getImageData.html = PASS 2916 2916 2917 // Started failing after r75648 on everything except Snow Leopard2918 BUGWK52341 GPU : fast/canvas/canvas-large-dimensions.html = TEXT2919 2920 2917 BUGWK53469 GPU MAC : compositing/scroll-painted-composited-content.html = CRASH 2921 2918 -
trunk/Source/WebCore/ChangeLog
r83353 r83355 1 2011-04-08 Jeff Timanus <twiz@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Fall back to software rendering for Canvas2D when requesting a DrawingBuffer larger than supported by the GL environment. 6 https://bugs.webkit.org/show_bug.cgi?id=57768 7 8 * html/canvas/CanvasRenderingContext2D.cpp: 9 (WebCore::CanvasRenderingContext2D::CanvasRenderingContext2D): 10 (WebCore::CanvasRenderingContext2D::reset): 11 * platform/graphics/gpu/DrawingBuffer.cpp: 12 (WebCore::DrawingBuffer::reset): 13 * platform/graphics/gpu/DrawingBuffer.h: 14 1 15 2011-04-08 Daniel Cheng <dcheng@chromium.org> 2 16 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r82860 r83355 134 134 if (m_context3D) { 135 135 m_drawingBuffer = m_context3D->graphicsContext3D()->createDrawingBuffer(IntSize(canvas->width(), canvas->height())); 136 c->setSharedGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas->width(), canvas->height())); 136 if (!m_drawingBuffer) { 137 c->setSharedGraphicsContext3D(0, 0, IntSize()); 138 m_context3D.clear(); 139 } else 140 c->setSharedGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas->width(), canvas->height())); 137 141 } 138 142 } … … 174 178 if (GraphicsContext* c = drawingContext()) { 175 179 if (m_context3D && m_drawingBuffer) { 176 m_drawingBuffer->reset(IntSize(canvas()->width(), canvas()->height()));177 c->setSharedGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas()->width(), canvas()->height()));180 if (m_drawingBuffer->reset(IntSize(canvas()->width(), canvas()->height()))) { 181 c->setSharedGraphicsContext3D(m_context3D.get(), m_drawingBuffer.get(), IntSize(canvas()->width(), canvas()->height())); 178 182 #if USE(ACCELERATED_COMPOSITING) 179 RenderBox* renderBox = canvas()->renderBox(); 180 if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing()) 181 renderBox->layer()->contentChanged(RenderLayer::CanvasChanged); 182 #endif 183 RenderBox* renderBox = canvas()->renderBox(); 184 if (renderBox && renderBox->hasLayer() && renderBox->layer()->hasAcceleratedCompositing()) 185 renderBox->layer()->contentChanged(RenderLayer::CanvasChanged); 186 #endif 187 } else { 188 c->setSharedGraphicsContext3D(0, 0, IntSize()); 189 m_drawingBuffer.clear(); 190 m_context3D.clear(); 191 } 183 192 } 184 193 } -
trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.cpp
r76717 r83355 145 145 } 146 146 147 void DrawingBuffer::reset(const IntSize& newSize) 148 { 147 bool DrawingBuffer::reset(const IntSize& newSize) 148 { 149 if (!m_context) 150 return false; 151 152 m_context->makeContextCurrent(); 153 154 int maxTextureSize = 0; 155 m_context->getIntegerv(GraphicsContext3D::MAX_TEXTURE_SIZE, &maxTextureSize); 156 if (newSize.height() > maxTextureSize || newSize.width() > maxTextureSize) { 157 clear(); 158 return false; 159 } 160 149 161 m_size = newSize; 150 162 151 if (!m_context)152 return;153 154 m_context->makeContextCurrent();155 156 163 const GraphicsContext3D::Attributes& attributes = m_context->getContextAttributes(); 157 164 unsigned long internalColorFormat, colorFormat, internalRenderbufferFormat; … … 183 190 // Cleanup 184 191 clear(); 185 return ;192 return false; 186 193 } 187 194 } … … 191 198 192 199 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, m_colorBuffer); 200 193 201 m_context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, internalColorFormat, m_size.width(), m_size.height(), 0, colorFormat, GraphicsContext3D::UNSIGNED_BYTE); 202 194 203 m_context->framebufferTexture2D(GraphicsContext3D::FRAMEBUFFER, GraphicsContext3D::COLOR_ATTACHMENT0, GraphicsContext3D::TEXTURE_2D, m_colorBuffer, 0); 195 204 m_context->bindTexture(GraphicsContext3D::TEXTURE_2D, 0); 205 196 206 if (!multisample()) 197 207 resizeDepthStencil(0); … … 199 209 // Cleanup 200 210 clear(); 201 return ;211 return false; 202 212 } 203 213 … … 251 261 252 262 didReset(); 263 264 return true; 253 265 } 254 266 -
trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.h
r81915 r83355 61 61 ~DrawingBuffer(); 62 62 63 void reset(const IntSize&); 63 // Returns true if the buffer was successfully resized. 64 bool reset(const IntSize&); 64 65 void bind(); 65 66 IntSize size() const { return m_size; }
Note: See TracChangeset
for help on using the changeset viewer.