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

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

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/scrollbar_layer_unittest.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/layer_updater.h" 8 #include "cc/layer_updater.h"
9 #include "cc/prioritized_resource.h" 9 #include "cc/prioritized_resource.h"
10 #include "cc/region.h" 10 #include "cc/region.h"
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 virtual void setNeedsDisplayRect(const gfx::RectF&) OVERRIDE; 93 virtual void setNeedsDisplayRect(const gfx::RectF&) OVERRIDE;
94 const gfx::RectF& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRe ct; } 94 const gfx::RectF& lastNeedsDisplayRect() const { return m_lastNeedsDisplayRe ct; }
95 95
96 virtual void setTexturePriorities(const cc::PriorityCalculator&) OVERRIDE; 96 virtual void setTexturePriorities(const cc::PriorityCalculator&) OVERRIDE;
97 97
98 virtual cc::PrioritizedResourceManager* resourceManager() const OVERRIDE; 98 virtual cc::PrioritizedResourceManager* resourceManager() const OVERRIDE;
99 FakeLayerUpdater* fakeLayerUpdater() { return m_fakeUpdater.get(); } 99 FakeLayerUpdater* fakeLayerUpdater() { return m_fakeUpdater.get(); }
100 gfx::RectF updateRect() { return m_updateRect; } 100 gfx::RectF updateRect() { return m_updateRect; }
101 101
102 // Simulate calcDrawProperties.
103 void updateContentsScale(float idealContentsScale);
104
102 protected: 105 protected:
103 virtual cc::LayerUpdater* updater() const OVERRIDE; 106 virtual cc::LayerUpdater* updater() const OVERRIDE;
104 virtual void createUpdaterIfNeeded() OVERRIDE { } 107 virtual void createUpdaterIfNeeded() OVERRIDE { }
105 virtual ~FakeTiledLayer(); 108 virtual ~FakeTiledLayer();
106 109
107 private: 110 private:
108 scoped_refptr<FakeLayerUpdater> m_fakeUpdater; 111 scoped_refptr<FakeLayerUpdater> m_fakeUpdater;
109 cc::PrioritizedResourceManager* m_resourceManager; 112 cc::PrioritizedResourceManager* m_resourceManager;
110 gfx::RectF m_lastNeedsDisplayRect; 113 gfx::RectF m_lastNeedsDisplayRect;
111 }; 114 };
112 115
113 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { 116 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer {
114 public: 117 public:
115 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*); 118 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*);
116 119
117 void setContentBounds(const gfx::Size& contentBounds) { m_forcedContentBound s = contentBounds; } 120 void setContentBounds(const gfx::Size& contentBounds);
118 virtual gfx::Size contentBounds() const OVERRIDE; 121 virtual void calculateContentsScale(
119 virtual float contentsScaleX() const OVERRIDE; 122 float idealContentsScale,
120 virtual float contentsScaleY() const OVERRIDE; 123 float* contentsScaleX,
121 virtual void setContentsScale(float) OVERRIDE; 124 float* contentsScaleY,
125 gfx::Size* contentBounds) OVERRIDE;
126 virtual void didUpdateBounds() OVERRIDE;
122 127
123 protected: 128 protected:
124 virtual ~FakeTiledLayerWithScaledBounds(); 129 virtual ~FakeTiledLayerWithScaledBounds();
125 gfx::Size m_forcedContentBounds; 130 gfx::Size m_forcedContentBounds;
126 }; 131 };
127 132
128 } 133 }
129 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ 134 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/scrollbar_layer_unittest.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698