| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 4512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4523 scoped_ptr<FakeLayerTreeHost> host = | 4523 scoped_ptr<FakeLayerTreeHost> host = |
| 4524 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); | 4524 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); |
| 4525 host->SetRootLayer(layer); | 4525 host->SetRootLayer(layer); |
| 4526 DisplayListRecordingSource* recording_source = | 4526 DisplayListRecordingSource* recording_source = |
| 4527 layer->GetDisplayListRecordingSourceForTesting(); | 4527 layer->GetDisplayListRecordingSourceForTesting(); |
| 4528 | 4528 |
| 4529 int frame_number = 0; | 4529 int frame_number = 0; |
| 4530 | 4530 |
| 4531 client.set_fill_with_nonsolid_color(true); | 4531 client.set_fill_with_nonsolid_color(true); |
| 4532 | 4532 |
| 4533 Region invalidation1(layer_rect); | 4533 recording_source->SetNeedsDisplayRect(layer_rect); |
| 4534 Region invalidation1; |
| 4534 recording_source->UpdateAndExpandInvalidation( | 4535 recording_source->UpdateAndExpandInvalidation( |
| 4535 &client, &invalidation1, layer_bounds, layer_rect, frame_number++, | 4536 &client, &invalidation1, layer_bounds, layer_rect, frame_number++, |
| 4536 DisplayListRecordingSource::RECORD_NORMALLY); | 4537 DisplayListRecordingSource::RECORD_NORMALLY); |
| 4537 | 4538 |
| 4538 scoped_refptr<DisplayListRasterSource> raster_source1 = | 4539 scoped_refptr<DisplayListRasterSource> raster_source1 = |
| 4539 recording_source->CreateRasterSource(true); | 4540 recording_source->CreateRasterSource(true); |
| 4540 | 4541 |
| 4541 SetupPendingTree(raster_source1); | 4542 SetupPendingTree(raster_source1); |
| 4542 ActivateTree(); | 4543 ActivateTree(); |
| 4543 bool update_lcd_text = false; | 4544 bool update_lcd_text = false; |
| 4544 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); | 4545 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); |
| 4545 | 4546 |
| 4546 // We've started with a solid layer that contains some tilings. | 4547 // We've started with a solid layer that contains some tilings. |
| 4547 ASSERT_TRUE(active_layer_->tilings()); | 4548 ASSERT_TRUE(active_layer_->tilings()); |
| 4548 EXPECT_NE(0u, active_layer_->tilings()->num_tilings()); | 4549 EXPECT_NE(0u, active_layer_->tilings()->num_tilings()); |
| 4549 | 4550 |
| 4550 client.set_fill_with_nonsolid_color(false); | 4551 client.set_fill_with_nonsolid_color(false); |
| 4551 | 4552 |
| 4552 Region invalidation2(layer_rect); | 4553 recording_source->SetNeedsDisplayRect(layer_rect); |
| 4554 Region invalidation2; |
| 4553 recording_source->UpdateAndExpandInvalidation( | 4555 recording_source->UpdateAndExpandInvalidation( |
| 4554 &client, &invalidation2, layer_bounds, layer_rect, frame_number++, | 4556 &client, &invalidation2, layer_bounds, layer_rect, frame_number++, |
| 4555 DisplayListRecordingSource::RECORD_NORMALLY); | 4557 DisplayListRecordingSource::RECORD_NORMALLY); |
| 4556 | 4558 |
| 4557 scoped_refptr<DisplayListRasterSource> raster_source2 = | 4559 scoped_refptr<DisplayListRasterSource> raster_source2 = |
| 4558 recording_source->CreateRasterSource(true); | 4560 recording_source->CreateRasterSource(true); |
| 4559 | 4561 |
| 4560 SetupPendingTree(raster_source2); | 4562 SetupPendingTree(raster_source2); |
| 4561 ActivateTree(); | 4563 ActivateTree(); |
| 4562 | 4564 |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4989 // New low res tiling. | 4991 // New low res tiling. |
| 4990 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); | 4992 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); |
| 4991 | 4993 |
| 4992 // This tiling will be high res now, it won't contain low res content since it | 4994 // This tiling will be high res now, it won't contain low res content since it |
| 4993 // was all destroyed. | 4995 // was all destroyed. |
| 4994 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); | 4996 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); |
| 4995 } | 4997 } |
| 4996 | 4998 |
| 4997 } // namespace | 4999 } // namespace |
| 4998 } // namespace cc | 5000 } // namespace cc |
| OLD | NEW |