| 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/LocalFrameView.h" | 7 #include "core/frame/LocalFrameView.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 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 mapping = paint_layer->GetCompositedLayerMapping(); | 914 mapping = paint_layer->GetCompositedLayerMapping(); |
| 915 EXPECT_FALSE(mapping->DecorationOutlineLayer()); | 915 EXPECT_FALSE(mapping->DecorationOutlineLayer()); |
| 916 } | 916 } |
| 917 | 917 |
| 918 TEST_P(CompositedLayerMappingTest, | 918 TEST_P(CompositedLayerMappingTest, |
| 919 BackgroundPaintedIntoGraphicsLayerIfNotCompositedScrolling) { | 919 BackgroundPaintedIntoGraphicsLayerIfNotCompositedScrolling) { |
| 920 GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled( | 920 GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled( |
| 921 true); | 921 true); |
| 922 SetBodyInnerHTML( | 922 SetBodyInnerHTML( |
| 923 "<div id='container' style='overflow: scroll; width: 300px; height: " | 923 "<div id='container' style='overflow: scroll; width: 300px; height: " |
| 924 "300px; border-radius: 5px; background: white; will-change: transform;'>" | 924 "300px; background: white; will-change: transform;'>" |
| 925 " <div style='background-color: blue; width: 2000px; height: " | 925 " <div style='background-color: blue; clip-path: circle(600px at " |
| 926 "1000px 1000px); width: 2000px; height: " |
| 926 "2000px;'></div>" | 927 "2000px;'></div>" |
| 927 "</div>"); | 928 "</div>"); |
| 928 | 929 |
| 929 PaintLayer* layer = | 930 PaintLayer* layer = |
| 930 ToLayoutBlock(GetLayoutObjectByElementId("container"))->Layer(); | 931 ToLayoutBlock(GetLayoutObjectByElementId("container"))->Layer(); |
| 931 EXPECT_EQ(kBackgroundPaintInScrollingContents, | 932 EXPECT_EQ(kBackgroundPaintInScrollingContents, |
| 932 layer->GetBackgroundPaintLocation()); | 933 layer->GetBackgroundPaintLocation()); |
| 933 | 934 |
| 934 // We currently don't use composited scrolling when the container has a | 935 // We currently don't use composited scrolling when the container has a |
| 935 // border-radius so even though we can paint the background onto the scrolling | 936 // border-radius so even though we can paint the background onto the scrolling |
| (...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1867 ASSERT_TRUE(target && target->IsBox()); | 1868 ASSERT_TRUE(target && target->IsBox()); |
| 1868 PaintLayer* target_layer = ToLayoutBox(target)->Layer(); | 1869 PaintLayer* target_layer = ToLayoutBox(target)->Layer(); |
| 1869 GraphicsLayer* target_graphics_layer = | 1870 GraphicsLayer* target_graphics_layer = |
| 1870 target_layer ? target_layer->GraphicsLayerBacking() : nullptr; | 1871 target_layer ? target_layer->GraphicsLayerBacking() : nullptr; |
| 1871 ASSERT_TRUE(target_graphics_layer); | 1872 ASSERT_TRUE(target_graphics_layer); |
| 1872 EXPECT_TRUE( | 1873 EXPECT_TRUE( |
| 1873 target_graphics_layer->ContentLayer()->TransformedRasterizationAllowed()); | 1874 target_graphics_layer->ContentLayer()->TransformedRasterizationAllowed()); |
| 1874 } | 1875 } |
| 1875 | 1876 |
| 1876 } // namespace blink | 1877 } // namespace blink |
| OLD | NEW |