Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 BITMAP, | 25 BITMAP, |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 class LayerTreeHostTilesPixelTest : public LayerTreePixelTest { | 28 class LayerTreeHostTilesPixelTest : public LayerTreePixelTest { |
| 29 protected: | 29 protected: |
| 30 void InitializeSettings(LayerTreeSettings* settings) override { | 30 void InitializeSettings(LayerTreeSettings* settings) override { |
| 31 LayerTreePixelTest::InitializeSettings(settings); | 31 LayerTreePixelTest::InitializeSettings(settings); |
| 32 switch (raster_mode_) { | 32 switch (raster_mode_) { |
| 33 case PARTIAL_ONE_COPY: | 33 case PARTIAL_ONE_COPY: |
| 34 settings->use_zero_copy = false; | 34 settings->use_zero_copy = false; |
| 35 settings->use_persistent_map_for_gpu_memory_buffers = true; | 35 settings->use_partial_raster = true; |
| 36 break; | 36 break; |
| 37 case FULL_ONE_COPY: | 37 case FULL_ONE_COPY: |
| 38 settings->use_zero_copy = false; | 38 settings->use_zero_copy = false; |
| 39 settings->use_persistent_map_for_gpu_memory_buffers = false; | 39 settings->use_partial_raster = false; |
| 40 break; | 40 break; |
| 41 case BITMAP: | 41 case BITMAP: |
| 42 // This is done via context creation. No settings to change here! | 42 settings->use_partial_raster = true; |
| 43 break; | 43 break; |
| 44 case GPU: | 44 case GPU: |
| 45 settings->gpu_rasterization_enabled = true; | 45 settings->gpu_rasterization_enabled = true; |
| 46 settings->gpu_rasterization_forced = true; | 46 settings->gpu_rasterization_forced = true; |
| 47 settings->use_partial_raster = true; | |
| 47 break; | 48 break; |
| 48 } | 49 } |
| 49 } | 50 } |
| 50 | 51 |
| 51 void BeginTest() override { | 52 void BeginTest() override { |
| 52 // Don't set up a readback target at the start of the test. | 53 // Don't set up a readback target at the start of the test. |
| 53 PostSetNeedsCommitToMainThread(); | 54 PostSetNeedsCommitToMainThread(); |
| 54 } | 55 } |
| 55 | 56 |
| 56 void DoReadback() { | 57 void DoReadback() { |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 } | 197 } |
| 197 | 198 |
| 198 TEST_F(LayerTreeHostTilesTestPartialInvalidation, | 199 TEST_F(LayerTreeHostTilesTestPartialInvalidation, |
| 199 FullRaster_MultiThread_OneCopy) { | 200 FullRaster_MultiThread_OneCopy) { |
| 200 RunRasterPixelTest( | 201 RunRasterPixelTest( |
| 201 true, FULL_ONE_COPY, picture_layer_, | 202 true, FULL_ONE_COPY, picture_layer_, |
| 202 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); | 203 base::FilePath(FILE_PATH_LITERAL("blue_yellow_flipped.png"))); |
| 203 } | 204 } |
| 204 | 205 |
| 205 TEST_F(LayerTreeHostTilesTestPartialInvalidation, | 206 TEST_F(LayerTreeHostTilesTestPartialInvalidation, |
| 206 PartialRaster_SingleThread_Software) { | 207 PartialRaster_SingleThread_Software) { |
|
danakj
2015/10/16 18:13:08
Should we add non-partial versions of software and
ericrk
2015/10/16 20:27:13
good suggestion - done
| |
| 207 RunRasterPixelTest( | 208 RunRasterPixelTest( |
| 208 false, BITMAP, picture_layer_, | 209 false, BITMAP, picture_layer_, |
| 209 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); | 210 base::FilePath(FILE_PATH_LITERAL("blue_yellow_partial_flipped.png"))); |
| 210 } | 211 } |
| 211 | 212 |
| 212 TEST_F(LayerTreeHostTilesTestPartialInvalidation, | 213 TEST_F(LayerTreeHostTilesTestPartialInvalidation, |
| 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 |