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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp

Issue 1826013002: Enable compositing for opaque scrolling content on low DPI screens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add test and TODO for failure mode Created 4 years, 4 months 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..fc3f6a6f696805059d8727676fb722624dadc072
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableAreaTest.cpp
@@ -0,0 +1,49 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
chrishtr 2016/08/04 16:35:44 2016
Stephen Chennney 2016/08/04 17:35:25 Done.
chrishtr 2016/08/09 18:03:40 Still not done. Update the patchset?
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/paint/PaintLayerScrollableAreaTest.h"
+
+namespace blink {
+
+TEST_F(PaintLayerScrollableAreaTest, OpaqueLayersPromoted)
+{
+ RuntimeEnabledFeatures::setCompositeOpaqueScrollersEnabled(true);
+
+ setBodyInnerHTML(
+ "<style>"
+ "#scroller { overflow: scroll; height: 300px; width: 300px; background-color: rgb(0,128,0); }"
+ "#scrolled { height: 1000px; width: 250px; }"
+ "</style>"
+ "<div id=\"scroller\"><div id=\"scrolled\"></div></div>");
+ document().view()->updateAllLifecyclePhases();
+
+ ASSERT_TRUE(RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled());
+ Element* scroller = document().getElementById("scroller");
+ PaintLayer* paintLayer = toLayoutBoxModelObject(scroller->layoutObject())->layer();
+ ASSERT_TRUE(paintLayer);
+ DisableCompositingQueryAsserts compositingQueryEnabler;
chrishtr 2016/08/04 16:35:44 Why do you need this? The lifecycle should be up t
Stephen Chennney 2016/08/04 17:35:25 Artifact of an earlier iteration of the test. Gone
+ ASSERT_TRUE(paintLayer->needsCompositedScrolling());
+}
+
+TEST_F(PaintLayerScrollableAreaTest, TransparentLayersNotPromoted)
+{
+ RuntimeEnabledFeatures::setCompositeOpaqueScrollersEnabled(true);
+
+ setBodyInnerHTML(
+ "<style>"
+ "#scroller { overflow: scroll; height: 300px; width: 300px; background-color: rgba(0,128,0,0.5); }"
+ "#scrolled { height: 1000px; width: 250px; }"
+ "</style>"
+ "<div id=\"scroller\"><div id=\"scrolled\"></div></div>");
+ document().view()->updateAllLifecyclePhases();
+
+ ASSERT_TRUE(RuntimeEnabledFeatures::compositeOpaqueScrollersEnabled());
+ Element* scroller = document().getElementById("scroller");
+ PaintLayer* paintLayer = toLayoutBoxModelObject(scroller->layoutObject())->layer();
+ ASSERT_TRUE(paintLayer);
+ DisableCompositingQueryAsserts compositingQueryEnabler;
+ ASSERT_TRUE(!paintLayer->needsCompositedScrolling());
+}
+
+}

Powered by Google App Engine
This is Rietveld 408576698