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

Side by Side Diff: cc/trees/layer_tree_host_pixeltest_tiles.cc

Issue 2317753002: cc: Abstract the LayerTreeHost. (Closed)
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_readback.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer.h" 8 #include "cc/layers/picture_layer.h"
9 #include "cc/output/copy_output_request.h" 9 #include "cc/output/copy_output_request.h"
10 #include "cc/playback/display_item_list.h" 10 #include "cc/playback/display_item_list.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 : public LayerTreeHostTilesPixelTest { 152 : public LayerTreeHostTilesPixelTest {
153 public: 153 public:
154 LayerTreeHostTilesTestPartialInvalidation() 154 LayerTreeHostTilesTestPartialInvalidation()
155 : client_(gfx::Size(200, 200)), 155 : client_(gfx::Size(200, 200)),
156 picture_layer_(PictureLayer::Create(&client_)) { 156 picture_layer_(PictureLayer::Create(&client_)) {
157 picture_layer_->SetBounds(gfx::Size(200, 200)); 157 picture_layer_->SetBounds(gfx::Size(200, 200));
158 picture_layer_->SetIsDrawable(true); 158 picture_layer_->SetIsDrawable(true);
159 } 159 }
160 160
161 void DidCommitAndDrawFrame() override { 161 void DidCommitAndDrawFrame() override {
162 switch (layer_tree_host()->source_frame_number()) { 162 switch (layer_tree_host()->SourceFrameNumber()) {
163 case 1: 163 case 1:
164 // We have done one frame, so the layer's content has been rastered. 164 // We have done one frame, so the layer's content has been rastered.
165 // Now we change the picture behind it to record something completely 165 // Now we change the picture behind it to record something completely
166 // different, but we give a smaller invalidation rect. The layer should 166 // different, but we give a smaller invalidation rect. The layer should
167 // only re-raster the stuff in the rect. If it doesn't do partial raster 167 // only re-raster the stuff in the rect. If it doesn't do partial raster
168 // it would re-raster the whole thing instead. 168 // it would re-raster the whole thing instead.
169 client_.set_blue_top(false); 169 client_.set_blue_top(false);
170 Finish(); 170 Finish();
171 picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); 171 picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100));
172 172
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 FullRaster_SingleThread_GpuRaster) { 234 FullRaster_SingleThread_GpuRaster) {
235 RunRasterPixelTest( 235 RunRasterPixelTest(
236 false, FULL_GPU, picture_layer_, 236 false, FULL_GPU, picture_layer_,
237 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); 237 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png")));
238 } 238 }
239 239
240 } // namespace 240 } // namespace
241 } // namespace cc 241 } // namespace cc
242 242
243 #endif // !defined(OS_ANDROID) 243 #endif // !defined(OS_ANDROID)
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_pixeltest_readback.cc ('k') | cc/trees/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698