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

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

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/test/render_pass_test_utils.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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 explicit FakeTiledLayer(cc::PrioritizedResourceManager*); 83 explicit FakeTiledLayer(cc::PrioritizedResourceManager*);
84 84
85 static gfx::Size tileSize() { return gfx::Size(100, 100); } 85 static gfx::Size tileSize() { return gfx::Size(100, 100); }
86 86
87 using cc::TiledLayer::invalidateContentRect; 87 using cc::TiledLayer::invalidateContentRect;
88 using cc::TiledLayer::needsIdlePaint; 88 using cc::TiledLayer::needsIdlePaint;
89 using cc::TiledLayer::skipsDraw; 89 using cc::TiledLayer::skipsDraw;
90 using cc::TiledLayer::numPaintedTiles; 90 using cc::TiledLayer::numPaintedTiles;
91 using cc::TiledLayer::idlePaintRect; 91 using cc::TiledLayer::idlePaintRect;
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 update_rect_; }
101 101
102 // Simulate calcDrawProperties. 102 // Simulate calcDrawProperties.
103 void updateContentsScale(float idealContentsScale); 103 void updateContentsScale(float idealContentsScale);
104 104
105 protected: 105 protected:
106 virtual cc::LayerUpdater* updater() const OVERRIDE; 106 virtual cc::LayerUpdater* updater() const OVERRIDE;
107 virtual void createUpdaterIfNeeded() OVERRIDE { } 107 virtual void createUpdaterIfNeeded() OVERRIDE { }
108 virtual ~FakeTiledLayer(); 108 virtual ~FakeTiledLayer();
109 109
110 private: 110 private:
111 scoped_refptr<FakeLayerUpdater> m_fakeUpdater; 111 scoped_refptr<FakeLayerUpdater> m_fakeUpdater;
112 cc::PrioritizedResourceManager* m_resourceManager; 112 cc::PrioritizedResourceManager* m_resourceManager;
113 gfx::RectF m_lastNeedsDisplayRect; 113 gfx::RectF m_lastNeedsDisplayRect;
114 }; 114 };
115 115
116 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { 116 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer {
117 public: 117 public:
118 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*); 118 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*);
119 119
120 void setContentBounds(const gfx::Size& contentBounds); 120 void setContentBounds(const gfx::Size& contentBounds);
121 virtual void calculateContentsScale( 121 virtual void CalculateContentsScale(float idealContentsScale,
122 float idealContentsScale, 122 bool animatingTransformToScreen,
123 bool animatingTransformToScreen, 123 float* contentsScaleX,
124 float* contentsScaleX, 124 float* contentsScaleY,
125 float* contentsScaleY, 125 gfx::Size* contentBounds) OVERRIDE;
126 gfx::Size* contentBounds) OVERRIDE;
127 126
128 protected: 127 protected:
129 virtual ~FakeTiledLayerWithScaledBounds(); 128 virtual ~FakeTiledLayerWithScaledBounds();
130 gfx::Size m_forcedContentBounds; 129 gfx::Size m_forcedContentBounds;
131 }; 130 };
132 131
133 } // namespace cc 132 } // namespace cc
134 133
135 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ 134 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/test/render_pass_test_utils.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698