Changeset 93647 in webkit
- Timestamp:
- Aug 23, 2011 4:01:08 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r93645 r93647 1 2011-08-23 James Robinson <jamesr@chromium.org> 2 3 [chromium] Remove obsolete child context list from LayerRendererChromium 4 https://bugs.webkit.org/show_bug.cgi?id=66743 5 6 Reviewed by Kenneth Russell. 7 8 Before we had proper semantics for flush() in the command buffer, we 9 used a scheme of latches across contexts to ensure consistent frames 10 were presented for WebGL and canvas. We no longer have latches and 11 flush is a proper synchronization primative, so the child context list 12 no longer does anything. Canvas2DLayerChromium and 13 WebGLLayerChromium's implementations of updateCompositorResources() do 14 flushes on the appropriate context already - canvas layers via 15 DrawingBuffer::publishToPlatformLayer(), and WebGL layers via the call 16 to prepareTexture(). 17 18 No new tests since the code being removed doesn't do anything. 19 20 * platform/graphics/chromium/Canvas2DLayerChromium.cpp: 21 (WebCore::Canvas2DLayerChromium::~Canvas2DLayerChromium): 22 (WebCore::Canvas2DLayerChromium::setDrawingBuffer): 23 * platform/graphics/chromium/Canvas2DLayerChromium.h: 24 * platform/graphics/chromium/LayerRendererChromium.cpp: 25 (WebCore::LayerRendererChromium::drawLayers): 26 * platform/graphics/chromium/LayerRendererChromium.h: 27 * platform/graphics/chromium/WebGLLayerChromium.cpp: 28 (WebCore::WebGLLayerChromium::~WebGLLayerChromium): 29 (WebCore::WebGLLayerChromium::setContext): 30 * platform/graphics/chromium/WebGLLayerChromium.h: 31 1 32 2011-08-23 Alexei Svitkine <asvitkine@chromium.org> 2 33 -
trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
r93438 r93647 55 55 Canvas2DLayerChromium::~Canvas2DLayerChromium() 56 56 { 57 if (m_drawingBuffer && layerRenderer())58 layerRenderer()->removeChildContext(m_drawingBuffer->graphicsContext3D().get());59 57 } 60 58 … … 85 83 void Canvas2DLayerChromium::setDrawingBuffer(DrawingBuffer* drawingBuffer) 86 84 { 87 if (drawingBuffer != m_drawingBuffer) { 88 if (m_drawingBuffer && layerRenderer()) 89 layerRenderer()->removeChildContext(m_drawingBuffer->graphicsContext3D().get()); 90 91 m_drawingBuffer = drawingBuffer; 92 93 if (drawingBuffer && layerRenderer()) 94 layerRenderer()->addChildContext(m_drawingBuffer->graphicsContext3D().get()); 95 } 96 } 97 98 void Canvas2DLayerChromium::setLayerRenderer(LayerRendererChromium* newLayerRenderer) 99 { 100 if (layerRenderer() != newLayerRenderer && m_drawingBuffer) { 101 if (m_drawingBuffer->graphicsContext3D()) { 102 if (layerRenderer()) 103 layerRenderer()->removeChildContext(m_drawingBuffer->graphicsContext3D().get()); 104 if (newLayerRenderer) 105 newLayerRenderer->addChildContext(m_drawingBuffer->graphicsContext3D().get()); 106 } 107 108 LayerChromium::setLayerRenderer(newLayerRenderer); 109 } 85 m_drawingBuffer = drawingBuffer; 110 86 } 111 87 -
trunk/Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h
r93438 r93647 53 53 void setDrawingBuffer(DrawingBuffer*); 54 54 55 virtual void setLayerRenderer(LayerRendererChromium*);56 57 55 private: 58 56 explicit Canvas2DLayerChromium(DrawingBuffer*, GraphicsLayerChromium* owner); -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
r93615 r93647 569 569 return; 570 570 571 // Before drawLayers:572 ChildContextMap::iterator i = m_childContexts.begin();573 for (; i != m_childContexts.end(); ++i) {574 i->first->flush();575 }576 577 571 { 578 572 TRACE_EVENT("LayerRendererChromium::synchronizeTrees", this, 0); … … 1298 1292 } 1299 1293 1300 1301 void LayerRendererChromium::addChildContext(GraphicsContext3D* ctx)1302 {1303 // This is a ref-counting map, because some contexts are shared by multiple1304 // layers (specifically, Canvas2DLayerChromium).1305 1306 // Insert the ctx with a count of 1, or return the existing iterator.1307 std::pair<ChildContextMap::iterator, bool> insert_result = m_childContexts.add(ctx, 1);1308 if (!insert_result.second) {1309 // Already present in map, so increment.1310 ++insert_result.first->second;1311 } else {1312 // FIXME(jbates): when compositor is multithreaded and copyTexImage2D bug is fixed,1313 // uncomment this block:1314 // // This is a new child context - set the parentToChild latch so that it1315 // // can continue past its first wait latch.1316 // Extensions3DChromium* ext = static_cast<Extensions3DChromium*>(ctx->getExtensions());1317 // GC3Duint latchId;1318 // ext->getParentToChildLatchCHROMIUM(&latchId);1319 // ext->setLatchCHROMIUM(0, latchId);1320 }1321 }1322 1323 void LayerRendererChromium::removeChildContext(GraphicsContext3D* ctx)1324 {1325 ChildContextMap::iterator i = m_childContexts.find(ctx);1326 if (i != m_childContexts.end()) {1327 if (--i->second <= 0) {1328 // Count reached zero, so remove from map.1329 m_childContexts.remove(i);1330 }1331 } else {1332 // error1333 ASSERT(0 && "m_childContexts map has mismatched add/remove calls");1334 }1335 }1336 1337 1294 bool LayerRendererChromium::isCompositorContextLost() 1338 1295 { -
trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
r93571 r93647 144 144 String layerTreeAsText() const; 145 145 146 void addChildContext(GraphicsContext3D*);147 void removeChildContext(GraphicsContext3D*);148 149 146 // Return true if the compositor context has an error. 150 147 bool isCompositorContextLost(); … … 160 157 161 158 private: 162 typedef HashMap<GraphicsContext3D*, int> ChildContextMap;163 164 159 // FIXME: This needs to be moved to the CCLayerTreeHostImpl when that class exists. 165 160 RefPtr<CCLayerImpl> m_rootCCLayerImpl; … … 238 233 #endif 239 234 240 ChildContextMap m_childContexts;241 242 235 bool m_contextSupportsMapSub; 243 236 -
trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
r93438 r93647 60 60 WebGLLayerChromium::~WebGLLayerChromium() 61 61 { 62 if (m_context && layerRenderer())63 layerRenderer()->removeChildContext(m_context);64 62 } 65 63 … … 130 128 { 131 129 bool contextChanged = (m_context != context); 132 if (contextChanged && layerRenderer()) {133 if (m_context)134 layerRenderer()->removeChildContext(m_context);135 if (context)136 layerRenderer()->addChildContext(const_cast<GraphicsContext3D*>(context));137 }138 130 139 131 m_context = const_cast<GraphicsContext3D*>(context); … … 154 146 } 155 147 156 void WebGLLayerChromium::setLayerRenderer(LayerRendererChromium* newLayerRenderer)157 {158 if (layerRenderer() != newLayerRenderer) {159 if (m_context) {160 if (layerRenderer())161 layerRenderer()->removeChildContext(m_context);162 if (newLayerRenderer)163 newLayerRenderer->addChildContext(m_context);164 }165 166 LayerChromium::setLayerRenderer(newLayerRenderer);167 }168 }169 170 148 void WebGLLayerChromium::rateLimitContext(Timer<WebGLLayerChromium>*) 171 149 { -
trunk/Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
r93438 r93647 58 58 GraphicsContext3D* context() { return m_context; } 59 59 60 virtual void setLayerRenderer(LayerRendererChromium*);61 62 60 protected: 63 61 virtual const char* layerTypeAsString() const { return "WebGLLayer"; }
Note: See TracChangeset
for help on using the changeset viewer.