| 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 "web/PageOverlay.h" | 5 #include "web/PageOverlay.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "platform/graphics/Color.h" | 8 #include "platform/graphics/Color.h" |
| 9 #include "platform/graphics/GraphicsContext.h" | 9 #include "platform/graphics/GraphicsContext.h" |
| 10 #include "platform/graphics/paint/DrawingRecorder.h" | 10 #include "platform/graphics/paint/DrawingRecorder.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 void initialize(CompositingMode compositingMode) | 71 void initialize(CompositingMode compositingMode) |
| 72 { | 72 { |
| 73 m_helper.initialize( | 73 m_helper.initialize( |
| 74 false /* enableJavascript */, nullptr /* webFrameClient */, nullptr
/* webViewClient */, nullptr /* webWidgetClient */, | 74 false /* enableJavascript */, nullptr /* webFrameClient */, nullptr
/* webViewClient */, nullptr /* webWidgetClient */, |
| 75 compositingMode == AcceleratedCompositing ? enableAcceleratedComposi
ting : disableAcceleratedCompositing); | 75 compositingMode == AcceleratedCompositing ? enableAcceleratedComposi
ting : disableAcceleratedCompositing); |
| 76 webViewImpl()->resize(WebSize(viewportWidth, viewportHeight)); | 76 webViewImpl()->resize(WebSize(viewportWidth, viewportHeight)); |
| 77 webViewImpl()->updateAllLifecyclePhases(); | 77 webViewImpl()->updateAllLifecyclePhases(); |
| 78 ASSERT_EQ(compositingMode == AcceleratedCompositing, webViewImpl()->isAc
celeratedCompositingActive()); | 78 ASSERT_EQ(compositingMode == AcceleratedCompositing, webViewImpl()->isAc
celeratedCompositingActive()); |
| 79 } | 79 } |
| 80 | 80 |
| 81 WebViewImpl* webViewImpl() const { return m_helper.webViewImpl(); } | 81 WebViewImpl* webViewImpl() const { return m_helper.webView(); } |
| 82 | 82 |
| 83 std::unique_ptr<PageOverlay> createSolidYellowOverlay() | 83 std::unique_ptr<PageOverlay> createSolidYellowOverlay() |
| 84 { | 84 { |
| 85 return PageOverlay::create(webViewImpl(), new SolidColorOverlay(SK_Color
YELLOW)); | 85 return PageOverlay::create(webViewImpl(), new SolidColorOverlay(SK_Color
YELLOW)); |
| 86 } | 86 } |
| 87 | 87 |
| 88 template <typename OverlayType> | 88 template <typename OverlayType> |
| 89 void runPageOverlayTestWithAcceleratedCompositing(); | 89 void runPageOverlayTestWithAcceleratedCompositing(); |
| 90 | 90 |
| 91 private: | 91 private: |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 { | 143 { |
| 144 initialize(AcceleratedCompositing); | 144 initialize(AcceleratedCompositing); |
| 145 std::unique_ptr<PageOverlay> pageOverlay = createSolidYellowOverlay(); | 145 std::unique_ptr<PageOverlay> pageOverlay = createSolidYellowOverlay(); |
| 146 pageOverlay->update(); | 146 pageOverlay->update(); |
| 147 webViewImpl()->updateAllLifecyclePhases(); | 147 webViewImpl()->updateAllLifecyclePhases(); |
| 148 EXPECT_EQ(LayoutRect(0, 0, viewportWidth, viewportHeight), pageOverlay->visu
alRect()); | 148 EXPECT_EQ(LayoutRect(0, 0, viewportWidth, viewportHeight), pageOverlay->visu
alRect()); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| 152 } // namespace blink | 152 } // namespace blink |
| OLD | NEW |