| 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(); |
| 164 picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); | 165 picture_layer_->SetNeedsDisplayRect(gfx::Rect(50, 50, 100, 100)); |
| 165 | 166 |
| 166 // Add a copy request to see what happened! | 167 // Add a copy request to see what happened! |
| 167 DoReadback(); | 168 DoReadback(); |
| 168 break; | 169 break; |
| 169 } | 170 } |
| 170 } | 171 } |
| 171 | 172 |
| 172 protected: | 173 protected: |
| 173 BlueYellowClient client_; | 174 BlueYellowClient client_; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 PartialRaster_SingleThread_GpuRaster) { | 214 PartialRaster_SingleThread_GpuRaster) { |
| 214 RunRasterPixelTest( | 215 RunRasterPixelTest( |
| 215 false, GPU, picture_layer_, | 216 false, GPU, picture_layer_, |
| 216 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); | 217 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); |
| 217 } | 218 } |
| 218 | 219 |
| 219 } // namespace | 220 } // namespace |
| 220 } // namespace cc | 221 } // namespace cc |
| 221 | 222 |
| 222 #endif // !defined(OS_ANDROID) | 223 #endif // !defined(OS_ANDROID) |
| OLD | NEW |