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

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

Issue 1428643004: Repaint on interest rect change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@EnableSyncPaint
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/web/PageOverlay.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "config.h" 5 #include "config.h"
6 #include "web/PageOverlay.h" 6 #include "web/PageOverlay.h"
7 7
8 #include "core/frame/FrameView.h" 8 #include "core/frame/FrameView.h"
9 #include "core/layout/LayoutView.h" 9 #include "core/layout/LayoutView.h"
10 #include "platform/graphics/Color.h" 10 #include "platform/graphics/Color.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 EXPECT_CALL(canvas, onDrawRect(SkRect::MakeWH(viewportWidth, viewportHeight) , Property(&SkPaint::getColor, SK_ColorYELLOW))); 148 EXPECT_CALL(canvas, onDrawRect(SkRect::MakeWH(viewportWidth, viewportHeight) , Property(&SkPaint::getColor, SK_ColorYELLOW)));
149 149
150 GraphicsLayer* graphicsLayer = pageOverlay->graphicsLayer(); 150 GraphicsLayer* graphicsLayer = pageOverlay->graphicsLayer();
151 WebRect rect(0, 0, viewportWidth, viewportHeight); 151 WebRect rect(0, 0, viewportWidth, viewportHeight);
152 152
153 // Paint the layer with a null canvas to get a display list, and then 153 // Paint the layer with a null canvas to get a display list, and then
154 // replay that onto the mock canvas for examination. 154 // replay that onto the mock canvas for examination.
155 PaintController* paintController = graphicsLayer->paintController(); 155 PaintController* paintController = graphicsLayer->paintController();
156 ASSERT(paintController); 156 ASSERT(paintController);
157 GraphicsContext graphicsContext(*paintController); 157 GraphicsContext graphicsContext(*paintController);
158 graphicsLayer->paint(graphicsContext, rect); 158 IntRect intRect = rect;
159 graphicsLayer->paint(graphicsContext, &intRect);
159 160
160 graphicsContext.beginRecording(IntRect(rect)); 161 graphicsContext.beginRecording(intRect);
161 paintController->commitNewDisplayItems(); 162 paintController->commitNewDisplayItems();
162 paintController->paintArtifact().replay(graphicsContext); 163 paintController->paintArtifact().replay(graphicsContext);
163 graphicsContext.endRecording()->playback(&canvas); 164 graphicsContext.endRecording()->playback(&canvas);
164 } 165 }
165 166
166 TEST_F(PageOverlayTest, SimpleCanvasOverlay_AcceleratedCompositing) 167 TEST_F(PageOverlayTest, SimpleCanvasOverlay_AcceleratedCompositing)
167 { 168 {
168 runPageOverlayTestWithAcceleratedCompositing<SimpleCanvasOverlay>(); 169 runPageOverlayTestWithAcceleratedCompositing<SimpleCanvasOverlay>();
169 } 170 }
170 171
171 TEST_F(PageOverlayTest, PrivateGraphicsContextOverlay_AcceleratedCompositing) 172 TEST_F(PageOverlayTest, PrivateGraphicsContextOverlay_AcceleratedCompositing)
172 { 173 {
173 runPageOverlayTestWithAcceleratedCompositing<PrivateGraphicsContextOverlay>( ); 174 runPageOverlayTestWithAcceleratedCompositing<PrivateGraphicsContextOverlay>( );
174 } 175 }
175 176
176 } // namespace 177 } // namespace
177 } // namespace blink 178 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/PageOverlay.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698