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 "cc/layers/content_layer_client.h" | 5 #include "cc/layers/content_layer_client.h" |
6 #include "cc/layers/picture_layer.h" | 6 #include "cc/layers/picture_layer.h" |
7 #include "cc/output/copy_output_request.h" | 7 #include "cc/output/copy_output_request.h" |
8 #include "cc/playback/display_item_list.h" | 8 #include "cc/playback/display_item_list.h" |
9 #include "cc/playback/drawing_display_item.h" | 9 #include "cc/playback/drawing_display_item.h" |
10 #include "cc/test/layer_tree_pixel_test.h" | 10 #include "cc/test/layer_tree_pixel_test.h" |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 | 154 |
155 void DidCommitAndDrawFrame() override { | 155 void DidCommitAndDrawFrame() override { |
156 switch (layer_tree_host()->source_frame_number()) { | 156 switch (layer_tree_host()->source_frame_number()) { |
157 case 1: | 157 case 1: |
158 // We have done one frame, so the layer's content has been rastered. | 158 // We have done one frame, so the layer's content has been rastered. |
159 // Now we change the picture behind it to record something completely | 159 // Now we change the picture behind it to record something completely |
160 // different, but we give a smaller invalidation rect. The layer should | 160 // different, but we give a smaller invalidation rect. The layer should |
161 // only re-raster the stuff in the rect. If it doesn't do partial raster | 161 // only re-raster the stuff in the rect. If it doesn't do partial raster |
162 // it would re-raster the whole thing instead. | 162 // it would re-raster the whole thing instead. |
163 client_.set_blue_top(false); | 163 client_.set_blue_top(false); |
164 Finish(); | |
165 picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); | 164 picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); |
166 | 165 |
167 // Add a copy request to see what happened! | 166 // Add a copy request to see what happened! |
168 DoReadback(); | 167 DoReadback(); |
169 break; | 168 break; |
170 } | 169 } |
171 } | 170 } |
172 | 171 |
173 protected: | 172 protected: |
174 BlueYellowClient client_; | 173 BlueYellowClient client_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 PartialRaster_SingleThread_GpuRaster) { | 213 PartialRaster_SingleThread_GpuRaster) { |
215 RunRasterPixelTest( | 214 RunRasterPixelTest( |
216 false, GPU, picture_layer_, | 215 false, GPU, picture_layer_, |
217 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); | 216 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); |
218 } | 217 } |
219 | 218 |
220 } // namespace | 219 } // namespace |
221 } // namespace cc | 220 } // namespace cc |
222 | 221 |
223 #endif // !defined(OS_ANDROID) | 222 #endif // !defined(OS_ANDROID) |
OLD | NEW |