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

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

Issue 145313006: [#7] Pass gfx structs by const ref (gfx::Size) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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/test/test_texture.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 28 matching lines...) Expand all
39 39
40 DISALLOW_COPY_AND_ASSIGN(Resource); 40 DISALLOW_COPY_AND_ASSIGN(Resource);
41 }; 41 };
42 42
43 FakeLayerUpdater(); 43 FakeLayerUpdater();
44 44
45 virtual scoped_ptr<LayerUpdater::Resource> CreateResource( 45 virtual scoped_ptr<LayerUpdater::Resource> CreateResource(
46 PrioritizedResourceManager* resource) OVERRIDE; 46 PrioritizedResourceManager* resource) OVERRIDE;
47 47
48 virtual void PrepareToUpdate(const gfx::Rect& content_rect, 48 virtual void PrepareToUpdate(const gfx::Rect& content_rect,
49 gfx::Size tile_size, 49 const gfx::Size& tile_size,
50 float contents_width_scale, 50 float contents_width_scale,
51 float contents_height_scale, 51 float contents_height_scale,
52 gfx::Rect* resulting_opaque_rect) OVERRIDE; 52 gfx::Rect* resulting_opaque_rect) OVERRIDE;
53 // Sets the rect to invalidate during the next call to PrepareToUpdate(). 53 // Sets the rect to invalidate during the next call to PrepareToUpdate().
54 // After the next call to PrepareToUpdate() the rect is reset. 54 // After the next call to PrepareToUpdate() the rect is reset.
55 void SetRectToInvalidate(const gfx::Rect& rect, FakeTiledLayer* layer); 55 void SetRectToInvalidate(const gfx::Rect& rect, FakeTiledLayer* layer);
56 // Last rect passed to PrepareToUpdate(). 56 // Last rect passed to PrepareToUpdate().
57 gfx::Rect last_update_rect() const { return last_update_rect_; } 57 gfx::Rect last_update_rect() const { return last_update_rect_; }
58 58
59 // Number of times PrepareToUpdate has been invoked. 59 // Number of times PrepareToUpdate has been invoked.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 gfx::RectF last_needs_display_rect_; 132 gfx::RectF last_needs_display_rect_;
133 133
134 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayer); 134 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayer);
135 }; 135 };
136 136
137 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { 137 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer {
138 public: 138 public:
139 explicit FakeTiledLayerWithScaledBounds( 139 explicit FakeTiledLayerWithScaledBounds(
140 PrioritizedResourceManager* resource_manager); 140 PrioritizedResourceManager* resource_manager);
141 141
142 void SetContentBounds(gfx::Size content_bounds); 142 void SetContentBounds(const gfx::Size& content_bounds);
143 virtual void CalculateContentsScale(float ideal_contents_scale, 143 virtual void CalculateContentsScale(float ideal_contents_scale,
144 float device_scale_factor, 144 float device_scale_factor,
145 float page_scale_factor, 145 float page_scale_factor,
146 bool animating_transform_to_screen, 146 bool animating_transform_to_screen,
147 float* contents_scale_x, 147 float* contents_scale_x,
148 float* contents_scale_y, 148 float* contents_scale_y,
149 gfx::Size* content_bounds) OVERRIDE; 149 gfx::Size* content_bounds) OVERRIDE;
150 150
151 protected: 151 protected:
152 virtual ~FakeTiledLayerWithScaledBounds(); 152 virtual ~FakeTiledLayerWithScaledBounds();
153 gfx::Size forced_content_bounds_; 153 gfx::Size forced_content_bounds_;
154 154
155 private: 155 private:
156 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayerWithScaledBounds); 156 DISALLOW_COPY_AND_ASSIGN(FakeTiledLayerWithScaledBounds);
157 }; 157 };
158 158
159 } // namespace cc 159 } // namespace cc
160 160
161 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ 161 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/test/test_texture.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698