OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/layout/compositing/CompositedLayerMapping.h" | 5 #include "core/layout/compositing/CompositedLayerMapping.h" |
6 | 6 |
7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
8 #include "core/layout/LayoutBoxModelObject.h" | 8 #include "core/layout/LayoutBoxModelObject.h" |
9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
10 #include "core/layout/api/LayoutViewItem.h" | 10 #include "core/layout/api/LayoutViewItem.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 return CompositedLayerMapping::interestRectChangedEnoughToRepaint(previo
usInterestRect, newInterestRect, layerSize); | 40 return CompositedLayerMapping::interestRectChangedEnoughToRepaint(previo
usInterestRect, newInterestRect, layerSize); |
41 } | 41 } |
42 | 42 |
43 IntRect previousInterestRect(const GraphicsLayer* graphicsLayer) | 43 IntRect previousInterestRect(const GraphicsLayer* graphicsLayer) |
44 { | 44 { |
45 return graphicsLayer->m_previousInterestRect; | 45 return graphicsLayer->m_previousInterestRect; |
46 } | 46 } |
47 | 47 |
48 bool shouldPaintBackgroundOntoScrollingContentsLayer(const char* elementId) | 48 bool shouldPaintBackgroundOntoScrollingContentsLayer(const char* elementId) |
49 { | 49 { |
50 CompositedLayerMapping* mapping = toLayoutBlock(getLayoutObjectByElement
Id(elementId))->layer()->compositedLayerMapping(); | 50 PaintLayer* paintLayer = toLayoutBlock(getLayoutObjectByElementId(elemen
tId))->layer(); |
51 return mapping->shouldPaintBackgroundOntoScrollingContentsLayer(); | 51 return paintLayer->shouldPaintBackgroundOntoScrollingContentsLayer(); |
52 } | 52 } |
53 | 53 |
54 private: | 54 private: |
55 void SetUp() override | 55 void SetUp() override |
56 { | 56 { |
57 RenderingTest::SetUp(); | 57 RenderingTest::SetUp(); |
58 enableCompositing(); | 58 enableCompositing(); |
59 } | 59 } |
60 | 60 |
61 void TearDown() override | 61 void TearDown() override |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
653 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1")); | 653 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller1")); |
654 | 654 |
655 // Second scroller cannot paint background into scrolling contents layer bec
ause it has a content-box clip without local attachment. | 655 // Second scroller cannot paint background into scrolling contents layer bec
ause it has a content-box clip without local attachment. |
656 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2")); | 656 EXPECT_FALSE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller2")); |
657 | 657 |
658 // Third scroller can paint background into scrolling contents layer. | 658 // Third scroller can paint background into scrolling contents layer. |
659 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3")); | 659 EXPECT_TRUE(shouldPaintBackgroundOntoScrollingContentsLayer("scroller3")); |
660 } | 660 } |
661 | 661 |
662 } // namespace blink | 662 } // namespace blink |
OLD | NEW |