Changeset 95014 in webkit
- Timestamp:
- Sep 12, 2011 9:44:38 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 deleted
- 38 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95011 r95014 1 2011-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r94975. 4 http://trac.webkit.org/changeset/94975 5 https://bugs.webkit.org/show_bug.cgi?id=67984 6 7 crash in PrerenderBrowserTest.PrerenderHTML5VideoJs (Requested 8 by ukai on #webkit). 9 10 * platform/chromium/compositing/lost-compositor-context-with-rendersurface-expected.png: Removed. 11 * platform/chromium/compositing/lost-compositor-context-with-rendersurface-expected.txt: Removed. 12 * platform/chromium/compositing/lost-compositor-context-with-rendersurface.html: Removed. 13 1 14 2011-09-12 Sam Weinig <sam@webkit.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r95013 r95014 1 2011-09-12 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r94975. 4 http://trac.webkit.org/changeset/94975 5 https://bugs.webkit.org/show_bug.cgi?id=67984 6 7 crash in PrerenderBrowserTest.PrerenderHTML5VideoJs (Requested 8 by ukai on #webkit). 9 10 * platform/graphics/chromium/CanvasLayerChromium.h: 11 (WebCore::CanvasLayerChromium::layerTypeAsString): 12 * platform/graphics/chromium/ContentLayerChromium.h: 13 (WebCore::ContentLayerChromium::layerTypeAsString): 14 * platform/graphics/chromium/ImageLayerChromium.h: 15 (WebCore::ImageLayerChromium::layerTypeAsString): 16 * platform/graphics/chromium/LayerChromium.cpp: 17 (WebCore::LayerChromium::layerTreeAsText): 18 (WebCore::writeIndent): 19 (WebCore::LayerChromium::dumpLayer): 20 (WebCore::LayerChromium::dumpLayerProperties): 21 * platform/graphics/chromium/LayerChromium.h: 22 (WebCore::LayerChromium::layerTypeAsString): 23 * platform/graphics/chromium/LayerRendererChromium.cpp: 24 (WebCore::LayerRendererChromium::textureMemoryReclaimLimit): 25 (WebCore::LayerRendererChromium::create): 26 (WebCore::LayerRendererChromium::LayerRendererChromium): 27 (WebCore::LayerRendererChromium::close): 28 (WebCore::LayerRendererChromium::releaseTextures): 29 (WebCore::LayerRendererChromium::drawLayers): 30 (WebCore::LayerRendererChromium::drawLayersInternal): 31 (WebCore::LayerRendererChromium::getOffscreenLayerTexture): 32 (WebCore::LayerRendererChromium::initializeSharedObjects): 33 (WebCore::LayerRendererChromium::cleanupSharedObjects): 34 (WebCore::LayerRendererChromium::layerTreeAsText): 35 (WebCore::LayerRendererChromium::dumpRenderSurfaces): 36 * platform/graphics/chromium/LayerRendererChromium.h: 37 (WebCore::LayerRendererChromium::owner): 38 (WebCore::LayerRendererChromium::rootLayer): 39 (WebCore::LayerRendererChromium::rootLayerImpl): 40 (WebCore::LayerRendererChromium::viewportSize): 41 (WebCore::LayerRendererChromium::contentsTextureManager): 42 * platform/graphics/chromium/ManagedTexture.cpp: 43 (WebCore::ManagedTexture::bindTexture): 44 (WebCore::ManagedTexture::framebufferTexture2D): 45 * platform/graphics/chromium/PluginLayerChromium.h: 46 (WebCore::PluginLayerChromium::layerTypeAsString): 47 * platform/graphics/chromium/RenderSurfaceChromium.cpp: 48 (WebCore::RenderSurfaceChromium::name): 49 (WebCore::writeIndent): 50 (WebCore::RenderSurfaceChromium::dumpSurface): 51 * platform/graphics/chromium/RenderSurfaceChromium.h: 52 * platform/graphics/chromium/TextureManager.cpp: 53 (WebCore::TextureManager::deleteEvictedTextures): 54 (WebCore::TextureManager::removeTexture): 55 (WebCore::TextureManager::allocateTexture): 56 (WebCore::TextureManager::requestTexture): 57 * platform/graphics/chromium/TextureManager.h: 58 (WebCore::TextureManager::setAssociatedContextDebugOnly): 59 (WebCore::TextureManager::associatedContextDebugOnly): 60 * platform/graphics/chromium/TiledLayerChromium.cpp: 61 (WebCore::writeIndent): 62 (WebCore::TiledLayerChromium::dumpLayerProperties): 63 * platform/graphics/chromium/TiledLayerChromium.h: 64 * platform/graphics/chromium/VideoLayerChromium.h: 65 (WebCore::VideoLayerChromium::layerTypeAsString): 66 * platform/graphics/chromium/WebGLLayerChromium.h: 67 (WebCore::WebGLLayerChromium::layerTypeAsString): 68 * platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp: 69 * platform/graphics/chromium/cc/CCCanvasLayerImpl.h: 70 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 71 * platform/graphics/chromium/cc/CCLayerImpl.h: 72 * platform/graphics/chromium/cc/CCLayerTreeHost.cpp: 73 (WebCore::CCLayerTreeHost::initialize): 74 (WebCore::CCLayerTreeHost::~CCLayerTreeHost): 75 (WebCore::CCLayerTreeHost::commitTo): 76 (WebCore::CCLayerTreeHost::didRecreateGraphicsContext): 77 (WebCore::CCLayerTreeHost::setVisible): 78 (WebCore::CCLayerTreeHost::contentsTextureManager): 79 * platform/graphics/chromium/cc/CCLayerTreeHost.h: 80 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp: 81 (WebCore::CCLayerTreeHostImpl::drawLayers): 82 (WebCore::CCLayerTreeHostImpl::setVisible): 83 (WebCore::CCLayerTreeHostImpl::initializeLayerRenderer): 84 * platform/graphics/chromium/cc/CCLayerTreeHostImpl.h: 85 * platform/graphics/chromium/cc/CCPluginLayerImpl.cpp: 86 * platform/graphics/chromium/cc/CCPluginLayerImpl.h: 87 * platform/graphics/chromium/cc/CCProxy.h: 88 * platform/graphics/chromium/cc/CCSingleThreadProxy.cpp: 89 (WebCore::CCSingleThreadProxy::initializeLayerRenderer): 90 (WebCore::CCSingleThreadProxy::stop): 91 (WebCore::CCSingleThreadProxy::contentsTextureManager): 92 (WebCore::CCSingleThreadProxy::recreateContextIfNeeded): 93 * platform/graphics/chromium/cc/CCSingleThreadProxy.h: 94 * platform/graphics/chromium/cc/CCThreadProxy.cpp: 95 (WebCore::CCThreadProxy::initializeLayerRenderer): 96 (WebCore::CCThreadProxy::contentsTextureManager): 97 (WebCore::CCThreadProxy::initializeLayerRendererOnCCThread): 98 (WebCore::CCThreadProxy::layerTreeHostClosedOnCCThread): 99 * platform/graphics/chromium/cc/CCThreadProxy.h: 100 * platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: 101 (WebCore::CCTiledLayerImpl::dumpLayerProperties): 102 * platform/graphics/chromium/cc/CCTiledLayerImpl.h: 103 * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp: 104 * platform/graphics/chromium/cc/CCVideoLayerImpl.h: 105 1 106 2011-09-12 Joseph Pecoraro <joepeck@webkit.org> 2 107 -
trunk/Source/WebCore/platform/graphics/chromium/CanvasLayerChromium.h
r94975 r95014 53 53 explicit CanvasLayerChromium(GraphicsLayerChromium* owner); 54 54 55 virtual const char* layerTypeAsString() const { return "CanvasLayer"; } 56 55 57 bool m_hasAlpha; 56 58 bool m_premultipliedAlpha; -
trunk/Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h
r94975 r95014 55 55 explicit ContentLayerChromium(GraphicsLayerChromium* owner); 56 56 57 virtual const char* layerTypeAsString() const { return "ContentLayer"; } 58 57 59 virtual void cleanupResources(); 58 60 virtual bool drawsContent() const; -
trunk/Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h
r94975 r95014 58 58 void setContents(Image* image); 59 59 60 protected: 61 virtual const char* layerTypeAsString() const { return "ImageLayer"; } 62 60 63 private: 61 64 ImageLayerChromium(GraphicsLayerChromium* owner); -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r94975 r95014 377 377 } 378 378 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 379 421 PassRefPtr<CCLayerImpl> LayerChromium::createCCLayerImpl() 380 422 { -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r94975 r95014 173 173 174 174 void drawDebugBorder(); 175 String layerTreeAsText() const; 175 176 176 177 void setBorderWidth(float); … … 219 220 220 221 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; 221 227 222 228 FloatRect m_dirtyRect; -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r94975 r95014 71 71 namespace WebCore { 72 72 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 73 87 namespace { 74 88 … … 130 144 } // anonymous namespace 131 145 132 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHost Impl* owner, PassRefPtr<GraphicsContext3D> context)146 PassRefPtr<LayerRendererChromium> LayerRendererChromium::create(CCLayerTreeHost* owner, CCLayerTreeHostImpl* ownerImpl, PassRefPtr<GraphicsContext3D> context) 133 147 { 134 148 #if USE(SKIA) … … 136 150 return 0; 137 151 #endif 138 RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(owner, context)));152 RefPtr<LayerRendererChromium> layerRenderer(adoptRef(new LayerRendererChromium(owner, ownerImpl, context))); 139 153 if (!layerRenderer->initialize()) 140 154 return 0; … … 143 157 } 144 158 145 LayerRendererChromium::LayerRendererChromium(CCLayerTreeHostImpl* owner, 159 LayerRendererChromium::LayerRendererChromium(CCLayerTreeHost* owner, 160 CCLayerTreeHostImpl* ownerImpl, 146 161 PassRefPtr<GraphicsContext3D> context) 147 162 : m_owner(owner) 163 , m_ownerImpl(ownerImpl) 148 164 , m_currentRenderSurface(0) 149 165 , m_offscreenFramebufferId(0) … … 195 211 void LayerRendererChromium::close() 196 212 { 197 if (rootLayer ())198 clearRenderSurfacesOnCCLayerImplRecursive(rootLayer ());213 if (rootLayerImpl()) 214 clearRenderSurfacesOnCCLayerImplRecursive(rootLayerImpl()); 199 215 } 200 216 … … 211 227 } 212 228 213 void LayerRendererChromium::releaseRenderSurfaceTextures() 214 { 215 m_renderSurfaceTextureManager->evictAndDeleteAllTextures(m_context.get()); 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()); 216 241 } 217 242 … … 233 258 m_headsUpDisplay->onFrameBegin(currentTime()); 234 259 235 if (!rootLayer ())260 if (!rootLayerImpl()) 236 261 return; 237 262 // FIXME: No need to walk the tree here. This could be passed via draw. 238 rootLayer ()->setLayerRendererRecursive(this);239 240 m_renderSurfaceTextureManager->setMemoryLimitBytes( TextureManager::highLimitBytes() - m_contentsTextureMemoryUseBytes);263 rootLayerImpl()->setLayerRendererRecursive(this); 264 265 m_renderSurfaceTextureManager->setMemoryLimitBytes(textureMemoryHighLimitBytes - m_contentsTextureManager->currentMemoryUseBytes()); 241 266 drawLayersInternal(); 242 267 243 if (TextureManager::reclaimLimitBytes() > m_contentsTextureMemoryUseBytes) 244 m_renderSurfaceTextureManager->reduceMemoryToLimit(TextureManager::reclaimLimitBytes() - m_contentsTextureMemoryUseBytes); 268 m_contentsTextureManager->unprotectAllTextures(); 269 270 if (textureMemoryReclaimLimitBytes > m_contentsTextureManager->currentMemoryUseBytes()) 271 m_renderSurfaceTextureManager->reduceMemoryToLimit(textureMemoryReclaimLimitBytes - m_contentsTextureManager->currentMemoryUseBytes()); 245 272 else 246 273 m_renderSurfaceTextureManager->reduceMemoryToLimit(0); … … 257 284 258 285 TRACE_EVENT("LayerRendererChromium::drawLayers", this, 0); 259 CCLayerImpl* rootDrawLayer = rootLayer ();286 CCLayerImpl* rootDrawLayer = rootLayerImpl(); 260 287 makeContextCurrent(); 261 288 … … 421 448 ManagedTexture* LayerRendererChromium::getOffscreenLayerTexture() 422 449 { 423 return settings().compositeOffscreen && rootLayer () ? rootLayer()->renderSurface()->contentsTexture() : 0;450 return settings().compositeOffscreen && rootLayerImpl() ? rootLayerImpl()->renderSurface()->contentsTexture() : 0; 424 451 } 425 452 … … 577 604 GLC(m_context.get(), m_context->flush()); 578 605 579 m_renderSurfaceTextureManager = TextureManager::create(TextureManager::highLimitBytes(), m_capabilities.maxTextureSize); 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 580 612 return true; 581 613 } … … 786 818 GLC(m_context.get(), m_context->deleteFramebuffer(m_offscreenFramebufferId)); 787 819 788 ASSERT(!m_contentsTextureMemoryUseBytes); 789 releaseRenderSurfaceTextures(); 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(); 790 829 } 791 830 … … 794 833 TextStream ts; 795 834 if (rootLayer()) { 796 ts << rootLayer()-> layerTreeAsText();835 ts << rootLayer()->platformLayer()->layerTreeAsText(); 797 836 ts << "RenderSurfaces:\n"; 798 dumpRenderSurfaces(ts, 1, rootLayer() );837 dumpRenderSurfaces(ts, 1, rootLayer()->platformLayer()); 799 838 } 800 839 return ts.release(); 801 840 } 802 841 803 void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const CCLayerImpl* layer) const842 void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, const LayerChromium* layer) const 804 843 { 805 844 if (layer->renderSurface()) -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r94975 r95014 75 75 class LayerRendererChromium : public RefCounted<LayerRendererChromium> { 76 76 public: 77 static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHost Impl*, PassRefPtr<GraphicsContext3D>);77 static PassRefPtr<LayerRendererChromium> create(CCLayerTreeHost*, CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>); 78 78 79 79 // Must be called in order to allow the LayerRendererChromium to destruct … … 85 85 const LayerRendererCapabilities& capabilities() const { return m_capabilities; } 86 86 87 CCLayerImpl* rootLayer() { return m_owner->rootLayer(); } 88 const CCLayerImpl* rootLayer() const { return m_owner->rootLayer(); } 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(); } 89 95 90 96 GraphicsContext3D* context(); 91 97 bool contextSupportsMapSub() const { return m_capabilities.usingMapSub; } 92 98 93 const IntSize& viewportSize() { return m_owner ->viewportSize(); }99 const IntSize& viewportSize() { return m_ownerImpl->viewportSize(); } 94 100 int viewportWidth() { return viewportSize().width(); } 95 101 int viewportHeight() { return viewportSize().height(); } … … 134 140 void getFramebufferPixels(void *pixels, const IntRect& rect); 135 141 142 TextureManager* contentsTextureManager() const { return m_contentsTextureManager.get(); } 136 143 TextureManager* renderSurfaceTextureManager() const { return m_renderSurfaceTextureManager.get(); } 137 144 … … 144 151 bool isContextLost(); 145 152 146 void release RenderSurfaceTextures();153 void releaseTextures(); 147 154 148 155 GC3Denum bestTextureFormat(); … … 150 157 typedef Vector<RefPtr<CCLayerImpl> > CCLayerList; 151 158 152 void setContentsTextureMemoryUseBytes(size_t contentsTextureMemoryUseBytes) { m_contentsTextureMemoryUseBytes = contentsTextureMemoryUseBytes; } 159 // FIXME: Remove this when the contents texture manager has moved to CCLayerTreeHost. 160 static size_t textureMemoryReclaimLimit(); 153 161 154 162 private: 155 LayerRendererChromium(CCLayerTreeHost Impl*, PassRefPtr<GraphicsContext3D>);163 LayerRendererChromium(CCLayerTreeHost*, CCLayerTreeHostImpl*, PassRefPtr<GraphicsContext3D>); 156 164 bool initialize(); 157 165 … … 172 180 static bool compareLayerZ(const RefPtr<CCLayerImpl>&, const RefPtr<CCLayerImpl>&); 173 181 174 void dumpRenderSurfaces(TextStream&, int indent, const CCLayerImpl*) const;182 void dumpRenderSurfaces(TextStream&, int indent, const LayerChromium*) const; 175 183 176 184 bool initializeSharedObjects(); … … 179 187 void clearRenderSurfacesOnCCLayerImplRecursive(CCLayerImpl*); 180 188 181 CCLayerTreeHostImpl* m_owner; 189 // FIXME: Remove CCLayerTreeHost field 190 CCLayerTreeHost* m_owner; 191 192 CCLayerTreeHostImpl* m_ownerImpl; 182 193 183 194 LayerRendererCapabilities m_capabilities; … … 210 221 OwnPtr<CCVideoLayerImpl::YUVProgram> m_videoLayerYUVProgram; 211 222 212 size_t m_contentsTextureMemoryUseBytes;223 OwnPtr<TextureManager> m_contentsTextureManager; 213 224 OwnPtr<TextureManager> m_renderSurfaceTextureManager; 214 225 -
trunk/Source/WebCore/platform/graphics/chromium/ManagedTexture.cpp
r94975 r95014 84 84 { 85 85 ASSERT(m_textureManager->hasTexture(m_token)); 86 ASSERT(context == m_textureManager->associatedContextDebugOnly()); 86 87 if (!m_textureId) 87 88 m_textureId = m_textureManager->allocateTexture(context, m_token); … … 92 93 { 93 94 ASSERT(m_textureManager->hasTexture(m_token)); 95 ASSERT(context == m_textureManager->associatedContextDebugOnly()); 94 96 if (!m_textureId) 95 97 m_textureId = m_textureManager->allocateTexture(context, m_token); -
trunk/Source/WebCore/platform/graphics/chromium/PluginLayerChromium.h
r94975 r95014 47 47 virtual void pushPropertiesTo(CCLayerImpl*); 48 48 49 protected: 50 virtual const char* layerTypeAsString() const { return "PluginLayer"; } 51 49 52 private: 50 53 explicit PluginLayerChromium(GraphicsLayerChromium* owner); -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.cpp
r94975 r95014 60 60 } 61 61 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 62 84 } 63 85 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/RenderSurfaceChromium.h
r94975 r95014 55 55 void draw(const IntRect& targetSurfaceRect); 56 56 57 String name() const; 58 void dumpSurface(TextStream&, int indent) const; 59 57 60 // Returns the rect that encloses the RenderSurface including any reflection. 58 61 FloatRect drawableContentRect() const; -
trunk/Source/WebCore/platform/graphics/chromium/TextureManager.cpp
r94975 r95014 45 45 } 46 46 47 size_t TextureManager::highLimitBytes()48 {49 return 128 * 1024 * 1024;50 }51 52 size_t TextureManager::reclaimLimitBytes()53 {54 return 64 * 1024 * 1024;55 }56 57 size_t TextureManager::lowLimitBytes()58 {59 return 3 * 1024 * 1024;60 }61 62 47 TextureManager::TextureManager(size_t memoryLimitBytes, int maxTextureSize) 63 48 : m_memoryLimitBytes(memoryLimitBytes) … … 155 140 void TextureManager::deleteEvictedTextures(GraphicsContext3D* context) 156 141 { 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 170 void TextureManager::evictAndDeleteAllTextures(GraphicsContext3D* context) 171 { 172 unprotectAllTextures(); 173 reduceMemoryToLimit(0); 174 deleteEvictedTextures(context); 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(); 175 148 } 176 149 … … 183 156 ASSERT(m_textureLRUSet.contains(token)); 184 157 m_textureLRUSet.remove(token); 185 EvictionEntry entry; 186 entry.textureId = info.textureId; 187 #ifndef NDEBUG 188 entry.allocatingContext = info.allocatingContext; 189 #endif 190 m_evictedTextures.append(entry); 158 m_evictedTextureIds.append(info.textureId); 191 159 } 192 160 193 161 unsigned TextureManager::allocateTexture(GraphicsContext3D* context, TextureToken token) 194 162 { 163 ASSERT(context == m_associatedContextDebugOnly); 195 164 TextureMap::iterator it = m_textures.find(token); 196 165 ASSERT(it != m_textures.end()); … … 209 178 GLC(context, context->texImage2DResourceSafe(GraphicsContext3D::TEXTURE_2D, 0, info->format, info->size.width(), info->size.height(), 0, info->format, GraphicsContext3D::UNSIGNED_BYTE)); 210 179 info->textureId = textureId; 211 #ifndef NDEBUG212 info->allocatingContext = context;213 #endif214 180 return textureId; 215 181 } … … 239 205 info.textureId = 0; 240 206 info.isProtected = true; 241 #ifndef NDEBUG242 info.allocatingContext = 0;243 #endif244 207 addTexture(token, info); 245 208 return true; -
trunk/Source/WebCore/platform/graphics/chromium/TextureManager.h
r94975 r95014 46 46 } 47 47 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 55 48 void setMemoryLimitBytes(size_t); 56 49 … … 69 62 void deleteEvictedTextures(GraphicsContext3D*); 70 63 71 void evictAndDeleteAllTextures(GraphicsContext3D*);72 73 64 void reduceMemoryToLimit(size_t); 74 65 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 75 71 76 72 private: … … 82 78 unsigned textureId; 83 79 bool isProtected; 84 #ifndef NDEBUG85 GraphicsContext3D* allocatingContext;86 #endif87 80 }; 88 81 … … 99 92 TextureToken m_nextToken; 100 93 101 struct EvictionEntry {102 unsigned textureId;103 94 #ifndef NDEBUG 104 GraphicsContext3D* allocatingContext;95 GraphicsContext3D* m_associatedContextDebugOnly; 105 96 #endif 106 };107 97 108 Vector< EvictionEntry> m_evictedTextures;98 Vector<unsigned> m_evictedTextureIds; 109 99 }; 110 100 -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
r94975 r95014 266 266 } 267 267 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 268 281 TextureManager* TiledLayerChromium::textureManager() const 269 282 { -
trunk/Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
r94975 r95014 75 75 virtual PassRefPtr<CCLayerImpl> createCCLayerImpl(); 76 76 77 virtual void dumpLayerProperties(TextStream&, int indent) const; 78 77 79 virtual void setLayerTreeHost(CCLayerTreeHost*); 78 80 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h
r94975 r95014 64 64 protected: 65 65 virtual void cleanupResources(); 66 virtual const char* layerTypeAsString() const { return "VideoLayer"; } 66 67 67 68 private: -
trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
r94975 r95014 58 58 GraphicsContext3D* context() { return m_context; } 59 59 60 protected: 61 virtual const char* layerTypeAsString() const { return "WebGLLayer"; } 62 60 63 private: 61 64 explicit WebGLLayerChromium(GraphicsLayerChromium* owner); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.cpp
r94975 r95014 49 49 } 50 50 51 const char* CCCanvasLayerImpl::layerTypeAsString() const52 {53 return "CanvasLayer";54 }55 56 51 void CCCanvasLayerImpl::draw() 57 52 { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCCanvasLayerImpl.h
r94975 r95014 53 53 explicit CCCanvasLayerImpl(int); 54 54 55 virtual const char* layerTypeAsString() const;56 57 55 unsigned m_textureId; 58 56 bool m_hasAlpha; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r94975 r95014 86 86 } 87 87 88 const char* CCLayerImpl::layerTypeAsString() const89 {90 return "LayerChromium";91 }92 93 88 void CCLayerImpl::addChild(PassRefPtr<CCLayerImpl> child) 94 89 { … … 233 228 } 234 229 235 String CCLayerImpl::layerTreeAsText() const 236 { 237 TextStream ts; 238 dumpLayer(ts, 0); 239 return ts.release(); 240 } 241 242 void CCLayerImpl::dumpLayer(TextStream& ts, int indent) const 243 { 244 writeIndent(ts, indent); 245 ts << layerTypeAsString() << "(" << m_name << ")\n"; 246 dumpLayerProperties(ts, indent+2); 247 if (m_replicaLayer) { 248 writeIndent(ts, indent+2); 249 ts << "Replica:\n"; 250 m_replicaLayer->dumpLayer(ts, indent+3); 251 } 252 if (m_maskLayer) { 253 writeIndent(ts, indent+2); 254 ts << "Mask:\n"; 255 m_maskLayer->dumpLayer(ts, indent+3); 256 } 257 for (size_t i = 0; i < m_children.size(); ++i) 258 m_children[i]->dumpLayer(ts, indent+1); 259 } 260 261 } 262 230 } 263 231 264 232 #endif // USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r94975 r95014 166 166 void setDrawableContentRect(const IntRect& rect) { m_drawableContentRect = rect; } 167 167 168 String layerTreeAsText() const;168 virtual void dumpLayerProperties(TextStream&, int indent) const; 169 169 170 170 protected: 171 171 explicit CCLayerImpl(int); 172 172 173 virtual void dumpLayerProperties(TextStream&, int indent) const;174 173 static void writeIndent(TextStream&, int indent); 175 174 … … 178 177 friend class TreeSynchronizer; 179 178 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;182 183 void dumpLayer(TextStream&, int indent) const;184 179 185 180 // Properties internal to CCLayerImpl -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
r94975 r95014 70 70 m_proxy->start(); 71 71 72 if (!m_proxy->initializeLayerRenderer( ))72 if (!m_proxy->initializeLayerRenderer(this)) 73 73 return false; 74 74 … … 87 87 m_proxy->setNeedsCommitAndRedraw(); 88 88 89 m_contentsTextureManager = TextureManager::create(TextureManager::highLimitBytes(), m_proxy->layerRendererCapabilities().maxTextureSize);90 89 return true; 91 90 } … … 93 92 CCLayerTreeHost::~CCLayerTreeHost() 94 93 { 95 ASSERT(CCProxy::isMainThread());96 94 TRACE_EVENT("CCLayerTreeHost::~CCLayerTreeHost", this, 0); 97 95 m_proxy->stop(); 98 96 m_proxy.clear(); 99 m_updateList.clear();100 ASSERT(!m_contentsTextureManager->currentMemoryUseBytes());101 m_contentsTextureManager.clear();102 }103 104 void CCLayerTreeHost::deleteContentsTextures(GraphicsContext3D* context)105 {106 ASSERT(CCProxy::isImplThread());107 m_contentsTextureManager->evictAndDeleteAllTextures(context);108 97 } 109 98 … … 121 110 hostImpl->setSourceFrameNumber(frameNumber()); 122 111 123 contentsTextureManager()->reduceMemoryToLimit( TextureManager::reclaimLimitBytes());112 contentsTextureManager()->reduceMemoryToLimit(hostImpl->layerRenderer()->textureMemoryReclaimLimit()); 124 113 contentsTextureManager()->deleteEvictedTextures(hostImpl->context()); 125 114 … … 130 119 hostImpl->setZoomAnimatorScale(m_zoomAnimatorScale); 131 120 hostImpl->setViewport(viewportSize()); 132 133 hostImpl->layerRenderer()->setContentsTextureMemoryUseBytes(m_contentsTextureManager->currentMemoryUseBytes());134 m_contentsTextureManager->unprotectAllTextures();135 121 136 122 // Synchronize trees, if one exists at all... … … 160 146 void CCLayerTreeHost::didRecreateGraphicsContext(bool success) 161 147 { 162 m_contentsTextureManager->evictAndDeleteAllTextures(0);163 164 148 if (rootLayer()) 165 149 rootLayer()->platformLayer()->cleanupResourcesRecursive(); … … 276 260 { 277 261 m_visible = visible; 278 if (visible) 279 m_proxy->setNeedsCommitAndRedraw(); 280 else { 281 m_nonCompositedContentHost->protectVisibleTileTextures(); 282 m_contentsTextureManager->reduceMemoryToLimit(TextureManager::lowLimitBytes()); 283 m_contentsTextureManager->unprotectAllTextures(); 284 m_proxy->setNeedsCommit(); 285 } 262 m_proxy->setNeedsCommitAndRedraw(); 286 263 } 287 264 … … 293 270 TextureManager* CCLayerTreeHost::contentsTextureManager() const 294 271 { 295 return m_ contentsTextureManager.get();272 return m_proxy->contentsTextureManager(); 296 273 } 297 274 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
r94975 r95014 158 158 void updateLayers(); 159 159 160 void deleteContentsTextures(GraphicsContext3D*);161 162 160 protected: 163 161 CCLayerTreeHost(CCLayerTreeHostClient*, const CCSettings&); … … 187 185 OwnPtr<GraphicsLayer> m_rootLayer; 188 186 OwnPtr<NonCompositedContentHost> m_nonCompositedContentHost; 189 OwnPtr<TextureManager> m_contentsTextureManager;190 187 191 188 LayerList m_updateList; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
r94975 r95014 75 75 TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0); 76 76 ASSERT(m_layerRenderer); 77 if (m_layerRenderer-> rootLayer())77 if (m_layerRenderer->owner()->rootLayer()) 78 78 m_layerRenderer->drawLayers(); 79 79 … … 117 117 { 118 118 if (m_layerRenderer && !visible) 119 m_layerRenderer->release RenderSurfaceTextures();119 m_layerRenderer->releaseTextures(); 120 120 } 121 121 122 bool CCLayerTreeHostImpl::initializeLayerRenderer( PassRefPtr<GraphicsContext3D> context)122 bool CCLayerTreeHostImpl::initializeLayerRenderer(CCLayerTreeHost* implHack, PassRefPtr<GraphicsContext3D> context) 123 123 { 124 // If m_layerRenderer exists, then we are recovering from a lost context 125 bool recreatingRenderer = m_layerRenderer; 126 127 // First time layerRenderer creation 124 128 RefPtr<LayerRendererChromium> layerRenderer; 125 layerRenderer = LayerRendererChromium::create(this, context); 129 if (!recreatingRenderer) 130 layerRenderer = LayerRendererChromium::create(implHack, this, context); 131 else 132 layerRenderer = LayerRendererChromium::create(m_layerRenderer->owner(), this, context); 133 126 134 127 135 // If creation failed, and we had asked for accelerated painting, disable accelerated painting … … 130 138 m_settings.acceleratePainting = false; 131 139 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(); 140 if (!recreatingRenderer) 141 layerRenderer = LayerRendererChromium::create(implHack, this, context); 142 else 143 layerRenderer = LayerRendererChromium::create(m_layerRenderer->owner(), this, context); 140 144 } 141 145 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.h
r94975 r95014 57 57 int frameNumber() const { return m_frameNumber; } 58 58 59 bool initializeLayerRenderer( PassRefPtr<GraphicsContext3D>);59 bool initializeLayerRenderer(CCLayerTreeHost* ownerHack, PassRefPtr<GraphicsContext3D>); 60 60 bool isContextLost(); 61 61 LayerRendererChromium* layerRenderer() { return m_layerRenderer.get(); } … … 78 78 void setZoomAnimatorScale(double); 79 79 80 const CCSettings& settings() const { return m_settings; }81 80 protected: 82 81 explicit CCLayerTreeHostImpl(const CCSettings&); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.cpp
r94975 r95014 47 47 } 48 48 49 const char* CCPluginLayerImpl::layerTypeAsString() const50 {51 return "PluginLayer";52 }53 54 49 void CCPluginLayerImpl::draw() 55 50 { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCPluginLayerImpl.h
r94975 r95014 52 52 explicit CCPluginLayerImpl(int); 53 53 54 virtual const char* layerTypeAsString() const;55 56 54 unsigned m_textureId; 57 55 }; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
r94975 r95014 59 59 virtual bool isStarted() const = 0; 60 60 61 virtual bool initializeLayerRenderer( ) = 0;61 virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack) = 0; 62 62 63 63 virtual const LayerRendererCapabilities& layerRendererCapabilities() const = 0; 64 64 65 virtual void setNeedsCommit() = 0;66 65 virtual void setNeedsCommitAndRedraw() = 0; 67 66 virtual void setNeedsRedraw() = 0; … … 82 81 virtual GraphicsContext3D* context() = 0; 83 82 83 // Temporary hack while LayerChromiums hold references to LayerRendererChromiums 84 virtual TextureManager* contentsTextureManager() = 0; 85 84 86 protected: 85 87 CCProxy() { } -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
r94975 r95014 122 122 } 123 123 124 bool CCSingleThreadProxy::initializeLayerRenderer() 125 { 126 ASSERT(isMainThread()); 124 bool CCSingleThreadProxy::initializeLayerRenderer(CCLayerTreeHost* ownerHack) 125 { 127 126 RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); 128 127 if (!context) … … 132 131 { 133 132 ScopedSetImplThread impl; 134 return m_layerTreeHostImpl->initializeLayerRenderer( context);133 return m_layerTreeHostImpl->initializeLayerRenderer(ownerHack, context); 135 134 } 136 135 } … … 146 145 m_graphicsContextLost = true; 147 146 m_timesRecreateShouldFail = numTimes - 1; 148 }149 150 void CCSingleThreadProxy::setNeedsCommit()151 {152 ASSERT(isMainThread());153 // Commit immediately154 {155 ScopedSetImplThread impl;156 m_layerTreeHostImpl->beginCommit();157 m_layerTreeHost->commitTo(m_layerTreeHostImpl.get());158 m_layerTreeHostImpl->commitComplete();159 }160 147 } 161 148 … … 184 171 { 185 172 ScopedSetImplThread impl; 186 m_layerTreeHost->deleteContentsTextures(m_layerTreeHostImpl->context());187 173 m_layerTreeHostImpl.clear(); 188 174 } 189 175 m_layerTreeHost = 0; 176 } 177 178 TextureManager* CCSingleThreadProxy::contentsTextureManager() 179 { 180 return m_layerTreeHostImpl->layerRenderer()->contentsTextureManager(); 190 181 } 191 182 … … 207 198 bool CCSingleThreadProxy::recreateContextIfNeeded() 208 199 { 209 ASSERT(isMainThread());210 200 if (!m_graphicsContextLost) 211 201 return true; … … 218 208 if (context) { 219 209 ASSERT(context->hasOneRef()); 220 if (m_layerTreeHostImpl->initializeLayerRenderer( context)) {210 if (m_layerTreeHostImpl->initializeLayerRenderer(0, context)) { 221 211 m_layerTreeHost->didRecreateGraphicsContext(true); 222 212 m_graphicsContextLost = false; -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
r94975 r95014 45 45 virtual void finishAllRendering(); 46 46 virtual bool isStarted() const; 47 virtual bool initializeLayerRenderer( );47 virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack); 48 48 virtual const LayerRendererCapabilities& layerRendererCapabilities() const; 49 49 virtual void loseCompositorContext(int numTimes); 50 virtual void setNeedsCommit();51 50 virtual void setNeedsCommitAndRedraw(); 52 51 virtual void setNeedsRedraw(); 53 52 virtual void start(); 54 53 virtual void stop(); 54 55 // Temporary hack while LayerChromiums hold references to LayerRendererChromiums 56 virtual TextureManager* contentsTextureManager(); 55 57 56 58 // Special case functions. -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
r94975 r95014 99 99 } 100 100 101 bool CCThreadProxy::initializeLayerRenderer( )101 bool CCThreadProxy::initializeLayerRenderer(CCLayerTreeHost* ownerHack) 102 102 { 103 103 RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); … … 116 116 LayerRendererCapabilities capabilities; 117 117 ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeLayerRendererOnCCThread, 118 AllowCrossThreadAccess(contextPtr), AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities))); 118 AllowCrossThreadAccess(ownerHack), AllowCrossThreadAccess(contextPtr), 119 AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities))); 119 120 completion.wait(); 120 121 … … 134 135 } 135 136 136 void 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 147 137 void CCThreadProxy::setNeedsCommitAndRedraw() 148 138 { … … 181 171 ASSERT(!m_layerTreeHostImpl); // verify that the impl deleted. 182 172 m_layerTreeHost = 0; 173 } 174 175 TextureManager* CCThreadProxy::contentsTextureManager() 176 { 177 ASSERT_NOT_REACHED(); 178 return 0; 183 179 } 184 180 … … 234 230 } 235 231 236 void CCThreadProxy::setNeedsCommit OnCCThread()237 { 238 TRACE_EVENT("CCThreadProxy::setNeedsCommit OnCCThread", this, 0);232 void CCThreadProxy::setNeedsCommitAndRedrawOnCCThread() 233 { 234 TRACE_EVENT("CCThreadProxy::setNeedsCommitAndRedrawOnCCThread", this, 0); 239 235 ASSERT(isImplThread()); 240 236 ASSERT(m_layerTreeHostImpl); 241 // FIXME: Not yet implemented, see https://bugs.webkit.org/show_bug.cgi?id=67417242 ASSERT_NOT_REACHED();243 }244 245 void CCThreadProxy::setNeedsCommitAndRedrawOnCCThread()246 {247 TRACE_EVENT("CCThreadProxy::setNeedsCommitAndRedrawOnCCThread", this, 0);248 ASSERT(isImplThread());249 ASSERT(m_layerTreeHostImpl);250 237 ASSERT_NOT_REACHED(); 251 238 } … … 265 252 } 266 253 267 void CCThreadProxy::initializeLayerRendererOnCCThread( GraphicsContext3D* contextPtr, CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities)254 void CCThreadProxy::initializeLayerRendererOnCCThread(CCLayerTreeHost* ownerHack, GraphicsContext3D* contextPtr, CCCompletionEvent* completion, bool* initializeSucceeded, LayerRendererCapabilities* capabilities) 268 255 { 269 256 TRACE_EVENT("CCThreadProxy::initializeLayerRendererOnCCThread", this, 0); 270 257 ASSERT(isImplThread()); 271 258 RefPtr<GraphicsContext3D> context(adoptRef(contextPtr)); 272 *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer( context);259 *initializeSucceeded = m_layerTreeHostImpl->initializeLayerRenderer(ownerHack, context); 273 260 if (*initializeSucceeded) 274 261 *capabilities = m_layerTreeHostImpl->layerRendererCapabilities(); … … 280 267 TRACE_EVENT("CCThreadProxy::layerTreeHostClosedOnCCThread", this, 0); 281 268 ASSERT(isImplThread()); 282 m_layerTreeHost->deleteContentsTextures(m_layerTreeHostImpl->context());283 269 m_layerTreeHostImpl.clear(); 284 270 completion->signal(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
r94975 r95014 46 46 virtual void finishAllRendering(); 47 47 virtual bool isStarted() const; 48 virtual bool initializeLayerRenderer( );48 virtual bool initializeLayerRenderer(CCLayerTreeHost* ownerHack); 49 49 virtual const LayerRendererCapabilities& layerRendererCapabilities() const; 50 50 virtual void loseCompositorContext(int numTimes); 51 virtual void setNeedsCommit();52 51 virtual void setNeedsCommitAndRedraw(); 53 52 virtual void setNeedsRedraw(); 54 53 virtual void start(); 55 54 virtual void stop(); 55 56 // Temporary hack while LayerChromiums hold references to LayerRendererChromiums 57 virtual TextureManager* contentsTextureManager(); 56 58 57 59 private: … … 66 68 void drawLayersOnCCThread(); 67 69 void initializeImplOnCCThread(CCCompletionEvent*); 68 void initializeLayerRendererOnCCThread(GraphicsContext3D*, CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*); 69 void setNeedsCommitOnCCThread(); 70 void initializeLayerRendererOnCCThread(CCLayerTreeHost*, GraphicsContext3D*, CCCompletionEvent*, bool* initializeSucceeded, LayerRendererCapabilities*); 70 71 void setNeedsCommitAndRedrawOnCCThread(); 71 72 void setNeedsRedrawOnCCThread(); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
r94975 r95014 61 61 } 62 62 63 const char* CCTiledLayerImpl::layerTypeAsString() const64 {65 return "TiledLayer";66 }67 68 63 void CCTiledLayerImpl::bindContentsTexture() 69 64 { … … 81 76 void CCTiledLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const 82 77 { 78 writeIndent(ts, indent); 83 79 CCLayerImpl::dumpLayerProperties(ts, indent); 84 writeIndent(ts, indent);85 ts << "skipsDraw: " << (!m_tiler || m_skipsDraw) << "\n";86 80 } 87 81 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
r94975 r95014 68 68 explicit CCTiledLayerImpl(int id); 69 69 70 virtual const char* layerTypeAsString() const;71 72 70 // Draw all tiles that intersect with the content rect. 73 71 void draw(LayerRendererChromium*, const IntRect& contentRect, const TransformationMatrix&, float opacity); -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
r94975 r95014 68 68 { 69 69 cleanupResources(); 70 }71 72 const char* CCVideoLayerImpl::layerTypeAsString() const73 {74 return "VideoLayer";75 70 } 76 71 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.h
r94975 r95014 59 59 explicit CCVideoLayerImpl(int); 60 60 61 virtual const char* layerTypeAsString() const;62 63 61 struct Texture { 64 62 Platform3DObject id;
Note: See TracChangeset
for help on using the changeset viewer.