Changeset 269116 in webkit
- Timestamp:
- Oct 28, 2020 1:01:28 PM (3 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r269110 r269116 1 2020-10-28 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 TextureMapperLayer::paintWithIntermediateSurface: Reduce BitmapTextures by unifying replicaSurface and mainSurface 4 https://bugs.webkit.org/show_bug.cgi?id=217943 5 6 Reviewed by Don Olmstead. 7 8 TextureMapperLayer::paintWithIntermediateSurface was using two 9 BitmapTextures for the main layer and replica layer. But, a single 10 BitmapTexture suffices. Create a BitmapTexture and render both 11 layers onto it. 12 13 No new tests, no behavior changes. 14 15 * platform/graphics/texmap/TextureMapperLayer.cpp: 16 (WebCore::TextureMapperLayer::paintIntoSurface): 17 (WebCore::TextureMapperLayer::paintWithIntermediateSurface): 18 * platform/graphics/texmap/TextureMapperLayer.h: 19 1 20 2020-10-28 Zalan Bujtas <zalan@apple.com> 2 21 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r269072 r269116 444 444 } 445 445 446 RefPtr<BitmapTexture> TextureMapperLayer::paintIntoSurface(const TextureMapperPaintOptions& options, const IntSize& size) 447 { 448 RefPtr<BitmapTexture> surface = options.textureMapper.acquireTextureFromPool(size, BitmapTexture::SupportsAlpha); 449 TextureMapperPaintOptions paintOptions(options); 450 paintOptions.surface = surface; 451 options.textureMapper.bindSurface(surface.get()); 446 void TextureMapperLayer::paintIntoSurface(TextureMapperPaintOptions& options) 447 { 448 options.textureMapper.bindSurface(options.surface.get()); 452 449 if (m_isBackdrop) { 450 TextureMapperPaintOptions paintOptions(options); 453 451 paintOptions.backdropLayer = this; 454 452 rootLayer().paintSelfAndChildren(paintOptions); 455 paintOptions.backdropLayer = nullptr;456 453 } else 457 paintSelfAndChildren( paintOptions);454 paintSelfAndChildren(options); 458 455 if (m_state.maskLayer) 459 456 m_state.maskLayer->applyMask(options); 460 surface = surface->applyFilters(options.textureMapper, m_currentFilters); 461 options.textureMapper.bindSurface(surface.get()); 462 return surface; 457 options.surface = options.surface->applyFilters(options.textureMapper, m_currentFilters); 458 options.textureMapper.bindSurface(options.surface.get()); 463 459 } 464 460 … … 474 470 void TextureMapperLayer::paintWithIntermediateSurface(const TextureMapperPaintOptions& options, const IntRect& rect) 475 471 { 476 RefPtr<BitmapTexture> replicaSurface;477 RefPtr<BitmapTexture> mainSurface;478 472 TextureMapperPaintOptions paintOptions(options); 473 paintOptions.surface = options.textureMapper.acquireTextureFromPool(rect.size(), BitmapTexture::SupportsAlpha); 479 474 paintOptions.offset = -IntSize(rect.x(), rect.y()); 480 475 paintOptions.opacity = 1; … … 483 478 paintOptions.isReplica = true; 484 479 paintOptions.transform = replicaTransform(); 485 replicaSurface = paintIntoSurface(paintOptions, rect.size());480 paintIntoSurface(paintOptions); 486 481 paintOptions.isReplica = false; 487 482 paintOptions.transform = TransformationMatrix(); … … 490 485 } 491 486 492 if (replicaSurface && options.opacity == 1) {493 commitSurface(options, *replicaSurface, rect, 1);494 replicaSurface = nullptr;495 }496 497 487 if (m_isBackdrop && m_effectTarget->m_state.replicaLayer && options.isReplica) 498 488 paintOptions.transform = m_effectTarget->replicaTransform(); 499 489 500 mainSurface = paintIntoSurface(paintOptions, rect.size()); 501 if (replicaSurface) { 502 options.textureMapper.bindSurface(replicaSurface.get()); 503 options.textureMapper.drawTexture(*mainSurface.get(), FloatRect(FloatPoint::zero(), rect.size())); 504 mainSurface = replicaSurface; 505 } 506 507 commitSurface(options, *mainSurface, rect, options.opacity); 490 paintIntoSurface(paintOptions); 491 492 commitSurface(options, *paintOptions.surface, rect, options.opacity); 508 493 } 509 494 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r269072 r269116 132 132 void paintRecursive(const TextureMapperPaintOptions&); 133 133 void paintUsingOverlapRegions(const TextureMapperPaintOptions&); 134 RefPtr<BitmapTexture> paintIntoSurface(const TextureMapperPaintOptions&, const IntSize&);134 void paintIntoSurface(TextureMapperPaintOptions&); 135 135 void paintWithIntermediateSurface(const TextureMapperPaintOptions&, const IntRect&); 136 136 void paintSelf(const TextureMapperPaintOptions&);
Note: See TracChangeset
for help on using the changeset viewer.