Changeset 270071 in webkit
- Timestamp:
- Nov 19, 2020 11:26:50 PM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r270070 r270071 1 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Remove m_textureMapper from TextureMapperLayer 4 https://bugs.webkit.org/show_bug.cgi?id=219191 5 6 Reviewed by Carlos Garcia Campos. 7 8 TextureMapperLayer had m_textureMapper to get the TextureMapper 9 pointer. However, it was used only by the root layer. The child 10 layers needed to traverse up to the root layer to get the 11 TextureMapper pointer. It's more efficient to pass TextureMapper 12 reference as an argument. 13 14 No behavior changes. 15 16 * platform/graphics/texmap/BitmapTexture.cpp: 17 (WebCore::BitmapTexture::updateContents): 18 * platform/graphics/texmap/BitmapTexture.h: 19 * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: 20 (WebCore::GraphicsLayerTextureMapper::flushCompositingState): 21 (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): 22 (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded): 23 * platform/graphics/texmap/GraphicsLayerTextureMapper.h: 24 * platform/graphics/texmap/TextureMapperLayer.cpp: 25 (WebCore::TextureMapperLayer::paint): 26 * platform/graphics/texmap/TextureMapperLayer.h: 27 * platform/graphics/texmap/TextureMapperTile.cpp: 28 (WebCore::TextureMapperTile::updateContents): 29 1 30 2020-11-19 Zalan Bujtas <zalan@apple.com> 2 31 -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.cpp
r269323 r270071 35 35 namespace WebCore { 36 36 37 void BitmapTexture::updateContents( TextureMapper&,GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, float scale)37 void BitmapTexture::updateContents(GraphicsLayer* sourceLayer, const IntRect& targetRect, const IntPoint& offset, float scale) 38 38 { 39 39 // Making an unconditionally unaccelerated buffer here is OK because this code -
trunk/Source/WebCore/platform/graphics/texmap/BitmapTexture.h
r229895 r270071 61 61 virtual IntSize size() const = 0; 62 62 virtual void updateContents(Image*, const IntRect&, const IntPoint& offset) = 0; 63 v irtual void updateContents(TextureMapper&,GraphicsLayer*, const IntRect& target, const IntPoint& offset, float scale = 1);63 void updateContents(GraphicsLayer*, const IntRect& target, const IntPoint& offset, float scale = 1); 64 64 virtual void updateContents(const void*, const IntRect& target, const IntPoint& offset, int bytesPerLine) = 0; 65 65 virtual bool isValid() const = 0; -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r269838 r270071 508 508 void GraphicsLayerTextureMapper::flushCompositingState(const FloatRect& rect) 509 509 { 510 if (!m_layer.textureMapper())511 return;512 513 510 flushCompositingStateForThisLayerOnly(); 514 511 … … 527 524 } 528 525 529 void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers() 530 { 531 if (!m_layer.textureMapper()) 532 return; 533 534 updateBackingStoreIfNeeded(); 526 void GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers(TextureMapper& textureMapper) 527 { 528 updateBackingStoreIfNeeded(textureMapper); 535 529 536 530 if (maskLayer()) 537 downcast<GraphicsLayerTextureMapper>(*maskLayer()).updateBackingStoreIfNeeded( );531 downcast<GraphicsLayerTextureMapper>(*maskLayer()).updateBackingStoreIfNeeded(textureMapper); 538 532 if (replicaLayer()) 539 downcast<GraphicsLayerTextureMapper>(*replicaLayer()).updateBackingStoreIncludingSubLayers( );533 downcast<GraphicsLayerTextureMapper>(*replicaLayer()).updateBackingStoreIncludingSubLayers(textureMapper); 540 534 for (auto& child : children()) 541 downcast<GraphicsLayerTextureMapper>(child.get()).updateBackingStoreIncludingSubLayers(); 542 } 543 544 void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded() 545 { 546 TextureMapper* textureMapper = m_layer.textureMapper(); 547 if (!textureMapper) 548 return; 549 535 downcast<GraphicsLayerTextureMapper>(child.get()).updateBackingStoreIncludingSubLayers(textureMapper); 536 } 537 538 void GraphicsLayerTextureMapper::updateBackingStoreIfNeeded(TextureMapper& textureMapper) 539 { 550 540 if (!shouldHaveBackingStore()) { 551 541 ASSERT(!m_backingStore); … … 563 553 564 554 dirtyRect.scale(pageScaleFactor() * deviceScaleFactor()); 565 m_backingStore->updateContents( *textureMapper, this, m_size, dirtyRect);555 m_backingStore->updateContents(textureMapper, this, m_size, dirtyRect); 566 556 567 557 m_needsDisplay = false; -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r269614 r270071 88 88 void flushCompositingStateForThisLayerOnly() override; 89 89 90 void updateBackingStoreIncludingSubLayers( );90 void updateBackingStoreIncludingSubLayers(TextureMapper&); 91 91 92 92 TextureMapperLayer& layer() { return m_layer; } … … 105 105 void commitLayerChanges(); 106 106 void updateDebugBorderAndRepaintCount(); 107 void updateBackingStoreIfNeeded( );107 void updateBackingStoreIfNeeded(TextureMapper&); 108 108 void prepareBackingStoreIfNeeded(); 109 109 bool shouldHaveBackingStore() const; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r269936 r270071 134 134 } 135 135 136 void TextureMapperLayer::paint( )136 void TextureMapperLayer::paint(TextureMapper& textureMapper) 137 137 { 138 138 computeTransformsRecursive(); 139 139 140 ASSERT(m_textureMapper); 141 TextureMapperPaintOptions options(*m_textureMapper); 140 TextureMapperPaintOptions options(textureMapper); 142 141 options.textureMapper.bindSurface(0); 143 142 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r269936 r270071 49 49 50 50 const Vector<TextureMapperLayer*>& children() const { return m_children; } 51 52 TextureMapper* textureMapper() const { return rootLayer().m_textureMapper; }53 void setTextureMapper(TextureMapper* texmap) { m_textureMapper = texmap; }54 51 55 52 #if !USE(COORDINATED_GRAPHICS) … … 104 101 bool descendantsOrSelfHaveRunningAnimations() const; 105 102 106 void paint( );103 void paint(TextureMapper&); 107 104 108 105 void addChild(TextureMapperLayer*); … … 215 212 216 213 State m_state; 217 TextureMapper* m_textureMapper { nullptr };218 214 Nicosia::Animations m_animations; 219 215 uint32_t m_id { 0 }; -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperTile.cpp
r229895 r270071 65 65 } 66 66 67 m_texture->updateContents( textureMapper,sourceLayer, targetRect, sourceOffset, scale);67 m_texture->updateContents(sourceLayer, targetRect, sourceOffset, scale); 68 68 } 69 69 -
trunk/Source/WebKit/ChangeLog
r270069 r270071 1 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Remove m_textureMapper from TextureMapperLayer 4 https://bugs.webkit.org/show_bug.cgi?id=219191 5 6 Reviewed by Carlos Garcia Campos. 7 8 * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp: 9 (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext): 10 (WebKit::CoordinatedGraphicsScene::ensureRootLayer): 11 * WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp: 12 (WebKit::LayerTreeHost::compositeLayersToContext): 13 (WebKit::LayerTreeHost::flushPendingLayerChanges): 14 (WebKit::LayerTreeHost::LayerTreeHost): 15 1 16 2020-11-19 Hoa Dinh <dvh@apple.com> 2 17 -
trunk/Source/WebKit/Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp
r269772 r270071 69 69 return; 70 70 71 currentRootLayer->setTextureMapper(m_textureMapper.get());72 71 bool sceneHasRunningAnimations = currentRootLayer->applyAnimationsRecursively(MonotonicTime::now()); 73 72 m_textureMapper->beginPainting(PaintFlags); … … 77 76 currentRootLayer->setTransform(matrix); 78 77 79 currentRootLayer->paint( );78 currentRootLayer->paint(*m_textureMapper); 80 79 m_fpsCounter.updateFPSAndDisplay(*m_textureMapper, clipRect.location(), matrix); 81 80 m_textureMapper->endClip(); … … 423 422 // The root layer should not have zero size, or it would be optimized out. 424 423 m_rootLayer->setSize(FloatSize(1.0, 1.0)); 425 426 ASSERT(m_textureMapper);427 m_rootLayer->setTextureMapper(m_textureMapper.get());428 424 } 429 425 -
trunk/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics/LayerTreeHostTextureMapper.cpp
r268075 r270071 68 68 69 69 m_textureMapper->beginPainting(); 70 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint( );70 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint(*m_textureMapper); 71 71 m_fpsCounter.updateFPSAndDisplay(*m_textureMapper); 72 72 m_textureMapper->endPainting(); … … 85 85 m_overlayCompositingLayer->flushCompositingState(FloatRect(FloatPoint(), m_rootLayer->size())); 86 86 87 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers( );87 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers(*m_textureMapper); 88 88 return true; 89 89 } … … 124 124 125 125 m_textureMapper = TextureMapperGL::create(); 126 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());127 126 } 128 127 -
trunk/Source/WebKitLegacy/win/ChangeLog
r269973 r270071 1 2020-11-19 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Remove m_textureMapper from TextureMapperLayer 4 https://bugs.webkit.org/show_bug.cgi?id=219191 5 6 Reviewed by Carlos Garcia Campos. 7 8 * WebCoreSupport/AcceleratedCompositingContext.cpp: 9 (AcceleratedCompositingContext::initialize): 10 (AcceleratedCompositingContext::compositeLayersToContext): 11 (AcceleratedCompositingContext::flushPendingLayerChanges): 12 1 13 2020-11-18 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
r269066 r270071 108 108 109 109 m_textureMapper = TextureMapperGL::create(); 110 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().setTextureMapper(m_textureMapper.get());111 110 112 111 scheduleLayerFlush(); … … 184 183 185 184 m_textureMapper->beginPainting(); 186 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint( );185 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).layer().paint(*m_textureMapper); 187 186 m_fpsCounter.updateFPSAndDisplay(*m_textureMapper); 188 187 m_textureMapper->endPainting(); … … 283 282 return false; 284 283 285 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers( );284 downcast<GraphicsLayerTextureMapper>(*m_rootLayer).updateBackingStoreIncludingSubLayers(*m_textureMapper); 286 285 return true; 287 286 }
Note: See TracChangeset
for help on using the changeset viewer.