Changeset 65001 in webkit
- Timestamp:
- Aug 9, 2010 1:54:14 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r64998 r65001 1 2010-08-09 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 [chromium] Add a PrepareTextureCallback to the chromium canvas layer compositor to upload mixed-mode results before compositing 6 https://bugs.webkit.org/show_bug.cgi?id=43656 7 8 When compositing an accelerated canvas that is using both hardware and software drawing, 9 we need a callback before compositing the layer to make sure that we upload any software 10 drawn results to the texture. This will go away as soon as implement all draw calls 11 in hardware. 12 13 To test, run any canvas demo that runs in mixed mode and verifies that the software results 14 always show up. 15 16 * platform/graphics/chromium/CanvasLayerChromium.cpp: 17 (WebCore::CanvasLayerChromium::updateTextureContents): 18 * platform/graphics/chromium/CanvasLayerChromium.h: 19 (WebCore::CanvasLayerChromium::setPrepareTextureCallback): 20 * platform/graphics/skia/PlatformContextSkia.cpp: 21 (WebCore::PrepareTextureCallbackImpl::create): 22 (WebCore::PrepareTextureCallbackImpl::willPrepareTexture): 23 (WebCore::PrepareTextureCallbackImpl::PrepareTextureCallbackImpl): 24 (WebCore::PlatformContextSkia::setGraphicsContext3D): 25 1 26 2010-08-09 Zhenyao Mo <zmo@google.com> 2 27 -
trunk/WebCore/platform/graphics/chromium/CanvasLayerChromium.cpp
r64994 r65001 76 76 // Update the contents of the texture used by the compositor. 77 77 if (m_contentsDirty) { 78 if (m_prepareTextureCallback) 79 m_prepareTextureCallback->willPrepareTexture(); 78 80 m_context->prepareTexture(); 79 81 m_contentsDirty = false; -
trunk/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
r64994 r65001 55 55 static void setShaderProgramId(unsigned shaderProgramId) { m_shaderProgramId = shaderProgramId; } 56 56 57 class PrepareTextureCallback : public Noncopyable { 58 public: 59 virtual void willPrepareTexture() = 0; 60 }; 61 void setPrepareTextureCallback(PassOwnPtr<PrepareTextureCallback> callback) { m_prepareTextureCallback = callback; } 62 57 63 private: 58 64 explicit CanvasLayerChromium(GraphicsLayerChromium* owner); … … 60 66 unsigned m_textureId; 61 67 bool m_textureChanged; 68 OwnPtr<PrepareTextureCallback> m_prepareTextureCallback; 62 69 63 70 static unsigned m_shaderProgramId; -
trunk/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
r64994 r65001 34 34 35 35 #include "AffineTransform.h" 36 #include "CanvasLayerChromium.h" 36 37 #include "GraphicsContext.h" 37 38 #include "ImageBuffer.h" … … 221 222 PlatformContextSkia::~PlatformContextSkia() 222 223 { 224 #if USE(GLES2_RENDERING) 225 if (m_gpuCanvas) { 226 CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(m_gpuCanvas->context()->platformLayer()); 227 layer->setPrepareTextureCallback(0); 228 } 229 #endif 223 230 } 224 231 … … 679 686 #if USE(GLES2_RENDERING) 680 687 688 class PrepareTextureCallbackImpl : public CanvasLayerChromium::PrepareTextureCallback { 689 public: 690 static PassOwnPtr<PrepareTextureCallbackImpl> create(PlatformContextSkia* pcs) 691 { 692 return new PrepareTextureCallbackImpl(pcs); 693 } 694 695 virtual void willPrepareTexture() 696 { 697 m_pcs->prepareForHardwareDraw(); 698 } 699 private: 700 explicit PrepareTextureCallbackImpl(PlatformContextSkia* pcs) : m_pcs(pcs) {} 701 PlatformContextSkia* m_pcs; 702 }; 703 681 704 void PlatformContextSkia::setGraphicsContext3D(GraphicsContext3D* context, const WebCore::IntSize& size) 682 705 { 683 706 m_useGPU = true; 684 707 m_gpuCanvas = new GLES2Canvas(context, size); 708 CanvasLayerChromium* layer = static_cast<CanvasLayerChromium*>(context->platformLayer()); 709 layer->setPrepareTextureCallback(PrepareTextureCallbackImpl::create(this)); 685 710 } 686 711
Note: See TracChangeset
for help on using the changeset viewer.