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

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

Issue 1101823002: CC Animations: Make LayerAnimationController creation optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumb LayerSettings parameter for cc::Layer construction. Created 5 years, 7 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
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 <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 328
329 FakeImplProxy proxy_; 329 FakeImplProxy proxy_;
330 TestSharedBitmapManager shared_bitmap_manager_; 330 TestSharedBitmapManager shared_bitmap_manager_;
331 TestTaskGraphRunner task_graph_runner_; 331 TestTaskGraphRunner task_graph_runner_;
332 FakeLayerTreeHostImpl host_impl_; 332 FakeLayerTreeHostImpl host_impl_;
333 int root_id_; 333 int root_id_;
334 int id_; 334 int id_;
335 FakePictureLayerImpl* pending_layer_; 335 FakePictureLayerImpl* pending_layer_;
336 FakePictureLayerImpl* old_pending_layer_; 336 FakePictureLayerImpl* old_pending_layer_;
337 FakePictureLayerImpl* active_layer_; 337 FakePictureLayerImpl* active_layer_;
338 LayerSettings layer_settings_;
338 339
339 private: 340 private:
340 DISALLOW_COPY_AND_ASSIGN(PictureLayerImplTest); 341 DISALLOW_COPY_AND_ASSIGN(PictureLayerImplTest);
341 }; 342 };
342 343
343 class NoLowResPictureLayerImplTest : public PictureLayerImplTest { 344 class NoLowResPictureLayerImplTest : public PictureLayerImplTest {
344 public: 345 public:
345 NoLowResPictureLayerImplTest() 346 NoLowResPictureLayerImplTest()
346 : PictureLayerImplTest(NoLowResTilingsSettings()) {} 347 : PictureLayerImplTest(NoLowResTilingsSettings()) {}
347 }; 348 };
(...skipping 4279 matching lines...) Expand 10 before | Expand all | Expand 10 after
4627 base::TimeTicks time_ticks; 4628 base::TimeTicks time_ticks;
4628 time_ticks += base::TimeDelta::FromMilliseconds(1); 4629 time_ticks += base::TimeDelta::FromMilliseconds(1);
4629 host_impl_.SetCurrentBeginFrameArgs( 4630 host_impl_.SetCurrentBeginFrameArgs(
4630 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); 4631 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
4631 4632
4632 gfx::Size tile_size(100, 100); 4633 gfx::Size tile_size(100, 100);
4633 gfx::Size layer_bounds(200, 200); 4634 gfx::Size layer_bounds(200, 200);
4634 gfx::Rect layer_rect(layer_bounds); 4635 gfx::Rect layer_rect(layer_bounds);
4635 4636
4636 FakeContentLayerClient client; 4637 FakeContentLayerClient client;
4637 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); 4638 scoped_refptr<PictureLayer> layer =
4639 PictureLayer::Create(layer_settings_, &client);
4638 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); 4640 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
4639 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); 4641 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client);
4640 host->SetRootLayer(layer); 4642 host->SetRootLayer(layer);
4641 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); 4643 RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
4642 4644
4643 int frame_number = 0; 4645 int frame_number = 0;
4644 4646
4645 client.set_fill_with_nonsolid_color(!test_for_solid); 4647 client.set_fill_with_nonsolid_color(!test_for_solid);
4646 4648
4647 Region invalidation(layer_rect); 4649 Region invalidation(layer_rect);
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
4690 base::TimeTicks time_ticks; 4692 base::TimeTicks time_ticks;
4691 time_ticks += base::TimeDelta::FromMilliseconds(1); 4693 time_ticks += base::TimeDelta::FromMilliseconds(1);
4692 host_impl_.SetCurrentBeginFrameArgs( 4694 host_impl_.SetCurrentBeginFrameArgs(
4693 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks)); 4695 CreateBeginFrameArgsForTesting(BEGINFRAME_FROM_HERE, time_ticks));
4694 4696
4695 gfx::Size tile_size(100, 100); 4697 gfx::Size tile_size(100, 100);
4696 gfx::Size layer_bounds(200, 200); 4698 gfx::Size layer_bounds(200, 200);
4697 gfx::Rect layer_rect(layer_bounds); 4699 gfx::Rect layer_rect(layer_bounds);
4698 4700
4699 FakeContentLayerClient client; 4701 FakeContentLayerClient client;
4700 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); 4702 scoped_refptr<PictureLayer> layer =
4703 PictureLayer::Create(layer_settings_, &client);
4701 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D); 4704 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
4702 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client); 4705 scoped_ptr<FakeLayerTreeHost> host = FakeLayerTreeHost::Create(&host_client);
4703 host->SetRootLayer(layer); 4706 host->SetRootLayer(layer);
4704 RecordingSource* recording_source = layer->GetRecordingSourceForTesting(); 4707 RecordingSource* recording_source = layer->GetRecordingSourceForTesting();
4705 4708
4706 int frame_number = 0; 4709 int frame_number = 0;
4707 4710
4708 client.set_fill_with_nonsolid_color(true); 4711 client.set_fill_with_nonsolid_color(true);
4709 4712
4710 Region invalidation1(layer_rect); 4713 Region invalidation1(layer_rect);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
4927 result = layer->CalculateTileSize(gfx::Size(447, 400)); 4930 result = layer->CalculateTileSize(gfx::Size(447, 400));
4928 EXPECT_EQ(result.width(), 448); 4931 EXPECT_EQ(result.width(), 448);
4929 EXPECT_EQ(result.height(), 448); 4932 EXPECT_EQ(result.height(), 448);
4930 result = layer->CalculateTileSize(gfx::Size(500, 499)); 4933 result = layer->CalculateTileSize(gfx::Size(500, 499));
4931 EXPECT_EQ(result.width(), 512); 4934 EXPECT_EQ(result.width(), 512);
4932 EXPECT_EQ(result.height(), 500 + 2); 4935 EXPECT_EQ(result.height(), 500 + 2);
4933 } 4936 }
4934 4937
4935 } // namespace 4938 } // namespace
4936 } // namespace cc 4939 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698