Changeset 65921 in webkit
- Timestamp:
- Aug 24, 2010 12:17:19 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r65919 r65921 1 2010-08-24 Stephen White <senorblanco@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Fix accelerated 2d canvas with accelerated compositing off. 6 https://bugs.webkit.org/show_bug.cgi?id=44525 7 8 Tested by running with --enable-accelerated-2d-canvas with 9 --enable-accelerated-compositing off. 10 ImageBuffer::copyImage changes covered by 11 LayoutTests/fast/canvas/canvas-pattern-*.html. 12 13 * html/HTMLCanvasElement.cpp: 14 (WebCore::HTMLCanvasElement::paint): 15 Extend the accelerated compositing check and the readback for 16 non-accelerated compositing to accelerated 2D canvas also. 17 * html/canvas/CanvasRenderingContext.cpp: 18 * html/canvas/CanvasRenderingContext.h: 19 (WebCore::CanvasRenderingContext::paintsIntoCanvasBuffer): 20 Move this logic from WebGL to common canvas context code. 21 * html/canvas/WebGLRenderingContext.h: 22 Remove implementation of paintsIntoCanvasBuffer. 23 * platform/graphics/skia/ImageBufferSkia.cpp: 24 (WebCore::ImageBuffer::copyImage): 25 When copying the image for patterns, sync the software canvas. 26 * platform/graphics/skia/PlatformContextSkia.cpp: 27 (WebCore::PlatformContextSkia::prepareForSoftwareDraw): 28 Use SkDevice::eraseColor() to clear the canvas for mixed mode rendering. 29 1 30 2010-08-24 Adam Barth <abarth@webkit.org> 2 31 -
trunk/WebCore/html/HTMLCanvasElement.cpp
r65916 r65921 273 273 return; 274 274 275 #if ENABLE(3D_CANVAS) 276 WebGLRenderingContext* context3D = 0; 277 if (m_context && m_context->is3d()) { 278 context3D = static_cast<WebGLRenderingContext*>(m_context.get()); 279 if (!context3D->paintsIntoCanvasBuffer()) 275 if (m_context) { 276 if (!m_context->paintsIntoCanvasBuffer()) 280 277 return; 281 context3D->paintRenderingResultsToCanvas(); 282 } 283 #endif 278 m_context->paintRenderingResultsToCanvas(); 279 } 284 280 285 281 if (hasCreatedImageBuffer()) { -
trunk/WebCore/html/canvas/CanvasRenderingContext.cpp
r47645 r65921 26 26 #include "config.h" 27 27 #include "CanvasRenderingContext.h" 28 28 #if ENABLE(ACCELERATED_2D_CANVAS) || ENABLE(3D_CANVAS) 29 #include "GraphicsContext3D.h" 30 #endif 29 31 #include "HTMLCanvasElement.h" 30 32 … … 46 48 } 47 49 50 bool CanvasRenderingContext::paintsIntoCanvasBuffer() const 51 { 52 #if ENABLE(ACCELERATED_2D_CANVAS) || ENABLE(3D_CANVAS) 53 if (GraphicsContext3D* context3D = graphicsContext3D()) 54 return context3D->paintsIntoCanvasBuffer(); 55 #endif 56 return true; 57 } 58 48 59 } // namespace WebCore -
trunk/WebCore/html/canvas/CanvasRenderingContext.h
r64881 r65921 55 55 56 56 virtual void paintRenderingResultsToCanvas() {} 57 bool paintsIntoCanvasBuffer() const; 57 58 58 59 private: -
trunk/WebCore/html/canvas/WebGLRenderingContext.h
r65759 r65921 286 286 void removeObject(WebGLObject*); 287 287 288 bool paintsIntoCanvasBuffer() const { return m_context->paintsIntoCanvasBuffer(); }289 290 288 private: 291 289 friend class WebGLObject; -
trunk/WebCore/platform/graphics/skia/ImageBufferSkia.cpp
r65617 r65921 95 95 PassRefPtr<Image> ImageBuffer::copyImage() const 96 96 { 97 m_context->platformContext()->syncSoftwareCanvas(); 97 98 return BitmapImageSingleFrameSkia::create(*m_data.m_platformContext.bitmap(), true); 98 99 } -
trunk/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
r65700 r65921 734 734 if (m_state->m_xferMode == SkXfermode::kSrcOver_Mode) { 735 735 // Last drawn on hardware; clear out the canvas. 736 m_canvas->save(); 737 SkRect bounds = {0, 0, m_canvas->getDevice()->width(), m_canvas->getDevice()->height()}; 738 m_canvas->clipRect(bounds, SkRegion::kReplace_Op); 739 m_canvas->drawARGB(0, 0, 0, 0, SkXfermode::kClear_Mode); 740 m_canvas->restore(); 736 m_canvas->getDevice()->eraseColor(0); 741 737 // Start compositing into the empty canvas. 742 738 m_backingStoreState = Mixed;
Note: See TracChangeset
for help on using the changeset viewer.