Changeset 126122 in webkit


Ignore:
Timestamp:
Aug 20, 2012 7:35:33 PM (12 years ago)
Author:
commit-queue@webkit.org
Message:

[chromium] Texture layer should not generate zero textureId quads
https://bugs.webkit.org/show_bug.cgi?id=94550

Patch by Alexandre Elias <aelias@google.com> on 2012-08-20
Reviewed by Adrienne Walker.

After a context loss, CCTextureLayerImpl would clear its textureId
but continued to produce external resources and quads with the zero
textureid. Add early returns so that CCTextureLayerImpl becomes
inert after a context loss.

Added assertion in read lock so that dontUseOldResourcesAfterLostContext
test catches the problem.

  • platform/graphics/chromium/cc/CCResourceProvider.h:

(WebCore::CCScopedLockResourceForRead::CCScopedLockResourceForRead):

  • platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:

(WebCore::CCTextureLayerImpl::willDraw):
(WebCore::CCTextureLayerImpl::appendQuads):
(WebCore::CCTextureLayerImpl::didDraw):
(WebCore::CCTextureLayerImpl::didLoseContext):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r126121 r126122  
     12012-08-20  Alexandre Elias  <aelias@google.com>
     2
     3        [chromium] Texture layer should not generate zero textureId quads
     4        https://bugs.webkit.org/show_bug.cgi?id=94550
     5
     6        Reviewed by Adrienne Walker.
     7
     8        After a context loss, CCTextureLayerImpl would clear its textureId
     9        but continued to produce external resources and quads with the zero
     10        textureid.  Add early returns so that CCTextureLayerImpl becomes
     11        inert after a context loss.
     12
     13        Added assertion in read lock so that dontUseOldResourcesAfterLostContext
     14        test catches the problem.
     15
     16        * platform/graphics/chromium/cc/CCResourceProvider.h:
     17        (WebCore::CCScopedLockResourceForRead::CCScopedLockResourceForRead):
     18        * platform/graphics/chromium/cc/CCTextureLayerImpl.cpp:
     19        (WebCore::CCTextureLayerImpl::willDraw):
     20        (WebCore::CCTextureLayerImpl::appendQuads):
     21        (WebCore::CCTextureLayerImpl::didDraw):
     22        (WebCore::CCTextureLayerImpl::didLoseContext):
     23
    1242012-08-20  Kent Tamura  <tkent@chromium.org>
    225
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCResourceProvider.h

    r125932 r126122  
    225225        : m_resourceProvider(resourceProvider)
    226226        , m_resourceId(resourceId)
    227         , m_textureId(resourceProvider->lockForRead(resourceId)) { }
     227        , m_textureId(resourceProvider->lockForRead(resourceId))
     228    {
     229        ASSERT(m_textureId);
     230    }
    228231
    229232    ~CCScopedLockResourceForRead()
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCTextureLayerImpl.cpp

    r125932 r126122  
    5353void CCTextureLayerImpl::willDraw(CCResourceProvider* resourceProvider)
    5454{
     55    if (!m_textureId)
     56        return;
    5557    ASSERT(!m_externalTextureResource);
    5658    m_externalTextureResource = resourceProvider->createResourceFromExternalTexture(m_textureId);
     
    5961void CCTextureLayerImpl::appendQuads(CCQuadSink& quadList, const CCSharedQuadState* sharedQuadState, bool&)
    6062{
    61     ASSERT(m_externalTextureResource);
     63    if (!m_externalTextureResource)
     64        return;
    6265    IntRect quadRect(IntPoint(), contentBounds());
    6366    quadList.append(CCTextureDrawQuad::create(sharedQuadState, quadRect, m_externalTextureResource, m_premultipliedAlpha, m_uvRect, m_flipped));
     
    6669void CCTextureLayerImpl::didDraw(CCResourceProvider* resourceProvider)
    6770{
    68     ASSERT(m_externalTextureResource);
     71    if (!m_externalTextureResource)
     72        return;
    6973    // FIXME: the following assert will not be true when sending resources to a
    7074    // parent compositor. A synchronization scheme (double-buffering or
     
    8589{
    8690    m_textureId = 0;
     91    m_externalTextureResource = 0;
    8792}
    8893
Note: See TracChangeset for help on using the changeset viewer.