| 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/display_item_list_settings.h" | 9 #include "cc/playback/display_item_list_settings.h" |
| 10 #include "cc/playback/drawing_display_item.h" | 10 #include "cc/playback/drawing_display_item.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 class LayerTreeHostTilesTestPartialInvalidation | 144 class LayerTreeHostTilesTestPartialInvalidation |
| 145 : public LayerTreeHostTilesPixelTest { | 145 : public LayerTreeHostTilesPixelTest { |
| 146 public: | 146 public: |
| 147 LayerTreeHostTilesTestPartialInvalidation() | 147 LayerTreeHostTilesTestPartialInvalidation() |
| 148 : client_(gfx::Size(200, 200)), | 148 : client_(gfx::Size(200, 200)), |
| 149 picture_layer_(PictureLayer::Create(layer_settings(), &client_)) { | 149 picture_layer_(PictureLayer::Create(layer_settings(), &client_)) { |
| 150 picture_layer_->SetBounds(gfx::Size(200, 200)); | 150 picture_layer_->SetBounds(gfx::Size(200, 200)); |
| 151 picture_layer_->SetIsDrawable(true); | 151 picture_layer_->SetIsDrawable(true); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void InitializeSettings(LayerTreeSettings* settings) override { |
| 155 LayerTreeHostTilesPixelTest::InitializeSettings(settings); |
| 156 settings->enable_partial_raster = true; |
| 157 } |
| 158 |
| 154 void DidCommitAndDrawFrame() override { | 159 void DidCommitAndDrawFrame() override { |
| 155 switch (layer_tree_host()->source_frame_number()) { | 160 switch (layer_tree_host()->source_frame_number()) { |
| 156 case 1: | 161 case 1: |
| 157 // We have done one frame, so the layer's content has been rastered. | 162 // We have done one frame, so the layer's content has been rastered. |
| 158 // Now we change the picture behind it to record something completely | 163 // Now we change the picture behind it to record something completely |
| 159 // different, but we give a smaller invalidation rect. The layer should | 164 // different, but we give a smaller invalidation rect. The layer should |
| 160 // only re-raster the stuff in the rect. If it doesn't do partial raster | 165 // only re-raster the stuff in the rect. If it doesn't do partial raster |
| 161 // it would re-raster the whole thing instead. | 166 // it would re-raster the whole thing instead. |
| 162 client_.set_blue_top(false); | 167 client_.set_blue_top(false); |
| 163 Finish(); | 168 Finish(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 PartialRaster_SingleThread_GpuRaster) { | 218 PartialRaster_SingleThread_GpuRaster) { |
| 214 RunRasterPixelTest( | 219 RunRasterPixelTest( |
| 215 false, GPU, picture_layer_, | 220 false, GPU, picture_layer_, |
| 216 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); | 221 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); |
| 217 } | 222 } |
| 218 | 223 |
| 219 } // namespace | 224 } // namespace |
| 220 } // namespace cc | 225 } // namespace cc |
| 221 | 226 |
| 222 #endif // !defined(OS_ANDROID) | 227 #endif // !defined(OS_ANDROID) |
| OLD | NEW |