Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMappingTest.cpp

Issue 2511893002: Paint solid color background into both scrolling contents layer and graphics layer. (Closed)
Patch Set: Add Mac rebaselines. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 906 matching lines...) Expand 10 before | Expand all | Expand 10 after
917 document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true); 917 document().frame()->settings()->setPreferCompositingToLCDTextEnabled(true);
918 setBodyInnerHTML( 918 setBodyInnerHTML(
919 "<div id='container' style='overflow: scroll; width: 300px; height: " 919 "<div id='container' style='overflow: scroll; width: 300px; height: "
920 "300px; border-radius: 5px; background: white; will-change: transform;'>" 920 "300px; border-radius: 5px; background: white; will-change: transform;'>"
921 " <div style='background-color: blue; width: 2000px; height: " 921 " <div style='background-color: blue; width: 2000px; height: "
922 "2000px;'></div>" 922 "2000px;'></div>"
923 "</div>"); 923 "</div>");
924 924
925 PaintLayer* layer = 925 PaintLayer* layer =
926 toLayoutBlock(getLayoutObjectByElementId("container"))->layer(); 926 toLayoutBlock(getLayoutObjectByElementId("container"))->layer();
927 EXPECT_TRUE(layer->canPaintBackgroundOntoScrollingContentsLayer()); 927 EXPECT_EQ(BackgroundPaintInScrollingContents,
928 layer->backgroundPaintLocation());
928 929
929 // We currently don't use composited scrolling when the container has a 930 // We currently don't use composited scrolling when the container has a
930 // border-radius so even though we can paint the background onto the scrolling 931 // border-radius so even though we can paint the background onto the scrolling
931 // contents layer we don't have a scrolling contents layer to paint into in 932 // contents layer we don't have a scrolling contents layer to paint into in
932 // this case. 933 // this case.
933 CompositedLayerMapping* mapping = layer->compositedLayerMapping(); 934 CompositedLayerMapping* mapping = layer->compositedLayerMapping();
934 EXPECT_FALSE(mapping->hasScrollingLayer()); 935 EXPECT_FALSE(mapping->hasScrollingLayer());
935 EXPECT_FALSE(mapping->backgroundPaintsOntoScrollingContentsLayer()); 936 EXPECT_FALSE(mapping->backgroundPaintsOntoScrollingContentsLayer());
936 } 937 }
937 938
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 document().view()->updateAllLifecyclePhases(); 1078 document().view()->updateAllLifecyclePhases();
1078 ASSERT_EQ(document().documentElement(), 1079 ASSERT_EQ(document().documentElement(),
1079 rootScrollerController.globalRootScroller()); 1080 rootScrollerController.globalRootScroller());
1080 1081
1081 EXPECT_TRUE(mapping3->clippingLayer()); 1082 EXPECT_TRUE(mapping3->clippingLayer());
1082 EXPECT_TRUE(mapping3->clippingLayer()->platformLayer()->masksToBounds()); 1083 EXPECT_TRUE(mapping3->clippingLayer()->platformLayer()->masksToBounds());
1083 } 1084 }
1084 } 1085 }
1085 1086
1086 } // namespace blink 1087 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698