Changeset 87987 in webkit


Ignore:
Timestamp:
Jun 2, 2011 7:10:44 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-06-02 John Bates <jbates@google.com>

Reviewed by James Robinson.

DrawingBufferChromium cleanup:

  • platform/graphics/chromium/DrawingBufferChromium.cpp: (WebCore::DrawingBuffer::DrawingBuffer): (WebCore::DrawingBuffer::~DrawingBuffer): (WebCore::DrawingBuffer::publishToPlatformLayer): (WebCore::DrawingBuffer::didReset): (WebCore::DrawingBuffer::platformLayer):
  • platform/graphics/gpu/DrawingBuffer.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87981 r87987  
     12011-06-02  John Bates  <jbates@google.com>
     2
     3        Reviewed by James Robinson.
     4
     5        DrawingBufferChromium cleanup:
     6        - Correct FIXME comment about synchronization.
     7        - Remove unnecessary DrawingBufferInternal indirection struct
     8          and its unused offscreenColorTexture member.
     9        https://bugs.webkit.org/show_bug.cgi?id=61953
     10
     11        * platform/graphics/chromium/DrawingBufferChromium.cpp:
     12        (WebCore::DrawingBuffer::DrawingBuffer):
     13        (WebCore::DrawingBuffer::~DrawingBuffer):
     14        (WebCore::DrawingBuffer::publishToPlatformLayer):
     15        (WebCore::DrawingBuffer::didReset):
     16        (WebCore::DrawingBuffer::platformLayer):
     17        * platform/graphics/gpu/DrawingBuffer.h:
     18
    1192011-06-02  Andrey Kosyakov  <caseq@chromium.org>
    220
  • trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp

    r87718 r87987  
    4747namespace WebCore {
    4848
    49 struct DrawingBufferInternal {
    50     unsigned offscreenColorTexture;
    51 #if USE(ACCELERATED_COMPOSITING)
    52     RefPtr<Canvas2DLayerChromium> platformLayer;
    53 #endif
    54 };
    55 
    5649static unsigned generateColorTexture(GraphicsContext3D* context, const IntSize& size)
    5750{
     
    8780    , m_multisampleFBO(0)
    8881    , m_multisampleColorBuffer(0)
    89     , m_internal(adoptPtr(new DrawingBufferInternal))
    9082#if USE(SKIA)
    9183    , m_grContext(0)
     
    109101{
    110102#if USE(ACCELERATED_COMPOSITING)
    111     if (m_internal->platformLayer)
    112         m_internal->platformLayer->setDrawingBuffer(0);
     103    if (m_platformLayer)
     104        m_platformLayer->setDrawingBuffer(0);
    113105#endif
    114106
     
    129121    if (multisample())
    130122        commit();
    131     unsigned parentTexture = m_internal->platformLayer->textureId();
    132     // FIXME: We do the copy in the canvas' (child) context so that it executes in the correct order relative to
    133     // other commands in the child context.  This ensures that the parent texture always contains a complete
    134     // frame and not some intermediate result.  However, there is no synchronization to ensure that this copy
    135     // happens before the compositor draws.  This means we might draw stale frames sometimes.  Ideally this
    136     // would insert a fence into the child command stream that the compositor could wait for.
     123    unsigned parentTexture = m_platformLayer->textureId();
     124    // We do the copy in the canvas' (child) context so that it executes in the correct order relative to
     125    // other commands in the child context. This ensures that the parent texture always contains a complete
     126    // frame and not some intermediate result. LayerRendererChromium uses glSetLatch to make sure the child
     127    // context completes before the parent context consumes the texture.
    137128    m_context->makeContextCurrent();
    138129#if USE(SKIA)
     
    148139{
    149140#if USE(ACCELERATED_COMPOSITING)
    150     if (m_internal->platformLayer)
    151         m_internal->platformLayer->setTextureChanged();
     141    if (m_platformLayer)
     142        m_platformLayer->setTextureChanged();
    152143#endif
    153144}
     
    156147PlatformLayer* DrawingBuffer::platformLayer()
    157148{
    158     if (!m_internal->platformLayer)
    159         m_internal->platformLayer = Canvas2DLayerChromium::create(this, 0);
    160     return m_internal->platformLayer.get();
     149    if (!m_platformLayer)
     150        m_platformLayer = Canvas2DLayerChromium::create(this, 0);
     151    return m_platformLayer.get();
    161152}
    162153#endif
  • trunk/Source/WebCore/platform/graphics/gpu/DrawingBuffer.h

    r85017 r87987  
    5050namespace WebCore {
    5151
    52 #if PLATFORM(CHROMIUM)
    53 struct DrawingBufferInternal;
     52#if PLATFORM(CHROMIUM) && USE(ACCELERATED_COMPOSITING)
     53class Canvas2DLayerChromium;
    5454#endif
    5555
     
    139139#if PLATFORM(CHROMIUM)
    140140    OwnPtr<WillPublishCallback> m_callback;
    141     OwnPtr<DrawingBufferInternal> m_internal;
     141#if USE(ACCELERATED_COMPOSITING)
     142    RefPtr<Canvas2DLayerChromium> m_platformLayer;
     143#endif
    142144#endif
    143145
Note: See TracChangeset for help on using the changeset viewer.