Changeset 116195 in webkit
- Timestamp:
- May 4, 2012 5:38:03 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r116194 r116195 1 2012-05-04 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Changes to layer tree structure need to be tracked properly 4 https://bugs.webkit.org/show_bug.cgi?id=85421 5 6 Reviewed by Adrienne Walker. 7 8 Unit test added: TreeSynchronizerTest.syncSimpleTreeAndTrackStackingOrderChange 9 10 Earlier, we were relying on WebCore behavior that always called 11 setNeedsDisplay whenever the layer tree structure changed. 12 However, in general it is more correct to consider layer tree 13 changes even when things don't need repainting; for example Aura 14 code is encountring this bug now. This patch corrects the 15 compositor so that layer tree structural changes are considered 16 property changes, without requiring that layers needed to be 17 repainted. 18 19 * platform/graphics/chromium/LayerChromium.cpp: 20 (WebCore::LayerChromium::LayerChromium): 21 (WebCore::LayerChromium::insertChild): 22 (WebCore::LayerChromium::pushPropertiesTo): 23 * platform/graphics/chromium/LayerChromium.h: 24 (LayerChromium): 25 * platform/graphics/chromium/cc/CCLayerImpl.cpp: 26 (WebCore::CCLayerImpl::setStackingOrderChanged): 27 (WebCore): 28 * platform/graphics/chromium/cc/CCLayerImpl.h: 29 (CCLayerImpl): 30 1 31 2012-05-04 Jeffrey Pfau <jpfau@apple.com> 2 32 -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
r116142 r116195 58 58 LayerChromium::LayerChromium() 59 59 : m_needsDisplay(false) 60 , m_stackingOrderChanged(false) 60 61 , m_layerId(s_nextLayerId++) 61 62 , m_parent(0) … … 154 155 child->removeFromParent(); 155 156 child->setParent(this); 157 child->m_stackingOrderChanged = true; 156 158 m_children.insert(index, child); 157 159 setNeedsCommit(); … … 515 517 layer->setSentScrollDelta(IntSize()); 516 518 519 layer->setStackingOrderChanged(m_stackingOrderChanged); 520 517 521 if (maskLayer()) 518 522 maskLayer()->pushPropertiesTo(layer->maskLayer()); … … 523 527 524 528 // Reset any state that should be cleared for the next update. 529 m_stackingOrderChanged = false; 525 530 m_updateRect = FloatRect(); 526 531 } -
trunk/Source/WebCore/platform/graphics/chromium/LayerChromium.h
r116142 r116195 265 265 bool m_needsDisplay; 266 266 267 // Tracks whether this layer may have changed stacking order with its siblings. 268 bool m_stackingOrderChanged; 269 267 270 // The update rect is the region of the compositor resource that was actually updated by the compositor. 268 271 // For layers that may do updating outside the compositor's control (i.e. plugin layers), this information -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
r116142 r116195 266 266 } 267 267 268 void CCLayerImpl::setStackingOrderChanged(bool stackingOrderChanged) 269 { 270 // We don't need to store this flag; we only need to track that the change occurred. 271 if (stackingOrderChanged) 272 noteLayerPropertyChangedForSubtree(); 273 } 274 268 275 void CCLayerImpl::noteLayerPropertyChangedForSubtree() 269 276 { -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
r116142 r116195 230 230 String layerTreeAsText() const; 231 231 232 void setStackingOrderChanged(bool); 233 232 234 bool layerPropertyChanged() const { return m_layerPropertyChanged; } 233 235 void resetAllChangeTrackingForSubtree(); -
trunk/Source/WebKit/chromium/ChangeLog
r116190 r116195 1 2012-05-04 Shawn Singh <shawnsingh@chromium.org> 2 3 [chromium] Changes to layer tree structure need to be tracked properly 4 https://bugs.webkit.org/show_bug.cgi?id=85421 5 6 Reviewed by Adrienne Walker. 7 8 Unit test added: TreeSynchronizerTest.syncSimpleTreeAndTrackStackingOrderChange 9 10 * tests/TreeSynchronizerTest.cpp: 11 (WebKitTests): 12 (WebKitTests::TEST): 13 1 14 2012-05-04 Tony Chang <tony@chromium.org> 2 15 -
trunk/Source/WebKit/chromium/tests/TreeSynchronizerTest.cpp
r114808 r116195 198 198 } 199 199 200 // Constructs a very simple tree and checks that a stacking-order change is tracked properly. 201 TEST(TreeSynchronizerTest, syncSimpleTreeAndTrackStackingOrderChange) 202 { 203 DebugScopedSetImplThread impl; 204 Vector<int> ccLayerDestructionList; 205 206 // Set up the tree and sync once. child2 needs to be synced here, too, even though we 207 // remove it to set up the intended scenario. 208 RefPtr<LayerChromium> layerTreeRoot = MockLayerChromium::create(&ccLayerDestructionList); 209 RefPtr<LayerChromium> child2 = MockLayerChromium::create(&ccLayerDestructionList); 210 layerTreeRoot->addChild(MockLayerChromium::create(&ccLayerDestructionList)); 211 layerTreeRoot->addChild(child2); 212 OwnPtr<CCLayerImpl> ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), nullptr); 213 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 214 ccLayerTreeRoot->resetAllChangeTrackingForSubtree(); 215 216 // re-insert the layer and sync again. 217 child2->removeFromParent(); 218 layerTreeRoot->addChild(child2); 219 ccLayerTreeRoot = TreeSynchronizer::synchronizeTrees(layerTreeRoot.get(), ccLayerTreeRoot.release()); 220 expectTreesAreIdentical(layerTreeRoot.get(), ccLayerTreeRoot.get()); 221 222 // Check that the impl thread properly tracked the change. 223 EXPECT_FALSE(ccLayerTreeRoot->layerPropertyChanged()); 224 EXPECT_FALSE(ccLayerTreeRoot->children()[0]->layerPropertyChanged()); 225 EXPECT_TRUE(ccLayerTreeRoot->children()[1]->layerPropertyChanged()); 226 } 227 200 228 TEST(TreeSynchronizerTest, syncSimpleTreeAndProperties) 201 229 {
Note: See TracChangeset
for help on using the changeset viewer.