| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/frame/FrameView.h" | 5 #include "core/frame/FrameView.h" |
| 6 #include "core/layout/LayoutView.h" | 6 #include "core/layout/LayoutView.h" |
| 7 #include "core/layout/compositing/CompositedLayerMapping.h" | 7 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 8 #include "core/layout/compositing/PaintLayerCompositor.h" | 8 #include "core/layout/compositing/PaintLayerCompositor.h" |
| 9 #include "core/page/Page.h" | 9 #include "core/page/Page.h" |
| 10 #include "platform/graphics/CompositorMutableProperties.h" |
| 10 #include "platform/graphics/GraphicsLayer.h" | 11 #include "platform/graphics/GraphicsLayer.h" |
| 11 #include "platform/testing/URLTestHelpers.h" | 12 #include "platform/testing/URLTestHelpers.h" |
| 12 #include "public/platform/Platform.h" | 13 #include "public/platform/Platform.h" |
| 13 #include "public/platform/WebCompositorMutableProperties.h" | |
| 14 #include "public/platform/WebLayer.h" | 14 #include "public/platform/WebLayer.h" |
| 15 #include "public/platform/WebLayerTreeView.h" | 15 #include "public/platform/WebLayerTreeView.h" |
| 16 #include "public/platform/WebUnitTestSupport.h" | 16 #include "public/platform/WebUnitTestSupport.h" |
| 17 #include "public/web/WebSettings.h" | 17 #include "public/web/WebSettings.h" |
| 18 #include "public/web/WebViewClient.h" | 18 #include "public/web/WebViewClient.h" |
| 19 #include "web/WebLocalFrameImpl.h" | 19 #include "web/WebLocalFrameImpl.h" |
| 20 #include "web/WebViewImpl.h" | 20 #include "web/WebViewImpl.h" |
| 21 #include "web/tests/FrameTestHelpers.h" | 21 #include "web/tests/FrameTestHelpers.h" |
| 22 #include <gtest/gtest.h> | 22 #include <gtest/gtest.h> |
| 23 | 23 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 forceFullCompositingUpdate(); | 128 forceFullCompositingUpdate(); |
| 129 | 129 |
| 130 Document* document = frame()->document(); | 130 Document* document = frame()->document(); |
| 131 | 131 |
| 132 Element* tallElement = document->getElementById("tall"); | 132 Element* tallElement = document->getElementById("tall"); |
| 133 WebLayer* tallLayer = webLayerFromElement(tallElement); | 133 WebLayer* tallLayer = webLayerFromElement(tallElement); |
| 134 EXPECT_TRUE(!tallLayer); | 134 EXPECT_TRUE(!tallLayer); |
| 135 | 135 |
| 136 Element* proxiedElement = document->getElementById("proxied"); | 136 Element* proxiedElement = document->getElementById("proxied"); |
| 137 WebLayer* proxiedLayer = webLayerFromElement(proxiedElement); | 137 WebLayer* proxiedLayer = webLayerFromElement(proxiedElement); |
| 138 EXPECT_TRUE(proxiedLayer->compositorMutableProperties() & WebCompositorMutab
lePropertyTransform); | 138 EXPECT_TRUE(proxiedLayer->compositorMutableProperties() & CompositorMutableP
roperty::kTransform); |
| 139 EXPECT_FALSE(proxiedLayer->compositorMutableProperties() & (WebCompositorMut
ablePropertyScrollLeft | WebCompositorMutablePropertyScrollTop | WebCompositorMu
tablePropertyOpacity)); | 139 EXPECT_FALSE(proxiedLayer->compositorMutableProperties() & (CompositorMutabl
eProperty::kScrollLeft | CompositorMutableProperty::kScrollTop | CompositorMutab
leProperty::kOpacity)); |
| 140 EXPECT_NE(0UL, proxiedLayer->elementId()); | 140 EXPECT_NE(0UL, proxiedLayer->elementId()); |
| 141 | 141 |
| 142 Element* scrollElement = document->getElementById("proxied-scroller"); | 142 Element* scrollElement = document->getElementById("proxied-scroller"); |
| 143 WebLayer* scrollLayer = scrollingWebLayerFromElement(scrollElement); | 143 WebLayer* scrollLayer = scrollingWebLayerFromElement(scrollElement); |
| 144 EXPECT_TRUE(scrollLayer->compositorMutableProperties() & (WebCompositorMutab
lePropertyScrollLeft | WebCompositorMutablePropertyScrollTop)); | 144 EXPECT_TRUE(scrollLayer->compositorMutableProperties() & (CompositorMutableP
roperty::kScrollLeft | CompositorMutableProperty::kScrollTop)); |
| 145 EXPECT_FALSE(scrollLayer->compositorMutableProperties() & (WebCompositorMuta
blePropertyTransform | WebCompositorMutablePropertyOpacity)); | 145 EXPECT_FALSE(scrollLayer->compositorMutableProperties() & (CompositorMutable
Property::kTransform | CompositorMutableProperty::kOpacity)); |
| 146 EXPECT_NE(0UL, scrollLayer->elementId()); | 146 EXPECT_NE(0UL, scrollLayer->elementId()); |
| 147 | 147 |
| 148 WebLayer* rootScrollLayer = getRootScrollLayer(); | 148 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 149 EXPECT_TRUE(rootScrollLayer->compositorMutableProperties() & (WebCompositorM
utablePropertyScrollLeft | WebCompositorMutablePropertyScrollTop)); | 149 EXPECT_TRUE(rootScrollLayer->compositorMutableProperties() & (CompositorMuta
bleProperty::kScrollLeft | CompositorMutableProperty::kScrollTop)); |
| 150 EXPECT_FALSE(rootScrollLayer->compositorMutableProperties() & (WebCompositor
MutablePropertyTransform | WebCompositorMutablePropertyOpacity)); | 150 EXPECT_FALSE(rootScrollLayer->compositorMutableProperties() & (CompositorMut
ableProperty::kTransform | CompositorMutableProperty::kOpacity)); |
| 151 | 151 |
| 152 EXPECT_NE(0UL, rootScrollLayer->elementId()); | 152 EXPECT_NE(0UL, rootScrollLayer->elementId()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 TEST_F(CompositorWorkerTest, noProxies) | 155 TEST_F(CompositorWorkerTest, noProxies) |
| 156 { | 156 { |
| 157 // This case is identical to compositor-proxy-basic, but no proxies have | 157 // This case is identical to compositor-proxy-basic, but no proxies have |
| 158 // actually been created. | 158 // actually been created. |
| 159 registerMockedHttpURLLoad("compositor-proxy-plumbing-no-proxies.html"); | 159 registerMockedHttpURLLoad("compositor-proxy-plumbing-no-proxies.html"); |
| 160 navigateTo(m_baseURL + "compositor-proxy-plumbing-no-proxies.html"); | 160 navigateTo(m_baseURL + "compositor-proxy-plumbing-no-proxies.html"); |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 WebLayer* scrollLayer = scrollingWebLayerFromElement(scrollElement); | 204 WebLayer* scrollLayer = scrollingWebLayerFromElement(scrollElement); |
| 205 EXPECT_FALSE(!!scrollLayer->compositorMutableProperties()); | 205 EXPECT_FALSE(!!scrollLayer->compositorMutableProperties()); |
| 206 EXPECT_EQ(0UL, scrollLayer->elementId()); | 206 EXPECT_EQ(0UL, scrollLayer->elementId()); |
| 207 | 207 |
| 208 WebLayer* rootScrollLayer = getRootScrollLayer(); | 208 WebLayer* rootScrollLayer = getRootScrollLayer(); |
| 209 EXPECT_FALSE(!!rootScrollLayer->compositorMutableProperties()); | 209 EXPECT_FALSE(!!rootScrollLayer->compositorMutableProperties()); |
| 210 EXPECT_EQ(0UL, rootScrollLayer->elementId()); | 210 EXPECT_EQ(0UL, rootScrollLayer->elementId()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace blink | 213 } // namespace blink |
| OLD | NEW |