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

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

Issue 1812733003: Store recording invalidations in DisplayListRecordingSource, save them via Update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 4440 matching lines...) Expand 10 before | Expand all | Expand 10 after
4451 scoped_ptr<FakeLayerTreeHost> host = 4451 scoped_ptr<FakeLayerTreeHost> host =
4452 FakeLayerTreeHost::Create(&host_client, &task_graph_runner); 4452 FakeLayerTreeHost::Create(&host_client, &task_graph_runner);
4453 host->SetRootLayer(layer); 4453 host->SetRootLayer(layer);
4454 DisplayListRecordingSource* recording_source = 4454 DisplayListRecordingSource* recording_source =
4455 layer->GetDisplayListRecordingSourceForTesting(); 4455 layer->GetDisplayListRecordingSourceForTesting();
4456 4456
4457 int frame_number = 0; 4457 int frame_number = 0;
4458 4458
4459 client.set_fill_with_nonsolid_color(true); 4459 client.set_fill_with_nonsolid_color(true);
4460 4460
4461 Region invalidation1(layer_rect); 4461 recording_source->SetNeedsDisplayRect(layer_rect);
4462 Region invalidation1;
4462 recording_source->UpdateAndExpandInvalidation( 4463 recording_source->UpdateAndExpandInvalidation(
4463 &client, &invalidation1, layer_bounds, layer_rect, frame_number++, 4464 &client, &invalidation1, layer_bounds, layer_rect, frame_number++,
4464 DisplayListRecordingSource::RECORD_NORMALLY); 4465 DisplayListRecordingSource::RECORD_NORMALLY);
4465 4466
4466 scoped_refptr<DisplayListRasterSource> raster_source1 = 4467 scoped_refptr<DisplayListRasterSource> raster_source1 =
4467 recording_source->CreateRasterSource(true); 4468 recording_source->CreateRasterSource(true);
4468 4469
4469 SetupPendingTree(raster_source1); 4470 SetupPendingTree(raster_source1);
4470 ActivateTree(); 4471 ActivateTree();
4471 bool update_lcd_text = false; 4472 bool update_lcd_text = false;
4472 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text); 4473 host_impl_.active_tree()->UpdateDrawProperties(update_lcd_text);
4473 4474
4474 // We've started with a solid layer that contains some tilings. 4475 // We've started with a solid layer that contains some tilings.
4475 ASSERT_TRUE(active_layer_->tilings()); 4476 ASSERT_TRUE(active_layer_->tilings());
4476 EXPECT_NE(0u, active_layer_->tilings()->num_tilings()); 4477 EXPECT_NE(0u, active_layer_->tilings()->num_tilings());
4477 4478
4478 client.set_fill_with_nonsolid_color(false); 4479 client.set_fill_with_nonsolid_color(false);
4479 4480
4480 Region invalidation2(layer_rect); 4481 recording_source->SetNeedsDisplayRect(layer_rect);
4482 Region invalidation2;
4481 recording_source->UpdateAndExpandInvalidation( 4483 recording_source->UpdateAndExpandInvalidation(
4482 &client, &invalidation2, layer_bounds, layer_rect, frame_number++, 4484 &client, &invalidation2, layer_bounds, layer_rect, frame_number++,
4483 DisplayListRecordingSource::RECORD_NORMALLY); 4485 DisplayListRecordingSource::RECORD_NORMALLY);
4484 4486
4485 scoped_refptr<DisplayListRasterSource> raster_source2 = 4487 scoped_refptr<DisplayListRasterSource> raster_source2 =
4486 recording_source->CreateRasterSource(true); 4488 recording_source->CreateRasterSource(true);
4487 4489
4488 SetupPendingTree(raster_source2); 4490 SetupPendingTree(raster_source2);
4489 ActivateTree(); 4491 ActivateTree();
4490 4492
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
4919 // New low res tiling. 4921 // New low res tiling.
4920 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles()); 4922 EXPECT_TRUE(tilings->tiling_at(2)->may_contain_low_resolution_tiles());
4921 4923
4922 // This tiling will be high res now, it won't contain low res content since it 4924 // This tiling will be high res now, it won't contain low res content since it
4923 // was all destroyed. 4925 // was all destroyed.
4924 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles()); 4926 EXPECT_FALSE(tilings->tiling_at(1)->may_contain_low_resolution_tiles());
4925 } 4927 }
4926 4928
4927 } // namespace 4929 } // namespace
4928 } // namespace cc 4930 } // 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