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

Side by Side Diff: cc/test/tiled_layer_test_common.h

Issue 1122393003: CC: Plumb LayerSettings parameter for cc::Layer construction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/tiled_layer_test_common.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #ifndef CC_TEST_TILED_LAYER_TEST_COMMON_H_ 5 #ifndef CC_TEST_TILED_LAYER_TEST_COMMON_H_
6 #define CC_TEST_TILED_LAYER_TEST_COMMON_H_ 6 #define CC_TEST_TILED_LAYER_TEST_COMMON_H_
7 7
8 #include "cc/base/region.h" 8 #include "cc/base/region.h"
9 #include "cc/layers/tiled_layer.h" 9 #include "cc/layers/tiled_layer.h"
10 #include "cc/layers/tiled_layer_impl.h" 10 #include "cc/layers/tiled_layer_impl.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 public: 85 public:
86 FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id); 86 FakeTiledLayerImpl(LayerTreeImpl* tree_impl, int id);
87 ~FakeTiledLayerImpl() override; 87 ~FakeTiledLayerImpl() override;
88 88
89 using TiledLayerImpl::HasTileAt; 89 using TiledLayerImpl::HasTileAt;
90 using TiledLayerImpl::HasResourceIdForTileAt; 90 using TiledLayerImpl::HasResourceIdForTileAt;
91 }; 91 };
92 92
93 class FakeTiledLayer : public TiledLayer { 93 class FakeTiledLayer : public TiledLayer {
94 public: 94 public:
95 explicit FakeTiledLayer(PrioritizedResourceManager* resource_manager); 95 explicit FakeTiledLayer(const LayerSettings& settings,
96 PrioritizedResourceManager* resource_manager);
96 97
97 static gfx::Size tile_size() { return gfx::Size(100, 100); } 98 static gfx::Size tile_size() { return gfx::Size(100, 100); }
98 99
99 using TiledLayer::InvalidateContentRect; 100 using TiledLayer::InvalidateContentRect;
100 using TiledLayer::NeedsIdlePaint; 101 using TiledLayer::NeedsIdlePaint;
101 using TiledLayer::SkipsDraw; 102 using TiledLayer::SkipsDraw;
102 using TiledLayer::NumPaintedTiles; 103 using TiledLayer::NumPaintedTiles;
103 using TiledLayer::IdlePaintRect; 104 using TiledLayer::IdlePaintRect;
104 105
105 void SetNeedsDisplayRect(const gfx::Rect& rect) override; 106 void SetNeedsDisplayRect(const gfx::Rect& rect) override;
(...skipping 21 matching lines...) Expand all
127 private: 128 private:
128 scoped_refptr<FakeLayerUpdater> fake_updater_; 129 scoped_refptr<FakeLayerUpdater> fake_updater_;
129 PrioritizedResourceManager* resource_manager_; 130 PrioritizedResourceManager* resource_manager_;
130 gfx::Rect last_needs_display_rect_; 131 gfx::Rect last_needs_display_rect_;
131 132
132 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayer); 133 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayer);
133 }; 134 };
134 135
135 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { 136 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer {
136 public: 137 public:
137 explicit FakeTiledLayerWithScaledBounds( 138 FakeTiledLayerWithScaledBounds(const LayerSettings& settings,
138 PrioritizedResourceManager* resource_manager); 139 PrioritizedResourceManager* resource_manager);
139 140
140 void SetContentBounds(const gfx::Size& content_bounds); 141 void SetContentBounds(const gfx::Size& content_bounds);
141 void CalculateContentsScale(float ideal_contents_scale, 142 void CalculateContentsScale(float ideal_contents_scale,
142 float* contents_scale_x, 143 float* contents_scale_x,
143 float* contents_scale_y, 144 float* contents_scale_y,
144 gfx::Size* content_bounds) override; 145 gfx::Size* content_bounds) override;
145 146
146 protected: 147 protected:
147 ~FakeTiledLayerWithScaledBounds() override; 148 ~FakeTiledLayerWithScaledBounds() override;
148 gfx::Size forced_content_bounds_; 149 gfx::Size forced_content_bounds_;
149 150
150 private: 151 private:
151 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayerWithScaledBounds); 152 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayerWithScaledBounds);
152 }; 153 };
153 154
154 } // namespace cc 155 } // namespace cc
155 156
156 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ 157 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/test/layer_tree_test.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698