Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: cc/layers/picture_layer_impl_unittest.cc

Issue 1812733004: Store recording invalidations in DisplayListRecordingSource, save them via Update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 4513 matching lines...) Expand 10 before | Expand all | Expand 10 after
4524 scoped_ptr<FakeLayerTreeHost> host = 4524 scoped_ptr<FakeLayerTreeHost> host =
4525 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); 4525 FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
4526 host->SetRootLayer(layer); 4526 host->SetRootLayer(layer);
4527 DisplayListRecordingSource* recording_source = 4527 DisplayListRecordingSource* recording_source =
4528 layer->GetDisplayListRecordingSourceForTesting(); 4528 layer->GetDisplayListRecordingSourceForTesting();
4529 4529
4530 int frame_number = 0; 4530 int frame_number = 0;
4531 4531
4532 client.set_fill_with_nonsolid_color(true); 4532 client.set_fill_with_nonsolid_color(true);
4533 4533
4534 Region invalidation1(layer_rect); 4534 recording_source->SetNeedsDisplayRect(layer_rect);
4535 Region invalidation1;
4535 recording_source->UpdateAndExpandInvalidation( 4536 recording_source->UpdateAndExpandInvalidation(
4536 &client, &invalidation1, layer_bounds, layer_rect, frame_number++, 4537 &client, &invalidation1, layer_bounds, layer_rect, frame_number++,
4537 DisplayListRecordingSource::RECORD_NORMALLY); 4538 DisplayListRecordingSource::RECORD_NORMALLY);
4538 4539
4539 scoped_refptr<DisplayListRasterSource> raster_source1 = 4540 scoped_refptr<DisplayListRasterSource> raster_source1 =
4540 recording_source->CreateRasterSource(true); 4541 recording_source->CreateRasterSource(true);
4541 4542
4542 SetupPendingTree(raster_source1); 4543 SetupPendingTree(raster_source1);
4543 ActivateTree(); 4544 ActivateTree();
4544 bool update_lcd_text = false; 4545 bool update_lcd_text = false;
4545 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); 4546 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
4546 4547
4547 // We've started with a solid layer that contains some tilings. 4548 // We've started with a solid layer that contains some tilings.
4548 ASSERT_TRUE(active_layer_->tilings()); 4549 ASSERT_TRUE(active_layer_->tilings());
4549 EXPECT_NE(0u, active_layer_->tilings()->num_tilings()); 4550 EXPECT_NE(0u, active_layer_->tilings()->num_tilings());
4550 4551
4551 client.set_fill_with_nonsolid_color(false); 4552 client.set_fill_with_nonsolid_color(false);
4552 4553
4553 Region invalidation2(layer_rect); 4554 recording_source->SetNeedsDisplayRect(layer_rect);
4555 Region invalidation2;
4554 recording_source->UpdateAndExpandInvalidation( 4556 recording_source->UpdateAndExpandInvalidation(
4555 &client, &invalidation2, layer_bounds, layer_rect, frame_number++, 4557 &client, &invalidation2, layer_bounds, layer_rect, frame_number++,
4556 DisplayListRecordingSource::RECORD_NORMALLY); 4558 DisplayListRecordingSource::RECORD_NORMALLY);
4557 4559
4558 scoped_refptr<DisplayListRasterSource> raster_source2 = 4560 scoped_refptr<DisplayListRasterSource> raster_source2 =
4559 recording_source->CreateRasterSource(true); 4561 recording_source->CreateRasterSource(true);
4560 4562
4561 SetupPendingTree(raster_source2); 4563 SetupPendingTree(raster_source2);
4562 ActivateTree(); 4564 ActivateTree();
4563 4565
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
4992 // New low res tiling. 4994 // New low res tiling.
4993 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 4995 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
4994 4996
4995 // This tiling will be high res now, it won't contain low res content since it 4997 // This tiling will be high res now, it won't contain low res content since it
4996 // was all destroyed. 4998 // was all destroyed.
4997 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 4999 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
4998 } 5000 }
4999 5001
5000 } // namespace 5002 } // namespace
5001 } // namespace cc 5003 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.cc ('k') | cc/layers/picture_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698