Changeset 104728 in webkit
- Timestamp:
- Jan 11, 2012 11:49:40 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r104726 r104728 1 2012-01-11 No'am Rosenthal <noam.rosenthal@nokia.com> 2 3 [Qt][Texmap] LayoutTests/compositing/masks/masked-ancestor does not render correctly. 4 https://bugs.webkit.org/show_bug.cgi?id=75910 5 6 Reviewed by Simon Hausmann. 7 8 Handle the mask surface correctly when drawing in two passes. Also, improve the readability 9 of the code that decides whether to draw in two passes. 10 11 LayoutTests/compositing/masks/masked-ancestor.html tests this. 12 13 * platform/graphics/texmap/TextureMapperNode.cpp: 14 (WebCore::TextureMapperNode::computeAllTransforms): 15 (WebCore::TextureMapperNode::hasMoreThanOneTile): 16 (WebCore::TextureMapperNode::paintRecursive): 17 * platform/graphics/texmap/TextureMapperNode.h: 18 1 19 2012-01-11 Dmitry Titov <dimich@chromium.org> 2 20 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.cpp
r104447 r104728 113 113 computePerspectiveTransformIfNeeded(); 114 114 115 m_transforms.target = TransformationMatrix(m_parent ? m_parent->m_transforms.forDescendants : TransformationMatrix()).multiply(m_transforms.local); 115 TextureMapperNode* parent = m_parent ? m_parent : m_effectTarget; 116 m_transforms.target = TransformationMatrix(parent ? parent->m_transforms.forDescendants : TransformationMatrix()).multiply(m_transforms.local); 116 117 117 118 m_state.visible = m_state.backfaceVisibility || m_transforms.target.inverse().m33() >= 0; … … 120 121 121 122 // This transform is only applied if using a two-pass for the replica, because the transform needs to be adjusted to the size of the intermediate surface, insteaf of the size of the content layer. 122 if ( m_parent && m_parent->m_state.preserves3D)123 if (parent && parent->m_state.preserves3D) 123 124 m_transforms.centerZ = m_transforms.target.mapPoint(FloatPoint3D(m_size.width() / 2, m_size.height() / 2, 0)).z(); 124 125 … … 248 249 } 249 250 #endif 251 252 bool TextureMapperNode::hasMoreThanOneTile() const 253 { 254 int tiles = 0; 255 256 #if USE(TILED_BACKING_STORE) 257 if (m_state.tileOwnership == ExternallyManagedTiles) { 258 HashMap<int, ExternallyManagedTile>::const_iterator end = m_externallyManagedTiles.end(); 259 for (HashMap<int, ExternallyManagedTile>::const_iterator it = m_externallyManagedTiles.begin(); it != end; ++it) { 260 if (it->second.frontBuffer.texture) { 261 if (++tiles > 1) 262 return true; 263 } 264 } 265 266 return false; 267 } 268 #endif 269 270 for (size_t i = 0; i < m_ownedTiles.size(); ++i) { 271 if (m_ownedTiles[i].texture) { 272 if (++tiles > 1) 273 return true; 274 } 275 } 276 277 return false; 278 } 279 250 280 251 281 void TextureMapperNode::renderContent(TextureMapper* textureMapper, GraphicsLayer* layer) … … 516 546 options.opacity *= m_opacity; 517 547 RefPtr<BitmapTexture> surface; 518 const bool needsTwoPass = ((m_state.replicaLayer || m_state.maskLayer) && !m_children.isEmpty()) || (m_opacity < 0.99 && m_state.mightHaveOverlaps) || (m_opacity < 0.99 && m_state.replicaLayer); 548 549 bool hasReplica = m_state.replicaLayer; 550 bool hasMask = m_state.maskLayer; 551 bool needsBlending = m_opacity < 0.99 || hasMask; 552 bool paintsMoreThanOneTexture = !m_children.isEmpty() || hasMoreThanOneTile() || (hasMask && m_state.maskLayer->hasMoreThanOneTile()); 553 bool hasOverlaps = m_state.mightHaveOverlaps || hasReplica; 519 554 const IntSize viewportSize = options.textureMapper->viewportSize(); 555 bool needsTwoPass = ((hasReplica || hasMask) && paintsMoreThanOneTexture) || (needsBlending && hasOverlaps); 520 556 options.isSurface = false; 521 557 … … 531 567 RefPtr<BitmapTexture> maskSurface; 532 568 533 // The mask has to be adjusted to target coordinates.534 569 if (m_state.maskLayer) { 535 570 maskSurface = options.textureMapper->acquireTextureFromPool(options.textureMapper->viewportSize()); 536 571 options.textureMapper->bindSurface(maskSurface.get()); 537 options.textureMapper->drawTexture(*m_state.maskLayer->texture(), entireRect(), m_transforms.target, 1.0, 0); 572 TextureMapperPaintOptions optionsForMask(options); 573 optionsForMask.isSurface = true; 574 m_state.maskLayer->paintSelf(optionsForMask); 538 575 } 539 576 … … 548 585 if (!paintReflection(options, surface.get())) { 549 586 options.textureMapper->bindSurface(options.surface); 550 options.textureMapper->drawTexture(*surface.get(), viewportRect, TransformationMatrix(), options.opacity, 0);587 options.textureMapper->drawTexture(*surface.get(), viewportRect, TransformationMatrix(), options.opacity, maskSurface.get()); 551 588 } 552 589 -
trunk/Source/WebCore/platform/graphics/texmap/TextureMapperNode.h
r104447 r104728 207 207 bool hasOpacityAnimation() const; 208 208 bool hasTransformAnimation() const; 209 209 bool hasMoreThanOneTile() const; 210 210 struct TransformData { 211 211 TransformationMatrix target;
Note: See TracChangeset
for help on using the changeset viewer.