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_unittest.cc

Issue 666573002: CC: Decouple tile-grid-size from tile-size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 2 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.cc ('k') | cc/resources/picture_pile_base.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"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Layer is suitable for gpu rasterization by default. 77 // Layer is suitable for gpu rasterization by default.
78 EXPECT_TRUE(pile->is_suitable_for_gpu_rasterization()); 78 EXPECT_TRUE(pile->is_suitable_for_gpu_rasterization());
79 EXPECT_TRUE(layer->IsSuitableForGpuRasterization()); 79 EXPECT_TRUE(layer->IsSuitableForGpuRasterization());
80 80
81 // Veto gpu rasterization. 81 // Veto gpu rasterization.
82 pile->SetUnsuitableForGpuRasterizationForTesting(); 82 pile->SetUnsuitableForGpuRasterizationForTesting();
83 EXPECT_FALSE(pile->is_suitable_for_gpu_rasterization()); 83 EXPECT_FALSE(pile->is_suitable_for_gpu_rasterization());
84 EXPECT_FALSE(layer->IsSuitableForGpuRasterization()); 84 EXPECT_FALSE(layer->IsSuitableForGpuRasterization());
85 } 85 }
86 86
87 TEST(PictureLayerTest, UseTileGridSize) {
88 LayerTreeSettings settings;
89 settings.default_tile_grid_size = gfx::Size(123, 123);
90
91 MockContentLayerClient client;
92 scoped_refptr<PictureLayer> layer = PictureLayer::Create(&client);
93 FakeLayerTreeHostClient host_client(FakeLayerTreeHostClient::DIRECT_3D);
94 scoped_ptr<FakeLayerTreeHost> host =
95 FakeLayerTreeHost::Create(&host_client, settings);
96 host->SetRootLayer(layer);
97
98 // Tile-grid is set according to its setting.
99 SkTileGridFactory::TileGridInfo info =
100 layer->GetPicturePileForTesting()->GetTileGridInfoForTesting();
101 EXPECT_EQ(info.fTileInterval.width(), 123 - 2 * info.fMargin.width());
102 EXPECT_EQ(info.fTileInterval.height(), 123 - 2 * info.fMargin.height());
103 }
104
87 } // namespace 105 } // namespace
88 } // namespace cc 106 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer.cc ('k') | cc/resources/picture_pile_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698