Changeset 141232 in webkit
- Timestamp:
- Jan 30, 2013 12:22:57 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r141230 r141232 1 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 3 Coordinated Graphics: Remove m_pendingSyncBackingStores in LayerTreeRenderer. 4 https://bugs.webkit.org/show_bug.cgi?id=107099 5 6 Reviewed by Noam Rosenthal. 7 8 Add GraphicsLayerTextureMapper::setBackingStore() so that 9 LayerTreeRenderer sets a backing store to GraphicsLayerTextureMapper. 10 11 Remove three methods of TextureMapperLayer related to a backing store 12 because they are no longer used. 13 14 Covered by existing compositing tests. 15 16 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 17 (WebCore::GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly): 18 (WebCore::GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded): 19 (WebCore): 20 (WebCore::GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCount): 21 (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded): 22 (WebCore::GraphicsLayerTextureMapper::setBackingStore): 23 * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 24 (GraphicsLayerTextureMapper): 25 * platform/graphics/texmap/TextureMapperLayer.cpp: 26 (WebCore::TextureMapperLayer::flushCompositingStateForThisLayerOnly): 27 * platform/graphics/texmap/TextureMapperLayer.h: 28 (TextureMapperLayer): 29 1 30 2013-01-30 Andrey Lushnikov <lushnikov@chromium.org> 2 31 -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r141067 r141232 403 403 void GraphicsLayerTextureMapper::flushCompositingStateForThisLayerOnly() 404 404 { 405 updateDebugBorderAndRepaintCountIfNeeded();405 prepareBackingStoreIfNeeded(); 406 406 m_layer->flushCompositingStateForThisLayerOnly(this); 407 407 updateBackingStoreIfNeeded(); … … 409 409 } 410 410 411 void GraphicsLayerTextureMapper:: updateDebugBorderAndRepaintCountIfNeeded()411 void GraphicsLayerTextureMapper::prepareBackingStoreIfNeeded() 412 412 { 413 413 if (!m_hasOwnBackingStore) 414 414 return; 415 415 if (!shouldHaveBackingStore()) { 416 m_backingStore.clear(); 417 m_changeMask |= TextureMapperLayer::BackingStoreChange; 418 } else { 419 if (!m_backingStore) { 420 m_backingStore = TextureMapperTiledBackingStore::create(); 421 m_changeMask |= TextureMapperLayer::BackingStoreChange; 422 } 423 } 424 425 updateDebugBorderAndRepaintCount(); 426 } 427 428 void GraphicsLayerTextureMapper::updateDebugBorderAndRepaintCount() 429 { 430 ASSERT(m_hasOwnBackingStore); 416 431 if (isShowingDebugBorder()) 417 432 updateDebugIndicators(); … … 458 473 if (!m_hasOwnBackingStore) 459 474 return; 460 prepareBackingStore(); 461 m_layer->setBackingStore(m_backingStore); 462 } 463 464 void GraphicsLayerTextureMapper::prepareBackingStore() 465 { 475 466 476 TextureMapper* textureMapper = m_layer->textureMapper(); 467 477 if (!textureMapper) … … 469 479 470 480 if (!shouldHaveBackingStore()) { 471 m_backingStore.clear();481 ASSERT(!m_backingStore); 472 482 return; 473 483 } 484 ASSERT(m_backingStore); 474 485 475 486 IntRect dirtyRect = enclosingIntRect(FloatRect(FloatPoint::zero(), m_size)); … … 479 490 return; 480 491 481 if (!m_backingStore)482 m_backingStore = TextureMapperTiledBackingStore::create();483 484 492 #if PLATFORM(QT) 485 493 ASSERT(dynamic_cast<TextureMapperTiledBackingStore*>(m_backingStore.get())); … … 547 555 #endif 548 556 557 void GraphicsLayerTextureMapper::setBackingStore(PassRefPtr<TextureMapperBackingStore> backingStore) 558 { 559 ASSERT(!m_hasOwnBackingStore); 560 if (m_backingStore == backingStore) 561 return; 562 563 m_backingStore = backingStore; 564 notifyChange(TextureMapperLayer::BackingStoreChange); 565 } 566 549 567 void GraphicsLayerTextureMapper::setRepaintCount(int repaintCount) 550 568 { -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r140821 r141232 90 90 // FIXME: It will be removed after removing dependency of LayerTreeRenderer on GraphicsLayerTextureMapper. 91 91 void setHasOwnBackingStore(bool b) { m_hasOwnBackingStore = b; } 92 void setBackingStore(PassRefPtr<TextureMapperBackingStore>); 92 93 93 94 void setFixedToViewport(bool fixed) { m_fixedToViewport = fixed; } … … 101 102 virtual void willBeDestroyed(); 102 103 void didFlushCompositingState(); 103 void updateDebugBorderAndRepaintCount IfNeeded();104 void updateDebugBorderAndRepaintCount(); 104 105 void updateBackingStoreIfNeeded(); 105 void prepareBackingStore ();106 void prepareBackingStoreIfNeeded(); 106 107 bool shouldHaveBackingStore() const; 107 108 void animationStartedTimerFired(Timer<GraphicsLayerTextureMapper>*); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r140825 r141232 55 55 } 56 56 57 void TextureMapperLayer::clearBackingStoresRecursive()58 {59 m_backingStore.clear();60 m_contentsLayer = 0;61 for (size_t i = 0; i < m_children.size(); ++i)62 m_children[i]->clearBackingStoresRecursive();63 if (m_state.maskLayer)64 m_state.maskLayer->clearBackingStoresRecursive();65 }66 67 57 void TextureMapperLayer::computeTransformsRecursive() 68 58 { … … 437 427 m_shouldUpdateCurrentFiltersFromGraphicsLayer = true; 438 428 #endif 429 430 if (changeMask & BackingStoreChange) 431 m_backingStore = graphicsLayer->m_backingStore; 439 432 440 433 if (changeMask & RepaintCountChange) -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r140825 r141232 75 75 76 76 DebugVisualsChange = (1L << 24), 77 RepaintCountChange = (1L << 25) 77 RepaintCountChange = (1L << 25), 78 79 BackingStoreChange = (1L << 26) 78 80 }; 79 81 … … 100 102 101 103 void paint(); 102 103 void setBackingStore(PassRefPtr<TextureMapperBackingStore> backingStore) { m_backingStore = backingStore; }104 PassRefPtr<TextureMapperBackingStore> backingStore() { return m_backingStore; }105 void clearBackingStoresRecursive();106 104 107 105 void setScrollPositionDeltaIfNeeded(const FloatSize&); -
trunk/Source/WebKit2/ChangeLog
r141224 r141232 1 2013-01-30 Huang Dongsung <luxtella@company100.net> 2 3 Coordinated Graphics: Remove m_pendingSyncBackingStores in LayerTreeRenderer. 4 https://bugs.webkit.org/show_bug.cgi?id=107099 5 6 Reviewed by Noam Rosenthal. 7 8 Instead of queuing the setting of backing stores in LayerTreeRenderer, 9 and then setting them directly to TextureMapperLayer, we allow 10 GraphicsLayerTextureMapper's existing queuing mechanism to handle that. 11 Instead of a m_pendingSyncBackingStores queue, we have a m_backingStores 12 queue which can be applied much more easily to the layer tree. 13 14 In addition, LayerTreeRenderer::purgeGLResources() does not call 15 TextureMapperLayer::clearBackingStoresRecursive() because 16 TextureMapperLayer will be destructed soon. 17 18 * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp: 19 (WebKit::LayerTreeRenderer::deleteLayer): 20 (WebKit::LayerTreeRenderer::createBackingStoreIfNeeded): 21 (WebKit::LayerTreeRenderer::removeBackingStoreIfNeeded): 22 (WebKit::LayerTreeRenderer::resetBackingStoreSizeToLayerSize): 23 (WebKit::LayerTreeRenderer::createTile): 24 (WebKit::LayerTreeRenderer::removeTile): 25 (WebKit::LayerTreeRenderer::updateTile): 26 (WebKit::LayerTreeRenderer::commitPendingBackingStoreOperations): 27 (WebKit::LayerTreeRenderer::purgeGLResources): 28 * UIProcess/CoordinatedGraphics/LayerTreeRenderer.h: 29 1 30 2013-01-29 Anders Carlsson <andersca@apple.com> 2 31 -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp
r141065 r141232 387 387 ASSERT(layer); 388 388 389 m_ pendingSyncBackingStores.remove(toTextureMapperLayer(layer.get()));389 m_backingStores.remove(layer.get()); 390 390 m_fixedLayers.remove(layerID); 391 391 #if USE(GRAPHICS_SURFACE) … … 406 406 } 407 407 408 CoordinatedBackingStore* LayerTreeRenderer::getBackingStore(GraphicsLayer* graphicsLayer)409 {410 TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer);411 ASSERT(layer);412 CoordinatedBackingStore* backingStore = static_cast<CoordinatedBackingStore*>(layer->backingStore().get());413 414 BackingStoreMap::iterator it = m_pendingSyncBackingStores.find(layer);415 if (it != m_pendingSyncBackingStores.end())416 backingStore = it->value.get();417 return backingStore;418 }419 420 408 void LayerTreeRenderer::prepareContentBackingStore(GraphicsLayer* graphicsLayer) 421 409 { … … 430 418 void LayerTreeRenderer::createBackingStoreIfNeeded(GraphicsLayer* graphicsLayer) 431 419 { 432 TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer); 433 ASSERT(layer); 434 435 // Make sure the layer does not already have a backing store (committed or pending). 436 BackingStoreMap::iterator it = m_pendingSyncBackingStores.find(layer); 437 if (it != m_pendingSyncBackingStores.end()) { 438 if (!it->value) { 439 // There is a pending removal, cancel it. 440 m_pendingSyncBackingStores.remove(it); 441 } 442 // There is already a pending addition. 443 return; 444 } 445 if (layer->backingStore()) 446 return; // The layer already has a backing store (and no pending removal). 420 if (m_backingStores.contains(graphicsLayer)) 421 return; 447 422 448 423 RefPtr<CoordinatedBackingStore> backingStore(CoordinatedBackingStore::create()); 449 450 424 backingStore->setSize(graphicsLayer->size()); 451 ASSERT(!m_pendingSyncBackingStores.contains(layer));452 m_pendingSyncBackingStores.add(layer,backingStore);425 m_backingStores.add(graphicsLayer, backingStore); 426 toGraphicsLayerTextureMapper(graphicsLayer)->setBackingStore(backingStore); 453 427 } 454 428 455 429 void LayerTreeRenderer::removeBackingStoreIfNeeded(GraphicsLayer* graphicsLayer) 456 430 { 457 TextureMapperLayer* layer = toTextureMapperLayer(graphicsLayer); 458 ASSERT(layer); 459 460 // Check if the layout already has a backing store (committed or pending). 461 BackingStoreMap::iterator it = m_pendingSyncBackingStores.find(layer); 462 if (it != m_pendingSyncBackingStores.end()) { 463 if (it->value) { 464 // There is a pending addition, cancel it. 465 m_pendingSyncBackingStores.remove(it); 466 } 467 // There is already a pending removal. 468 return; 469 } 470 471 if (!layer->backingStore()) 472 return; // The layer has no backing store (and no pending addition). 473 474 ASSERT(!m_pendingSyncBackingStores.contains(layer)); 475 m_pendingSyncBackingStores.add(layer, 0); 431 RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.take(graphicsLayer); 432 if (!backingStore) 433 return; 434 435 toGraphicsLayerTextureMapper(graphicsLayer)->setBackingStore(0); 476 436 } 477 437 478 438 void LayerTreeRenderer::resetBackingStoreSizeToLayerSize(GraphicsLayer* graphicsLayer) 479 439 { 480 CoordinatedBackingStore* backingStore = getBackingStore(graphicsLayer);440 RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(graphicsLayer); 481 441 ASSERT(backingStore); 482 442 backingStore->setSize(graphicsLayer->size()); … … 486 446 { 487 447 GraphicsLayer* layer = layerByID(layerID); 488 CoordinatedBackingStore* backingStore = getBackingStore(layer);448 RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer); 489 449 ASSERT(backingStore); 490 450 backingStore->createTile(tileID, scale); … … 495 455 { 496 456 GraphicsLayer* layer = layerByID(layerID); 497 CoordinatedBackingStore* backingStore = getBackingStore(layer);457 RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer); 498 458 if (!backingStore) 499 459 return; … … 507 467 { 508 468 GraphicsLayer* layer = layerByID(layerID); 509 RefPtr<CoordinatedBackingStore> backingStore = getBackingStore(layer);469 RefPtr<CoordinatedBackingStore> backingStore = m_backingStores.get(layer); 510 470 ASSERT(backingStore); 511 471 backingStore->updateTile(tileID, update.sourceRect, update.tileRect, update.surface, update.offset); … … 578 538 579 539 m_backingStoresWithPendingBuffers.clear(); 580 581 {582 BackingStoreMap::iterator end = m_pendingSyncBackingStores.end();583 BackingStoreMap::iterator it = m_pendingSyncBackingStores.begin();584 for (;it != end; ++it)585 it->key->setBackingStore(it->value);586 587 m_pendingSyncBackingStores.clear();588 }589 540 } 590 541 … … 646 597 void LayerTreeRenderer::purgeGLResources() 647 598 { 648 TextureMapperLayer* layer = toTextureMapperLayer(rootLayer());649 650 if (layer)651 layer->clearBackingStoresRecursive();652 653 599 m_imageBackings.clear(); 600 m_releasedImageBackings.clear(); 654 601 #if USE(GRAPHICS_SURFACE) 655 602 m_surfaceBackingStores.clear(); … … 661 608 m_fixedLayers.clear(); 662 609 m_textureMapper.clear(); 663 m_ pendingSyncBackingStores.clear();610 m_backingStores.clear(); 664 611 m_backingStoresWithPendingBuffers.clear(); 665 612 -
trunk/Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.h
r141065 r141232 154 154 void commitPendingBackingStoreOperations(); 155 155 156 CoordinatedBackingStore* getBackingStore(WebCore::GraphicsLayer*);157 156 void prepareContentBackingStore(WebCore::GraphicsLayer*); 158 157 void createBackingStoreIfNeeded(WebCore::GraphicsLayer*); … … 173 172 Vector<RefPtr<CoordinatedBackingStore> > m_releasedImageBackings; 174 173 175 typedef HashMap<WebCore:: TextureMapperLayer*, RefPtr<CoordinatedBackingStore> > BackingStoreMap;176 BackingStoreMap m_ pendingSyncBackingStores;174 typedef HashMap<WebCore::GraphicsLayer*, RefPtr<CoordinatedBackingStore> > BackingStoreMap; 175 BackingStoreMap m_backingStores; 177 176 178 177 HashSet<RefPtr<CoordinatedBackingStore> > m_backingStoresWithPendingBuffers;
Note: See TracChangeset
for help on using the changeset viewer.