Changeset 95100 in webkit


Ignore:
Timestamp:
Sep 14, 2011 11:02:27 AM (13 years ago)
Author:
jamesr@google.com
Message:

[chromium] Move contents texture manager from LayerRendererChromium to CCLayerTreeHost
https://bugs.webkit.org/show_bug.cgi?id=67440

Reviewed by Kenneth Russell.

This moves the contents TextureManager over to the CCLayerTreeHost, where it belongs, and adds in a commit path
to make sure that textures are deleted even if the page is not visible. This move also removed the need for
LayerRendererChromium's CCLayerTreeHost pointer, so I removed that as well. That meant moving the
layerTreeAsText() logic over to the CCLayerImpl side, which is where it really belonged anyway.

Covered by existing compositing/ tests and
platform/chromium/compositor/lost-compositor-context-with-rendersurface.html

  • platform/graphics/chromium/LayerRendererChromium.cpp:

(WebCore::LayerRendererChromium::releaseRenderSurfaceTextures):
(WebCore::LayerRendererChromium::drawLayers):
(WebCore::LayerRendererChromium::initializeSharedObjects):
(WebCore::LayerRendererChromium::cleanupSharedObjects):

  • platform/graphics/chromium/LayerRendererChromium.h:

(WebCore::LayerRendererChromium::setContentsTextureMemoryUseBytes):

  • platform/graphics/chromium/TextureManager.cpp:

(WebCore::TextureManager::highLimitBytes):
(WebCore::TextureManager::reclaimLimitBytes):
(WebCore::TextureManager::lowLimitBytes):

  • platform/graphics/chromium/TextureManager.h:
  • platform/graphics/chromium/cc/CCLayerTreeHost.cpp:

(WebCore::CCLayerTreeHost::initialize):
(WebCore::CCLayerTreeHost::~CCLayerTreeHost):
(WebCore::CCLayerTreeHost::deleteContentsTextures):
(WebCore::CCLayerTreeHost::commitTo):
(WebCore::CCLayerTreeHost::setVisible):
(WebCore::CCLayerTreeHost::contentsTextureManager):

  • platform/graphics/chromium/cc/CCLayerTreeHost.h:
  • platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:

(WebCore::CCLayerTreeHostImpl::setVisible):

  • platform/graphics/chromium/cc/CCProxy.h:
  • platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:

(WebCore::CCSingleThreadProxy::setNeedsCommit):
(WebCore::CCSingleThreadProxy::stop):

  • platform/graphics/chromium/cc/CCSingleThreadProxy.h:
  • platform/graphics/chromium/cc/CCThreadProxy.cpp:

(WebCore::CCThreadProxy::setNeedsCommit):
(WebCore::CCThreadProxy::setNeedsCommitOnCCThread):
(WebCore::CCThreadProxy::layerTreeHostClosedOnCCThread):

  • platform/graphics/chromium/cc/CCThreadProxy.h:
