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

Side by Side Diff: third_party/WebKit/Source/web/PageOverlayTest.cpp

Issue 2751433002: [SPv2] Flatten property trees in PaintRecordBuilder into a single display list. (Closed)
Patch Set: none Created 3 years, 8 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 unified diff | Download patch
OLDNEW
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 WebRect rect(0, 0, viewportWidth, viewportHeight); 138 WebRect rect(0, 0, viewportWidth, viewportHeight);
139 139
140 // Paint the layer with a null canvas to get a display list, and then 140 // Paint the layer with a null canvas to get a display list, and then
141 // replay that onto the mock canvas for examination. 141 // replay that onto the mock canvas for examination.
142 IntRect intRect = rect; 142 IntRect intRect = rect;
143 graphicsLayer->paint(&intRect); 143 graphicsLayer->paint(&intRect);
144 144
145 PaintController& paintController = graphicsLayer->getPaintController(); 145 PaintController& paintController = graphicsLayer->getPaintController();
146 GraphicsContext graphicsContext(paintController); 146 GraphicsContext graphicsContext(paintController);
147 graphicsContext.beginRecording(intRect); 147 graphicsContext.beginRecording(intRect);
148 paintController.paintArtifact().replay(graphicsContext); 148 paintController.paintArtifact().replay(intRect, graphicsContext);
149 graphicsContext.endRecording()->playback(&canvas); 149 graphicsContext.endRecording()->playback(&canvas);
150 } 150 }
151 151
152 TEST_F(PageOverlayTest, PageOverlay_VisualRect) { 152 TEST_F(PageOverlayTest, PageOverlay_VisualRect) {
153 initialize(AcceleratedCompositing); 153 initialize(AcceleratedCompositing);
154 std::unique_ptr<PageOverlay> pageOverlay = createSolidYellowOverlay(); 154 std::unique_ptr<PageOverlay> pageOverlay = createSolidYellowOverlay();
155 pageOverlay->update(); 155 pageOverlay->update();
156 webViewImpl()->updateAllLifecyclePhases(); 156 webViewImpl()->updateAllLifecyclePhases();
157 EXPECT_EQ(LayoutRect(0, 0, viewportWidth, viewportHeight), 157 EXPECT_EQ(LayoutRect(0, 0, viewportWidth, viewportHeight),
158 pageOverlay->visualRect()); 158 pageOverlay->visualRect());
159 } 159 }
160 160
161 } // namespace 161 } // namespace
162 } // namespace blink 162 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698