Changeset 269204 in webkit
- Timestamp:
- Oct 30, 2020 1:27:23 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r269186 r269204 1 2020-10-30 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Replica layers don't blend correctly because computeOverlapRegions doesn't take TextureMapperPaintOptions::transform into account 4 https://bugs.webkit.org/show_bug.cgi?id=218307 5 6 Reviewed by Don Olmstead. 7 8 * compositing/reflections/opacity-in-reflection-expected.html: Added. 9 * compositing/reflections/opacity-in-reflection.html: Added. 10 1 11 2020-10-30 Chris Dumez <cdumez@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r269203 r269204 1 2020-10-30 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [TextureMapper] Replica layers don't blend correctly because computeOverlapRegions doesn't take TextureMapperPaintOptions::transform into account 4 https://bugs.webkit.org/show_bug.cgi?id=218307 5 6 Reviewed by Don Olmstead. 7 8 Blending in replica layers didn't work as expected because 9 computeOverlapRegions didn't take the transform of 10 TextureMapperPaintOptions into account. Rendering replica layers 11 are achieved by using the transform. 12 13 TextureMapperLayer::paintWithIntermediateSurface also should take 14 the transform. commitSurface no longer needs to transform by it. 15 16 Test: compositing/reflections/opacity-in-reflection.html 17 18 * platform/graphics/texmap/TextureMapperLayer.cpp: 19 (WebCore::TextureMapperLayer::computeOverlapRegions): 20 (WebCore::TextureMapperLayer::paintUsingOverlapRegions): 21 (WebCore::commitSurface): 22 (WebCore::TextureMapperLayer::paintWithIntermediateSurface): 23 * platform/graphics/texmap/TextureMapperLayer.h: 24 1 25 2020-10-30 Chris Dumez <cdumez@apple.com> 2 26 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
r269116 r269204 326 326 } 327 327 328 void TextureMapperLayer::computeOverlapRegions( Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode mode)328 void TextureMapperLayer::computeOverlapRegions(const TextureMapperPaintOptions& options, Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode mode) 329 329 { 330 330 if (!m_state.visible || !m_state.contentsVisible) … … 345 345 } 346 346 347 TransformationMatrix transform; 348 transform.multiply(options.transform); 349 transform.multiply(m_layerTransforms.combined); 350 347 351 TransformationMatrix replicaMatrix; 348 352 if (m_state.replicaLayer) { … … 351 355 } 352 356 353 boundingRect = m_layerTransforms.combined.mapRect(boundingRect);357 boundingRect = transform.mapRect(boundingRect); 354 358 355 359 // Count all masks and filters as overlap layers. … … 366 370 if (!m_state.masksToBounds) { 367 371 for (auto* child : m_children) 368 child->computeOverlapRegions( newOverlapRegion, newNonOverlapRegion, ResolveSelfOverlapIfNeeded);372 child->computeOverlapRegions(options, newOverlapRegion, newNonOverlapRegion, ResolveSelfOverlapIfNeeded); 369 373 } 370 374 … … 388 392 Region overlapRegion; 389 393 Region nonOverlapRegion; 390 computeOverlapRegions(o verlapRegion, nonOverlapRegion, ResolveSelfOverlapAlways);394 computeOverlapRegions(options, overlapRegion, nonOverlapRegion, ResolveSelfOverlapAlways); 391 395 if (overlapRegion.isEmpty()) { 392 396 paintSelfAndChildrenWithReplica(options); … … 461 465 static void commitSurface(const TextureMapperPaintOptions& options, BitmapTexture& surface, const IntRect& rect, float opacity) 462 466 { 467 IntRect targetRect(rect); 468 targetRect.move(options.offset); 463 469 options.textureMapper.bindSurface(options.surface.get()); 464 TransformationMatrix targetTransform; 465 targetTransform.translate(options.offset.width(), options.offset.height()); 466 targetTransform.multiply(options.transform); 467 options.textureMapper.drawTexture(surface, rect, targetTransform, opacity); 470 options.textureMapper.drawTexture(surface, targetRect, { }, opacity); 468 471 } 469 472 … … 472 475 TextureMapperPaintOptions paintOptions(options); 473 476 paintOptions.surface = options.textureMapper.acquireTextureFromPool(rect.size(), BitmapTexture::SupportsAlpha); 474 paintOptions.offset = - IntSize(rect.x(), rect.y());477 paintOptions.offset = -toIntSize(rect.location()); 475 478 paintOptions.opacity = 1; 476 paintOptions.transform = TransformationMatrix();477 479 if (m_state.replicaLayer) { 478 480 paintOptions.isReplica = true; 479 paintOptions.transform = replicaTransform();481 paintOptions.transform.multiply(replicaTransform()); 480 482 paintIntoSurface(paintOptions); 481 483 paintOptions.isReplica = false; 482 paintOptions.transform = TransformationMatrix();484 paintOptions.transform = options.transform; 483 485 if (m_state.replicaLayer->m_state.maskLayer) 484 486 m_state.replicaLayer->m_state.maskLayer->applyMask(paintOptions); -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperLayer.h
r269116 r269204 128 128 ResolveSelfOverlapIfNeeded 129 129 }; 130 void computeOverlapRegions( Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode);130 void computeOverlapRegions(const TextureMapperPaintOptions&, Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode); 131 131 132 132 void paintRecursive(const TextureMapperPaintOptions&);
Note: See TracChangeset
for help on using the changeset viewer.