Location:
trunk
Files:
3 added
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r95099 r95100  
     12011-09-14  James Robinson  <jamesr@chromium.org>
     2
     3        [chromium] Move contents texture manager from LayerRendererChromium to CCLayerTreeHost
     4        https://bugs.webkit.org/show_bug.cgi?id=67440
     5
     6        Reviewed by Kenneth Russell.
     7
     8        This moves the contents TextureManager over to the CCLayerTreeHost, where it belongs, and adds in a commit path
     9        to make sure that textures are deleted even if the page is not visible.  This move also removed the need for
     10        LayerRendererChromium's CCLayerTreeHost pointer, so I removed that as well.  That meant moving the
     11        layerTreeAsText() logic over to the CCLayerImpl side, which is where it really belonged anyway.
     12
     13        Covered by existing compositing/ tests and
     14        platform/chromium/compositor/lost-compositor-context-with-rendersurface.html
     15
     16        * platform/graphics/chromium/LayerRendererChromium.cpp:
     17        (WebCore::LayerRendererChromium::releaseRenderSurfaceTextures):
     18        (WebCore::LayerRendererChromium::drawLayers):
     19        (WebCore::LayerRendererChromium::initializeSharedObjects):
     20        (WebCore::LayerRendererChromium::cleanupSharedObjects):
     21        * platform/graphics/chromium/LayerRendererChromium.h:
     22        (WebCore::LayerRendererChromium::setContentsTextureMemoryUseBytes):
     23        * platform/graphics/chromium/TextureManager.cpp:
     24        (WebCore::TextureManager::highLimitBytes):
     25        (WebCore::TextureManager::reclaimLimitBytes):
     26        (WebCore::TextureManager::lowLimitBytes):
     27        * platform/graphics/chromium/TextureManager.h:
     28        * platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
     29        (WebCore::CCLayerTreeHost::initialize):
     30        (WebCore::CCLayerTreeHost::~CCLayerTreeHost):
     31        (WebCore::CCLayerTreeHost::deleteContentsTextures):
     32        (WebCore::CCLayerTreeHost::commitTo):
     33        (WebCore::CCLayerTreeHost::setVisible):
     34        (WebCore::CCLayerTreeHost::contentsTextureManager):
     35        * platform/graphics/chromium/cc/CCLayerTreeHost.h:
     36        * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
     37        (WebCore::CCLayerTreeHostImpl::setVisible):
     38        * platform/graphics/chromium/cc/CCProxy.h:
     39        * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
     40        (WebCore::CCSingleThreadProxy::setNeedsCommit):
     41        (WebCore::CCSingleThreadProxy::stop):
     42        * platform/graphics/chromium/cc/CCSingleThreadProxy.h:
     43        * platform/graphics/chromium/cc/CCThreadProxy.cpp:
     44        (WebCore::CCThreadProxy::setNeedsCommit):
     45        (WebCore::CCThreadProxy::setNeedsCommitOnCCThread):
     46        (WebCore::CCThreadProxy::layerTreeHostClosedOnCCThread):
     47        * platform/graphics/chromium/cc/CCThreadProxy.h:
     48
    1492011-09-14  David Hyatt  <hyatt@apple.com>
    250
  • trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h

    r95014 r95100  
    5353    explicit CanvasLayerChromium(GraphicsLayerChromium* owner);
    5454
    55     virtual const char* layerTypeAsString() const { return "CanvasLayer"; }
    56 
    5755    bool m_hasAlpha;
    5856    bool m_premultipliedAlpha;
  • trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h

    r95014 r95100  
    5555    explicit ContentLayerChromium(GraphicsLayerChromium* owner);
    5656
    57     virtual const char* layerTypeAsString() const { return "ContentLayer"; }
    58 
    5957    virtual void cleanupResources();
    6058    virtual bool drawsContent() const;
  • trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h

    r95014 r95100  
    5858    void setContents(Image* image);
    5959
    60 protected:
    61     virtual const char* layerTypeAsString() const { return "ImageLayer"; }
    62 
    6360private:
    6461    ImageLayerChromium(GraphicsLayerChromium* owner);
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp

    r95014 r95100  
    377377}
    378378
    379 String LayerChromium::layerTreeAsText() const
    380 {
    381     TextStream ts;
    382     dumpLayer(ts, 0);
    383     return ts.release();
    384 }
    385 
    386 static void writeIndent(TextStream& ts, int indent)
    387 {
    388     for (int i = 0; i != indent; ++i)
    389         ts << "  ";
    390 }
    391 
    392 void LayerChromium::dumpLayer(TextStream& ts, int indent) const
    393 {
    394     writeIndent(ts, indent);
    395     ts << layerTypeAsString() << "(" << m_name << ")\n";
    396     dumpLayerProperties(ts, indent+2);
    397     if (m_replicaLayer) {
    398         writeIndent(ts, indent+2);
    399         ts << "Replica:\n";
    400         m_replicaLayer->dumpLayer(ts, indent+3);
    401     }
    402     if (m_maskLayer) {
    403         writeIndent(ts, indent+2);
    404         ts << "Mask:\n";
    405         m_maskLayer->dumpLayer(ts, indent+3);
    406     }
    407     for (size_t i = 0; i < m_children.size(); ++i)
    408         m_children[i]->dumpLayer(ts, indent+1);
    409 }
    410 
    411 void LayerChromium::dumpLayerProperties(TextStream& ts, int indent) const
    412 {
    413     writeIndent(ts, indent);
    414     ts << "id: " << id() << " drawsContent: " << drawsContent() << " bounds " << m_bounds.width() << "x" << m_bounds.height() << " usesLayerScissor: " << usesLayerScissor()
    415         << " scissorRect: (" << m_scissorRect.x() << ", " << m_scissorRect.y() << ", " << m_scissorRect.width() << ", " << m_scissorRect.height() << ")"
    416         << " visibleLayerRect: (" << m_visibleLayerRect.x() << ", " << m_visibleLayerRect.y() << ", " << m_visibleLayerRect.width() << ", " << m_visibleLayerRect.height() << ")"
    417         << "\n";
    418 
    419 }
    420 
    421379PassRefPtr<CCLayerImpl> LayerChromium::createCCLayerImpl()
    422380{
  • trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h

    r95014 r95100  
    173173
    174174    void drawDebugBorder();
    175     String layerTreeAsText() const;
    176175
    177176    void setBorderWidth(float);
     
    220219
    221220    static void toGLMatrix(float*, const TransformationMatrix&);
    222 
    223     void dumpLayer(TextStream&, int indent) const;
    224 
    225     virtual const char* layerTypeAsString() const { return "LayerChromium"; }
    226     virtual void dumpLayerProperties(TextStream&, int indent) const;
    227221
    228222    FloatRect m_dirtyRect;
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp

    r95014 r95100  
    7171namespace WebCore {
    7272
    73 // FIXME: Make this limit adjustable and give it a useful value.
    74 
    75 // Absolute maximum limit for texture allocations for this instance.
    76 static size_t textureMemoryHighLimitBytes = 128 * 1024 * 1024;
    77 // Preferred texture size limit. Can be exceeded if needed.
    78 static size_t textureMemoryReclaimLimitBytes = 64 * 1024 * 1024;
    79 // The maximum texture memory usage when asked to release textures.
    80 static size_t textureMemoryLowLimitBytes = 3 * 1024 * 1024;
    81 
    82 size_t LayerRendererChromium::textureMemoryReclaimLimit()
    83 {
    84     return textureMemoryReclaimLimitBytes;
    85 }
    86 
    8773namespace {
    8874
     
    144130} // anonymous namespace
    145131
    146 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHost* owner, CCLayerTreeHostImpl* ownerImpl, PassRefPtr<GraphicsContext3D> context)
     132PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHostImpl* owner, PassRefPtr<GraphicsContext3D> context)
    147133{
    148134#if USE(SKIA)
     
    150136        return 0;
    151137#endif
    152     RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(owner, ownerImpl, context)));
     138    RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(owner, context)));
    153139    if (!layerRenderer->initialize())
    154140        return 0;
     
    157143}
    158144
    159 LayerRendererChromium::LayerRendererChromium(CCLayerTreeHost* owner,
    160                                              CCLayerTreeHostImpl* ownerImpl,
     145LayerRendererChromium::LayerRendererChromium(CCLayerTreeHostImpl* owner,
    161146                                             PassRefPtr<GraphicsContext3D> context)
    162147    : m_owner(owner)
    163     , m_ownerImpl(ownerImpl)
    164148    , m_currentRenderSurface(0)
    165149    , m_offscreenFramebufferId(0)
     
    211195void LayerRendererChromium::close()
    212196{
    213     if (rootLayerImpl())
    214         clearRenderSurfacesOnCCLayerImplRecursive(rootLayerImpl());
     197    if (rootLayer())
     198        clearRenderSurfacesOnCCLayerImplRecursive(rootLayer());
    215199}
    216200
     
    227211}
    228212
    229 void LayerRendererChromium::releaseTextures()
    230 {
    231     // Reduces texture memory usage to textureMemoryLowLimitBytes by deleting non root layer
    232     // textures.
    233     m_owner->nonCompositedContentHost()->protectVisibleTileTextures();
    234     m_contentsTextureManager->reduceMemoryToLimit(textureMemoryLowLimitBytes);
    235     m_contentsTextureManager->unprotectAllTextures();
    236     m_contentsTextureManager->deleteEvictedTextures(m_context.get());
    237     // Evict all RenderSurface textures.
    238     m_renderSurfaceTextureManager->unprotectAllTextures();
    239     m_renderSurfaceTextureManager->reduceMemoryToLimit(0);
    240     m_renderSurfaceTextureManager->deleteEvictedTextures(m_context.get());
     213void LayerRendererChromium::releaseRenderSurfaceTextures()
     214{
     215    m_renderSurfaceTextureManager->evictAndDeleteAllTextures(m_context.get());
    241216}
    242217
     
    258233    m_headsUpDisplay->onFrameBegin(currentTime());
    259234
    260     if (!rootLayerImpl())
     235    if (!rootLayer())
    261236        return;
    262237    // FIXME: No need to walk the tree here. This could be passed via draw.
    263     rootLayerImpl()->setLayerRendererRecursive(this);
    264 
    265     m_renderSurfaceTextureManager->setMemoryLimitBytes(textureMemoryHighLimitBytes - m_contentsTextureManager->currentMemoryUseBytes());
     238    rootLayer()->setLayerRendererRecursive(this);
     239
     240    m_renderSurfaceTextureManager->setMemoryLimitBytes(TextureManager::highLimitBytes() - m_contentsTextureMemoryUseBytes);
    266241    drawLayersInternal();
    267242
    268     m_contentsTextureManager->unprotectAllTextures();
    269 
    270     if (textureMemoryReclaimLimitBytes > m_contentsTextureManager->currentMemoryUseBytes())
    271         m_renderSurfaceTextureManager->reduceMemoryToLimit(textureMemoryReclaimLimitBytes - m_contentsTextureManager->currentMemoryUseBytes());
     243    if (TextureManager::reclaimLimitBytes() > m_contentsTextureMemoryUseBytes)
     244        m_renderSurfaceTextureManager->reduceMemoryToLimit(TextureManager::reclaimLimitBytes() - m_contentsTextureMemoryUseBytes);
    272245    else
    273246        m_renderSurfaceTextureManager->reduceMemoryToLimit(0);
     
    284257
    285258    TRACE_EVENT("LayerRendererChromium::drawLayers", this, 0);
    286     CCLayerImpl* rootDrawLayer = rootLayerImpl();
     259    CCLayerImpl* rootDrawLayer = rootLayer();
    287260    makeContextCurrent();
    288261
     
    448421ManagedTexture* LayerRendererChromium::getOffscreenLayerTexture()
    449422{
    450     return settings().compositeOffscreen && rootLayerImpl() ? rootLayerImpl()->renderSurface()->contentsTexture() : 0;
     423    return settings().compositeOffscreen && rootLayer() ? rootLayer()->renderSurface()->contentsTexture() : 0;
    451424}
    452425
     
    604577    GLC(m_context.get(), m_context->flush());
    605578
    606     m_contentsTextureManager = TextureManager::create(textureMemoryHighLimitBytes, m_capabilities.maxTextureSize);
    607     m_renderSurfaceTextureManager = TextureManager::create(textureMemoryHighLimitBytes, m_capabilities.maxTextureSize);
    608 #ifndef NDEBUG
    609     m_contentsTextureManager->setAssociatedContextDebugOnly(m_context.get());
    610     m_renderSurfaceTextureManager->setAssociatedContextDebugOnly(m_context.get());
    611 #endif
     579    m_renderSurfaceTextureManager = TextureManager::create(TextureManager::highLimitBytes(), m_capabilities.maxTextureSize);
    612580    return true;
    613581}
     
    818786        GLC(m_context.get(), m_context->deleteFramebuffer(m_offscreenFramebufferId));
    819787
    820     // Clear tilers before the texture manager, as they have references to textures.
    821     m_contentsTextureManager->unprotectAllTextures();
    822     m_contentsTextureManager->reduceMemoryToLimit(0);
    823     m_contentsTextureManager->deleteEvictedTextures(m_context.get());
    824     m_contentsTextureManager.clear();
    825     m_renderSurfaceTextureManager->unprotectAllTextures();
    826     m_renderSurfaceTextureManager->reduceMemoryToLimit(0);
    827     m_renderSurfaceTextureManager->deleteEvictedTextures(m_context.get());
    828     m_renderSurfaceTextureManager.clear();
     788    ASSERT(!m_contentsTextureMemoryUseBytes);
     789    releaseRenderSurfaceTextures();
    829790}
    830791
     
    833794    TextStream ts;
    834795    if (rootLayer()) {
    835         ts << rootLayer()->platformLayer()->layerTreeAsText();
     796        ts << rootLayer()->layerTreeAsText();
    836797        ts << "RenderSurfaces:\n";
    837         dumpRenderSurfaces(ts, 1, rootLayer()->platformLayer());
     798        dumpRenderSurfaces(ts, 1, rootLayer());
    838799    }
    839800    return ts.release();
    840801}
    841802
    842 void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const LayerChromium* layer) const
     803void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const CCLayerImpl* layer) const
    843804{
    844805    if (layer->renderSurface())
  • trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h

    r95014 r95100  
    7575class LayerRendererChromium : public RefCounted<LayerRendererChromium> {
    7676public:
    77     static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHost*, CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>);
     77    static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>);
    7878
    7979    // Must be called in order to allow the LayerRendererChromium to destruct
     
    8585    const LayerRendererCapabilities& capabilities() const { return m_capabilities; }
    8686
    87     CCLayerTreeHost* owner() { return m_owner; }
    88     const CCLayerTreeHost* owner() const { return m_owner; }
    89 
    90     GraphicsLayer* rootLayer() { return m_owner->rootLayer(); }
    91     const GraphicsLayer* rootLayer() const { return m_owner->rootLayer(); }
    92 
    93     CCLayerImpl* rootLayerImpl() { return m_ownerImpl->rootLayer(); }
    94     const CCLayerImpl* rootLayerImpl() const { return m_ownerImpl->rootLayer(); }
     87    CCLayerImpl* rootLayer() { return m_owner->rootLayer(); }
     88    const CCLayerImpl* rootLayer() const { return m_owner->rootLayer(); }
    9589
    9690    GraphicsContext3D* context();
    9791    bool contextSupportsMapSub() const { return m_capabilities.usingMapSub; }
    9892
    99     const IntSize& viewportSize() { return m_ownerImpl->viewportSize(); }
     93    const IntSize& viewportSize() { return m_owner->viewportSize(); }
    10094    int viewportWidth() { return viewportSize().width(); }
    10195    int viewportHeight() { return viewportSize().height(); }
     
    140134    void getFramebufferPixels(void *pixels, const IntRect& rect);
    141135
    142     TextureManager* contentsTextureManager() const { return m_contentsTextureManager.get(); }
    143136    TextureManager* renderSurfaceTextureManager() const { return m_renderSurfaceTextureManager.get(); }
    144137
     
    151144    bool isContextLost();
    152145
    153     void releaseTextures();
     146    void releaseRenderSurfaceTextures();
    154147
    155148    GC3Denum bestTextureFormat();
     
    157150    typedef Vector<RefPtr<CCLayerImpl> > CCLayerList;
    158151
    159     // FIXME: Remove this when the contents texture manager has moved to CCLayerTreeHost.
    160     static size_t textureMemoryReclaimLimit();
     152    void setContentsTextureMemoryUseBytes(size_t contentsTextureMemoryUseBytes) { m_contentsTextureMemoryUseBytes = contentsTextureMemoryUseBytes; }
    161153
    162154private:
    163     LayerRendererChromium(CCLayerTreeHost*, CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>);
     155    LayerRendererChromium(CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>);
    164156    bool initialize();
    165157
     
    180172    static bool compareLayerZ(const RefPtr<CCLayerImpl>&, const RefPtr<CCLayerImpl>&);
    181173
    182     void dumpRenderSurfaces(TextStream&, int indent, const LayerChromium*) const;
     174    void dumpRenderSurfaces(TextStream&, int indent, const CCLayerImpl*) const;
    183175
    184176    bool initializeSharedObjects();
     
    187179    void clearRenderSurfacesOnCCLayerImplRecursive(CCLayerImpl*);
    188180
    189     // FIXME: Remove CCLayerTreeHost field
    190     CCLayerTreeHost* m_owner;
    191 
    192     CCLayerTreeHostImpl* m_ownerImpl;
     181    CCLayerTreeHostImpl* m_owner;
    193182
    194183    LayerRendererCapabilities m_capabilities;
     
    221210    OwnPtr<CCVideoLayerImpl::YUVProgram> m_videoLayerYUVProgram;
    222211
    223     OwnPtr<TextureManager> m_contentsTextureManager;
     212    size_t m_contentsTextureMemoryUseBytes;
    224213    OwnPtr<TextureManager> m_renderSurfaceTextureManager;
    225214
  • trunk/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp

    r95014 r95100  
    8484{
    8585    ASSERT(m_textureManager->hasTexture(m_token));
    86     ASSERT(context == m_textureManager->associatedContextDebugOnly());
    8786    if (!m_textureId)
    8887        m_textureId = m_textureManager->allocateTexture(context, m_token);
     
    9392{
    9493    ASSERT(m_textureManager->hasTexture(m_token));
    95     ASSERT(context == m_textureManager->associatedContextDebugOnly());
    9694    if (!m_textureId)
    9795        m_textureId = m_textureManager->allocateTexture(context, m_token);
  • trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h

    r95014 r95100  
    4747    virtual void pushPropertiesTo(CCLayerImpl*);
    4848
    49 protected:
    50     virtual const char* layerTypeAsString() const { return "PluginLayer"; }
    51 
    5249private:
    5350    explicit PluginLayerChromium(GraphicsLayerChromium* owner);
  • trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp

    r95014 r95100  
    6060}
    6161
    62 String RenderSurfaceChromium::name() const
    63 {
    64     return String::format("RenderSurface(id=%d,owner=%s)", m_owningLayer->id(), m_owningLayer->name().utf8().data());
    65 }
    66 
    67 static void writeIndent(TextStream& ts, int indent)
    68 {
    69     for (int i = 0; i != indent; ++i)
    70         ts << "  ";
    71 }
    72 
    73 void RenderSurfaceChromium::dumpSurface(TextStream& ts, int indent) const
    74 {
    75     writeIndent(ts, indent);
    76     ts << name() << "\n";
    77 
    78     writeIndent(ts, indent+1);
    79     ts << "contentRect: (" << m_contentRect.x() << ", " << m_contentRect.y() << ", " << m_contentRect.width() << ", " << m_contentRect.height()
    80         << " scissorRect: (" << m_scissorRect.x() << ", " << m_scissorRect.y() << ", " << m_scissorRect.width() << ", " << m_scissorRect.height() << ")"
    81         << "\n";
    82 }
    83 
    8462}
    8563#endif // USE(ACCELERATED_COMPOSITING)
  • trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h

    r95014 r95100  
    5555    void draw(const IntRect& targetSurfaceRect);
    5656
    57     String name() const;
    58     void dumpSurface(TextStream&, int indent) const;
    59 
    6057    // Returns the rect that encloses the RenderSurface including any reflection.
    6158    FloatRect drawableContentRect() const;
  • trunk/Source/WebCore/platform/graphics/chromium/TextureManager.cpp

    r95014 r95100  
    4545}
    4646
     47size_t TextureManager::highLimitBytes()
     48{
     49    return 128 * 1024 * 1024;
     50}
     51
     52size_t TextureManager::reclaimLimitBytes()
     53{
     54    return 64 * 1024 * 1024;
     55}
     56
     57size_t TextureManager::lowLimitBytes()
     58{
     59    return 3 * 1024 * 1024;
     60}
     61
    4762TextureManager::TextureManager(size_t memoryLimitBytes, int maxTextureSize)
    4863    : m_memoryLimitBytes(memoryLimitBytes)
     
    140155void TextureManager::deleteEvictedTextures(GraphicsContext3D* context)
    141156{
    142     ASSERT(context == m_associatedContextDebugOnly);
    143     for (size_t i = 0; i < m_evictedTextureIds.size(); ++i) {
    144         if (m_evictedTextureIds[i])
    145             GLC(context, context->deleteTexture(m_evictedTextureIds[i]));
    146     }
    147     m_evictedTextureIds.clear();
     157    if (context) {
     158        for (size_t i = 0; i < m_evictedTextures.size(); ++i) {
     159            if (m_evictedTextures[i].textureId) {
     160#ifndef NDEBUG
     161                ASSERT(m_evictedTextures[i].allocatingContext == context);
     162#endif
     163                GLC(context, context->deleteTexture(m_evictedTextures[i].textureId));
     164            }
     165        }
     166    }
     167    m_evictedTextures.clear();
     168}
     169
     170void TextureManager::evictAndDeleteAllTextures(GraphicsContext3D* context)
     171{
     172    unprotectAllTextures();
     173    reduceMemoryToLimit(0);
     174    deleteEvictedTextures(context);
    148175}
    149176
     
    156183    ASSERT(m_textureLRUSet.contains(token));
    157184    m_textureLRUSet.remove(token);
    158     m_evictedTextureIds.append(info.textureId);
     185    EvictionEntry entry;
     186    entry.textureId = info.textureId;
     187#ifndef NDEBUG
     188    entry.allocatingContext = info.allocatingContext;
     189#endif
     190    m_evictedTextures.append(entry);
    159191}
    160192
    161193unsigned TextureManager::allocateTexture(GraphicsContext3D* context, TextureToken token)
    162194{
    163     ASSERT(context == m_associatedContextDebugOnly);
    164195    TextureMap::iterator it = m_textures.find(token);
    165196    ASSERT(it != m_textures.end());
     
    178209    GLC(context, context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, info->format, info->size.width(), info->size.height(), 0, info->format, GraphicsContext3D::UNSIGNED_BYTE));
    179210    info->textureId = textureId;
     211#ifndef NDEBUG
     212    info->allocatingContext = context;
     213#endif
    180214    return textureId;
    181215}
     
    205239    info.textureId = 0;
    206240    info.isProtected = true;
     241#ifndef NDEBUG
     242    info.allocatingContext = 0;
     243#endif
    207244    addTexture(token, info);
    208245    return true;
  • trunk/Source/WebCore/platform/graphics/chromium/TextureManager.h

    r95014 r95100  
    4646    }
    4747
     48    // Absolute maximum limit for texture allocations for this instance.
     49    static size_t highLimitBytes();
     50    // Preferred texture size limit. Can be exceeded if needed.
     51    static size_t reclaimLimitBytes();
     52    // The maximum texture memory usage when asked to release textures.
     53    static size_t lowLimitBytes();
     54
    4855    void setMemoryLimitBytes(size_t);
    4956
     
    6269    void deleteEvictedTextures(GraphicsContext3D*);
    6370
     71    void evictAndDeleteAllTextures(GraphicsContext3D*);
     72
    6473    void reduceMemoryToLimit(size_t);
    6574    size_t currentMemoryUseBytes() const { return m_memoryUseBytes; }
    66 
    67 #ifndef NDEBUG
    68     void setAssociatedContextDebugOnly(GraphicsContext3D* context) { m_associatedContextDebugOnly = context; }
    69     GraphicsContext3D* associatedContextDebugOnly() const { return m_associatedContextDebugOnly; }
    70 #endif
    7175
    7276private:
     
    7882        unsigned textureId;
    7983        bool isProtected;
     84#ifndef NDEBUG
     85        GraphicsContext3D* allocatingContext;
     86#endif
    8087    };
    8188
     
    9299    TextureToken m_nextToken;
    93100
     101    struct EvictionEntry {
     102        unsigned textureId;
    94103#ifndef NDEBUG
    95     GraphicsContext3D* m_associatedContextDebugOnly;
     104        GraphicsContext3D* allocatingContext;
    96105#endif
     106    };
    97107
    98     Vector<unsigned> m_evictedTextureIds;
     108    Vector<EvictionEntry> m_evictedTextures;
    99109};
    100110
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

    r95014 r95100  
    266266}
    267267
    268 static void writeIndent(TextStream& ts, int indent)
    269 {
    270     for (int i = 0; i != indent; ++i)
    271         ts << "  ";
    272 }
    273 
    274 void TiledLayerChromium::dumpLayerProperties(TextStream& ts, int indent) const
    275 {
    276     LayerChromium::dumpLayerProperties(ts, indent);
    277     writeIndent(ts, indent);
    278     ts << "skipsDraw: " << (!m_tiler || m_skipsDraw) << "\n";
    279 }
    280 
    281268TextureManager* TiledLayerChromium::textureManager() const
    282269{
  • trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h

    r95014 r95100  
    7575    virtual PassRefPtr<CCLayerImpl> createCCLayerImpl();
    7676
    77     virtual void dumpLayerProperties(TextStream&, int indent) const;
    78 
    7977    virtual void setLayerTreeHost(CCLayerTreeHost*);
    8078
  • trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h

    r95014 r95100  
    6464protected:
    6565    virtual void cleanupResources();
    66     virtual const char* layerTypeAsString() const { return "VideoLayer"; }
    6766
    6867private:
  • trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h

    r95014 r95100  
    5858    GraphicsContext3D* context() { return m_context; }
    5959
    60 protected:
    61     virtual const char* layerTypeAsString() const { return "WebGLLayer"; }
    62 
    6360private:
    6461    explicit WebGLLayerChromium(GraphicsLayerChromium* owner);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.h

    r95014 r95100  
    5353    explicit CCCanvasLayerImpl(int);
    5454
     55    virtual const char* layerTypeAsString() const { return "CanvasLayer"; }
     56
    5557    unsigned m_textureId;
    5658    bool m_hasAlpha;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r95014 r95100  
    228228}
    229229
    230 }
     230String CCLayerImpl::layerTreeAsText() const
     231{
     232    TextStream ts;
     233    dumpLayer(ts, 0);
     234    return ts.release();
     235}
     236
     237void CCLayerImpl::dumpLayer(TextStream& ts, int indent) const
     238{
     239    writeIndent(ts, indent);
     240    ts << layerTypeAsString() << "(" << m_name << ")\n";
     241    dumpLayerProperties(ts, indent+2);
     242    if (m_replicaLayer) {
     243        writeIndent(ts, indent+2);
     244        ts << "Replica:\n";
     245        m_replicaLayer->dumpLayer(ts, indent+3);
     246    }
     247    if (m_maskLayer) {
     248        writeIndent(ts, indent+2);
     249        ts << "Mask:\n";
     250        m_maskLayer->dumpLayer(ts, indent+3);
     251    }
     252    for (size_t i = 0; i < m_children.size(); ++i)
     253        m_children[i]->dumpLayer(ts, indent+1);
     254}
     255
     256}
     257
    231258
    232259#endif // USE(ACCELERATED_COMPOSITING)
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h

    r95014 r95100  
    166166    void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = rect; }
    167167
    168     virtual void dumpLayerProperties(TextStream&, int indent) const;
     168    String layerTreeAsText() const;
    169169
    170170protected:
    171171    explicit CCLayerImpl(int);
    172172
     173    virtual void dumpLayerProperties(TextStream&, int indent) const;
    173174    static void writeIndent(TextStream&, int indent);
    174175
     
    177178    friend class TreeSynchronizer;
    178179    void clearChildList(); // Warning: This does not preserve tree structure invariants and so is only exposed to the tree synchronizer.
     180
     181    virtual const char* layerTypeAsString() const { return "LayerChromium"; }
     182
     183    void dumpLayer(TextStream&, int indent) const;
    179184
    180185    // Properties internal to CCLayerImpl
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp

    r95014 r95100  
    7070    m_proxy->start();
    7171
    72     if (!m_proxy->initializeLayerRenderer(this))
     72    if (!m_proxy->initializeLayerRenderer())
    7373        return false;
    7474
     
    8787    m_proxy->setNeedsCommitAndRedraw();
    8888
     89    m_contentsTextureManager = TextureManager::create(TextureManager::highLimitBytes(), m_proxy->layerRendererCapabilities().maxTextureSize);
    8990    return true;
    9091}
     
    9293CCLayerTreeHost::~CCLayerTreeHost()
    9394{
     95    ASSERT(CCProxy::isMainThread());
    9496    TRACE_EVENT("CCLayerTreeHost::~CCLayerTreeHost", this, 0);
    9597    m_proxy->stop();
    9698    m_proxy.clear();
     99    m_updateList.clear();
     100    ASSERT(!m_contentsTextureManager || !m_contentsTextureManager->currentMemoryUseBytes());
     101    m_contentsTextureManager.clear();
     102}
     103
     104void CCLayerTreeHost::deleteContentsTextures(GraphicsContext3D* context)
     105{
     106    ASSERT(CCProxy::isImplThread());
     107    if (m_contentsTextureManager)
     108        m_contentsTextureManager->evictAndDeleteAllTextures(context);
    97109}
    98110
     
    110122    hostImpl->setSourceFrameNumber(frameNumber());
    111123
    112     contentsTextureManager()->reduceMemoryToLimit(hostImpl->layerRenderer()->textureMemoryReclaimLimit());
     124    contentsTextureManager()->reduceMemoryToLimit(TextureManager::reclaimLimitBytes());
    113125    contentsTextureManager()->deleteEvictedTextures(hostImpl->context());
    114126
     
    119131    hostImpl->setZoomAnimatorScale(m_zoomAnimatorScale);
    120132    hostImpl->setViewport(viewportSize());
     133
     134    hostImpl->layerRenderer()->setContentsTextureMemoryUseBytes(m_contentsTextureManager->currentMemoryUseBytes());
     135    m_contentsTextureManager->unprotectAllTextures();
    121136
    122137    // Synchronize trees, if one exists at all...
     
    146161void CCLayerTreeHost::didRecreateGraphicsContext(bool success)
    147162{
     163    m_contentsTextureManager->evictAndDeleteAllTextures(0);
     164
    148165    if (rootLayer())
    149166        rootLayer()->platformLayer()->cleanupResourcesRecursive();
     
    260277{
    261278    m_visible = visible;
    262     m_proxy->setNeedsCommitAndRedraw();
     279    if (visible)
     280        m_proxy->setNeedsCommitAndRedraw();
     281    else {
     282        m_nonCompositedContentHost->protectVisibleTileTextures();
     283        m_contentsTextureManager->reduceMemoryToLimit(TextureManager::lowLimitBytes());
     284        m_contentsTextureManager->unprotectAllTextures();
     285        m_proxy->setNeedsCommit();
     286    }
    263287}
    264288
     
    270294TextureManager* CCLayerTreeHost::contentsTextureManager() const
    271295{
    272     return m_proxy->contentsTextureManager();
     296    return m_contentsTextureManager.get();
    273297}
    274298
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h

    r95014 r95100  
    158158    void updateLayers();
    159159
     160    void deleteContentsTextures(GraphicsContext3D*);
     161
    160162protected:
    161163    CCLayerTreeHost(CCLayerTreeHostClient*, const CCSettings&);
     
    185187    OwnPtr<GraphicsLayer> m_rootLayer;
    186188    OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost;
     189    OwnPtr<TextureManager> m_contentsTextureManager;
    187190
    188191    LayerList m_updateList;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp

    r95014 r95100  
    7575    TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0);
    7676    ASSERT(m_layerRenderer);
    77     if (m_layerRenderer->owner()->rootLayer())
     77    if (m_layerRenderer->rootLayer())
    7878        m_layerRenderer->drawLayers();
    7979
     
    117117{
    118118    if (m_layerRenderer && !visible)
    119         m_layerRenderer->releaseTextures();
     119        m_layerRenderer->releaseRenderSurfaceTextures();
    120120}
    121121
    122 bool CCLayerTreeHostImpl::initializeLayerRenderer(CCLayerTreeHost* implHack, PassRefPtr<GraphicsContext3D> context)
     122bool CCLayerTreeHostImpl::initializeLayerRenderer(PassRefPtr<GraphicsContext3D> context)
    123123{
    124     // If m_layerRenderer exists, then we are recovering from a lost context
    125     bool recreatingRenderer = m_layerRenderer;
    126 
    127     // First time layerRenderer creation
    128124    RefPtr<LayerRendererChromium> layerRenderer;
    129     if (!recreatingRenderer)
    130         layerRenderer = LayerRendererChromium::create(implHack, this, context);
    131     else
    132         layerRenderer = LayerRendererChromium::create(m_layerRenderer->owner(), this, context);
    133 
     125    layerRenderer = LayerRendererChromium::create(this, context);
    134126
    135127    // If creation failed, and we had asked for accelerated painting, disable accelerated painting
     
    138130        m_settings.acceleratePainting = false;
    139131
    140         if (!recreatingRenderer)
    141             layerRenderer = LayerRendererChromium::create(implHack, this, context);
    142         else
    143             layerRenderer = LayerRendererChromium::create(m_layerRenderer->owner(), this, context);
     132        layerRenderer = LayerRendererChromium::create(this, context);
     133    }
     134
     135    // If we had a previous layer renderer, then its context must have been lost along with all of its resources.
     136    // Let the old layer renderer known its resources are gone.
     137    if (m_layerRenderer) {
     138        m_layerRenderer->setContentsTextureMemoryUseBytes(0);
     139        m_layerRenderer->close();
    144140    }
    145141
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h

    r95014 r95100  
    5757    int frameNumber() const { return m_frameNumber; }
    5858
    59     bool initializeLayerRenderer(CCLayerTreeHost* ownerHack, PassRefPtr<GraphicsContext3D>);
     59    bool initializeLayerRenderer(PassRefPtr<GraphicsContext3D>);
    6060    bool isContextLost();
    6161    LayerRendererChromium* layerRenderer() { return m_layerRenderer.get(); }
     
    7878    void setZoomAnimatorScale(double);
    7979
     80    const CCSettings& settings() const { return m_settings; }
    8081protected:
    8182    explicit CCLayerTreeHostImpl(const CCSettings&);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.h

    r95014 r95100  
    5252    explicit CCPluginLayerImpl(int);
    5353
     54    virtual const char* layerTypeAsString() const { return "PluginLayer"; }
     55
    5456    unsigned m_textureId;
    5557};
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h

    r95014 r95100  
    5959    virtual bool isStarted() const = 0;
    6060
    61     virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack) = 0;
     61    virtual bool initializeLayerRenderer() = 0;
    6262
    6363    virtual const LayerRendererCapabilities& layerRendererCapabilities() const = 0;
    6464
     65    virtual void setNeedsCommit() = 0;
    6566    virtual void setNeedsCommitAndRedraw() = 0;
    6667    virtual void setNeedsRedraw() = 0;
     
    8182    virtual GraphicsContext3D* context() = 0;
    8283
    83     // Temporary hack while LayerChromiums hold references to LayerRendererChromiums
    84     virtual TextureManager* contentsTextureManager() = 0;
    85 
    8684protected:
    8785    CCProxy() { }
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp

    r95014 r95100  
    122122}
    123123
    124 bool CCSingleThreadProxy::initializeLayerRenderer(CCLayerTreeHost* ownerHack)
    125 {
     124bool CCSingleThreadProxy::initializeLayerRenderer()
     125{
     126    ASSERT(isMainThread());
    126127    RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D();
    127128    if (!context)
     
    131132    {
    132133        ScopedSetImplThread impl;
    133         return m_layerTreeHostImpl->initializeLayerRenderer(ownerHack, context);
     134        return m_layerTreeHostImpl->initializeLayerRenderer(context);
    134135    }
    135136}
     
    145146    m_graphicsContextLost = true;
    146147    m_timesRecreateShouldFail = numTimes - 1;
     148}
     149
     150void CCSingleThreadProxy::setNeedsCommit()
     151{
     152    ASSERT(isMainThread());
     153    // Commit immediately
     154    {
     155        ScopedSetImplThread impl;
     156        m_layerTreeHostImpl->beginCommit();
     157        m_layerTreeHost->commitTo(m_layerTreeHostImpl.get());
     158        m_layerTreeHostImpl->commitComplete();
     159    }
    147160}
    148161
     
    171184    {
    172185        ScopedSetImplThread impl;
     186        m_layerTreeHost->deleteContentsTextures(m_layerTreeHostImpl->context());
    173187        m_layerTreeHostImpl.clear();
    174188    }
    175189    m_layerTreeHost = 0;
    176 }
    177 
    178 TextureManager* CCSingleThreadProxy::contentsTextureManager()
    179 {
    180     return m_layerTreeHostImpl->layerRenderer()->contentsTextureManager();
    181190}
    182191
     
    198207bool CCSingleThreadProxy::recreateContextIfNeeded()
    199208{
     209    ASSERT(isMainThread());
    200210    if (!m_graphicsContextLost)
    201211        return true;
     
    208218    if (context) {
    209219        ASSERT(context->hasOneRef());
    210         if (m_layerTreeHostImpl->initializeLayerRenderer(0, context)) {
     220        if (m_layerTreeHostImpl->initializeLayerRenderer(context)) {
    211221            m_layerTreeHost->didRecreateGraphicsContext(true);
    212222            m_graphicsContextLost = false;
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h

    r95014 r95100  
    4545    virtual void finishAllRendering();
    4646    virtual bool isStarted() const;
    47     virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack);
     47    virtual bool initializeLayerRenderer();
    4848    virtual const LayerRendererCapabilities& layerRendererCapabilities() const;
    4949    virtual void loseCompositorContext(int numTimes);
     50    virtual void setNeedsCommit();
    5051    virtual void setNeedsCommitAndRedraw();
    5152    virtual void setNeedsRedraw();
    5253    virtual void start();
    5354    virtual void stop();
    54 
    55     // Temporary hack while LayerChromiums hold references to LayerRendererChromiums
    56     virtual TextureManager* contentsTextureManager();
    5755
    5856    // Special case functions.
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp

    r95014 r95100  
    9999}
    100100
    101 bool CCThreadProxy::initializeLayerRenderer(CCLayerTreeHost* ownerHack)
     101bool CCThreadProxy::initializeLayerRenderer()
    102102{
    103103    RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D();
     
    116116    LayerRendererCapabilities capabilities;
    117117    ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeLayerRendererOnCCThread,
    118                                           AllowCrossThreadAccess(ownerHack), AllowCrossThreadAccess(contextPtr),
    119                                           AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities)));
     118                                          AllowCrossThreadAccess(contextPtr), AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities)));
    120119    completion.wait();
    121120
     
    135134}
    136135
     136void CCThreadProxy::setNeedsCommit()
     137{
     138    ASSERT(isMainThread());
     139    if (m_commitPending)
     140        return;
     141
     142    TRACE_EVENT("CCThreadProxy::setNeedsCommit", this, 0);
     143    m_commitPending = true;
     144    ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::setNeedsCommitOnCCThread));
     145}
     146
    137147void CCThreadProxy::setNeedsCommitAndRedraw()
    138148{
     
    171181    ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted.
    172182    m_layerTreeHost = 0;
    173 }
    174 
    175 TextureManager* CCThreadProxy::contentsTextureManager()
    176 {
    177     ASSERT_NOT_REACHED();
    178     return 0;
    179183}
    180184
     
    230234}
    231235
     236void CCThreadProxy::setNeedsCommitOnCCThread()
     237{
     238    TRACE_EVENT("CCThreadProxy::setNeedsCommitOnCCThread", this, 0);
     239    ASSERT(isImplThread());
     240    ASSERT(m_layerTreeHostImpl);
     241    // FIXME: Not yet implemented, see https://bugs.webkit.org/show_bug.cgi?id=67417
     242    ASSERT_NOT_REACHED();
     243}
     244
    232245void CCThreadProxy::setNeedsCommitAndRedrawOnCCThread()
    233246{
     
    252265}
    253266
    254 void CCThreadProxy::initializeLayerRendererOnCCThread(CCLayerTreeHost* ownerHack, GraphicsContext3D* contextPtr, CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities)
     267void CCThreadProxy::initializeLayerRendererOnCCThread(GraphicsContext3D* contextPtr, CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities)
    255268{
    256269    TRACE_EVENT("CCThreadProxy::initializeLayerRendererOnCCThread", this, 0);
    257270    ASSERT(isImplThread());
    258271    RefPtr<GraphicsContext3D> context(adoptRef(contextPtr));
    259     *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(ownerHack, context);
     272    *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(context);
    260273    if (*initializeSucceeded)
    261274        *capabilities = m_layerTreeHostImpl->layerRendererCapabilities();
     
    267280    TRACE_EVENT("CCThreadProxy::layerTreeHostClosedOnCCThread", this, 0);
    268281    ASSERT(isImplThread());
     282    m_layerTreeHost->deleteContentsTextures(m_layerTreeHostImpl->context());
    269283    m_layerTreeHostImpl.clear();
    270284    completion->signal();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h

    r95014 r95100  
    4646    virtual void finishAllRendering();
    4747    virtual bool isStarted() const;
    48     virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack);
     48    virtual bool initializeLayerRenderer();
    4949    virtual const LayerRendererCapabilities& layerRendererCapabilities() const;
    5050    virtual void loseCompositorContext(int numTimes);
     51    virtual void setNeedsCommit();
    5152    virtual void setNeedsCommitAndRedraw();
    5253    virtual void setNeedsRedraw();
    5354    virtual void start();
    5455    virtual void stop();
    55 
    56     // Temporary hack while LayerChromiums hold references to LayerRendererChromiums
    57     virtual TextureManager* contentsTextureManager();
    5856
    5957private:
     
    6866    void drawLayersOnCCThread();
    6967    void initializeImplOnCCThread(CCCompletionEvent*);
    70     void initializeLayerRendererOnCCThread(CCLayerTreeHost*, GraphicsContext3D*, CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*);
     68    void initializeLayerRendererOnCCThread(GraphicsContext3D*, CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*);
     69    void setNeedsCommitOnCCThread();
    7170    void setNeedsCommitAndRedrawOnCCThread();
    7271    void setNeedsRedrawOnCCThread();
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp

    r95014 r95100  
    7676void CCTiledLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const
    7777{
     78    CCLayerImpl::dumpLayerProperties(ts, indent);
    7879    writeIndent(ts, indent);
    79     CCLayerImpl::dumpLayerProperties(ts, indent);
     80    ts << "skipsDraw: " << (!m_tiler || m_skipsDraw) << "\n";
    8081}
    8182
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h

    r95014 r95100  
    6868    explicit CCTiledLayerImpl(int id);
    6969
     70    virtual const char* layerTypeAsString() const { return "ContentLayer"; }
     71
    7072    // Draw all tiles that intersect with the content rect.
    7173    void draw(LayerRendererChromium*, const IntRect& contentRect, const TransformationMatrix&, float opacity);
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h

    r95014 r95100  
    5959    explicit CCVideoLayerImpl(int);
    6060
     61    virtual const char* layerTypeAsString() const { return "VideoLayer"; }
     62
    6163    struct Texture {
    6264        Platform3DObject id;
Note: See TracChangeset for help on using the changeset viewer.