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

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

Issue 903273002: Update from https://crrev.com/315085 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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_unittest.cc ('k') | cc/layers/scroll_blocks_on.h » ('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.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "cc/layers/content_layer_client.h" 7 #include "cc/layers/content_layer_client.h"
8 #include "cc/layers/picture_layer_impl.h" 8 #include "cc/layers/picture_layer_impl.h"
9 #include "cc/resources/resource_update_queue.h" 9 #include "cc/resources/resource_update_queue.h"
10 #include "cc/test/fake_layer_tree_host.h" 10 #include "cc/test/fake_layer_tree_host.h"
11 #include "cc/test/fake_picture_layer_impl.h" 11 #include "cc/test/fake_picture_layer_impl.h"
12 #include "cc/test/fake_proxy.h" 12 #include "cc/test/fake_proxy.h"
13 #include "cc/test/impl_side_painting_settings.h" 13 #include "cc/test/impl_side_painting_settings.h"
14 #include "cc/trees/occlusion_tracker.h" 14 #include "cc/trees/occlusion_tracker.h"
15 #include "cc/trees/single_thread_proxy.h" 15 #include "cc/trees/single_thread_proxy.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 17
18 namespace cc { 18 namespace cc {
19 namespace { 19 namespace {
20 20
21 class MockContentLayerClient : public ContentLayerClient { 21 class MockContentLayerClient : public ContentLayerClient {
22 public: 22 public:
23 void PaintContents( 23 void PaintContents(SkCanvas* canvas,
24 SkCanvas* canvas, 24 const gfx::Rect& clip,
25 const gfx::Rect& clip, 25 PaintingControlSetting picture_control) override {}
26 ContentLayerClient::GraphicsContextStatus gc_status) override {}
27 scoped_refptr<DisplayItemList> PaintContentsToDisplayList( 26 scoped_refptr<DisplayItemList> PaintContentsToDisplayList(
28 const gfx::Rect& clip, 27 const gfx::Rect& clip,
29 GraphicsContextStatus gc_status) override { 28 PaintingControlSetting picture_control) override {
30 NOTIMPLEMENTED(); 29 NOTIMPLEMENTED();
31 return DisplayItemList::Create(); 30 return DisplayItemList::Create();
32 } 31 }
33 bool FillsBoundsCompletely() const override { return false; }; 32 bool FillsBoundsCompletely() const override { return false; };
34 }; 33 };
35 34
36 TEST(PictureLayerTest, NoTilesIfEmptyBounds) { 35 TEST(PictureLayerTest, NoTilesIfEmptyBounds) {
37 MockContentLayerClient client; 36 MockContentLayerClient client;
38 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client); 37 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
39 layer->SetBounds(gfx::Size(10, 10)); 38 layer->SetBounds(gfx::Size(10, 10));
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 106
108 // Tile-grid is set according to its setting. 107 // Tile-grid is set according to its setting.
109 gfx::Size size = 108 gfx::Size size =
110 layer->GetRecordingSourceForTesting()->GetTileGridSizeForTesting(); 109 layer->GetRecordingSourceForTesting()->GetTileGridSizeForTesting();
111 EXPECT_EQ(size.width(), 123); 110 EXPECT_EQ(size.width(), 123);
112 EXPECT_EQ(size.height(), 123); 111 EXPECT_EQ(size.height(), 123);
113 } 112 }
114 113
115 } // namespace 114 } // namespace
116 } // namespace cc 115 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/layers/scroll_blocks_on.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698