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

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

Issue 11369109: cc: Rename PrioritizedTexture to PrioritizedResource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/skpicture_content_layer_updater.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 "Region.h" 8 #include "Region.h"
9 #include "cc/layer_updater.h" 9 #include "cc/layer_updater.h"
10 #include "cc/prioritized_texture.h" 10 #include "cc/prioritized_resource.h"
11 #include "cc/resource_provider.h" 11 #include "cc/resource_provider.h"
12 #include "cc/resource_update_queue.h" 12 #include "cc/resource_update_queue.h"
13 #include "cc/texture_copier.h" 13 #include "cc/texture_copier.h"
14 #include "cc/texture_uploader.h" 14 #include "cc/texture_uploader.h"
15 #include "cc/tiled_layer.h" 15 #include "cc/tiled_layer.h"
16 #include "cc/tiled_layer_impl.h" 16 #include "cc/tiled_layer_impl.h"
17 #include "ui/gfx/rect.h" 17 #include "ui/gfx/rect.h"
18 #include "ui/gfx/size.h" 18 #include "ui/gfx/size.h"
19 19
20 namespace WebKitTests { 20 namespace WebKitTests {
21 21
22 class FakeTiledLayer; 22 class FakeTiledLayer;
23 23
24 class FakeLayerUpdater : public cc::LayerUpdater { 24 class FakeLayerUpdater : public cc::LayerUpdater {
25 public: 25 public:
26 class Resource : public cc::LayerUpdater::Resource { 26 class Resource : public cc::LayerUpdater::Resource {
27 public: 27 public:
28 Resource(FakeLayerUpdater*, scoped_ptr<cc::PrioritizedTexture>); 28 Resource(FakeLayerUpdater*, scoped_ptr<cc::PrioritizedResource>);
29 virtual ~Resource(); 29 virtual ~Resource();
30 30
31 virtual void update(cc::ResourceUpdateQueue&, const gfx::Rect&, const gf x::Vector2d&, bool, cc::RenderingStats&) OVERRIDE; 31 virtual void update(cc::ResourceUpdateQueue&, const gfx::Rect&, const gf x::Vector2d&, bool, cc::RenderingStats&) OVERRIDE;
32 32
33 private: 33 private:
34 FakeLayerUpdater* m_layer; 34 FakeLayerUpdater* m_layer;
35 SkBitmap m_bitmap; 35 SkBitmap m_bitmap;
36 }; 36 };
37 37
38 FakeLayerUpdater(); 38 FakeLayerUpdater();
39 39
40 virtual scoped_ptr<cc::LayerUpdater::Resource> createResource(cc::Prioritize dTextureManager*) OVERRIDE; 40 virtual scoped_ptr<cc::LayerUpdater::Resource> createResource(cc::Prioritize dResourceManager*) OVERRIDE;
41 41
42 virtual void prepareToUpdate(const gfx::Rect& contentRect, const gfx::Size&, float, float, gfx::Rect& resultingOpaqueRect, cc::RenderingStats&) OVERRIDE; 42 virtual void prepareToUpdate(const gfx::Rect& contentRect, const gfx::Size&, float, float, gfx::Rect& resultingOpaqueRect, cc::RenderingStats&) OVERRIDE;
43 // Sets the rect to invalidate during the next call to prepareToUpdate(). Af ter the next 43 // Sets the rect to invalidate during the next call to prepareToUpdate(). Af ter the next
44 // call to prepareToUpdate() the rect is reset. 44 // call to prepareToUpdate() the rect is reset.
45 void setRectToInvalidate(const gfx::Rect&, FakeTiledLayer*); 45 void setRectToInvalidate(const gfx::Rect&, FakeTiledLayer*);
46 // Last rect passed to prepareToUpdate(). 46 // Last rect passed to prepareToUpdate().
47 const gfx::Rect& lastUpdateRect() const { return m_lastUpdateRect; } 47 const gfx::Rect& lastUpdateRect() const { return m_lastUpdateRect; }
48 48
49 // Number of times prepareToUpdate has been invoked. 49 // Number of times prepareToUpdate has been invoked.
50 int prepareCount() const { return m_prepareCount; } 50 int prepareCount() const { return m_prepareCount; }
(...skipping 22 matching lines...) Expand all
73 public: 73 public:
74 explicit FakeTiledLayerImpl(int id); 74 explicit FakeTiledLayerImpl(int id);
75 virtual ~FakeTiledLayerImpl(); 75 virtual ~FakeTiledLayerImpl();
76 76
77 using cc::TiledLayerImpl::hasTileAt; 77 using cc::TiledLayerImpl::hasTileAt;
78 using cc::TiledLayerImpl::hasResourceIdForTileAt; 78 using cc::TiledLayerImpl::hasResourceIdForTileAt;
79 }; 79 };
80 80
81 class FakeTiledLayer : public cc::TiledLayer { 81 class FakeTiledLayer : public cc::TiledLayer {
82 public: 82 public:
83 explicit FakeTiledLayer(cc::PrioritizedTextureManager*); 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::PrioritizedTextureManager* textureManager() 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 protected: 102 protected:
103 virtual cc::LayerUpdater* updater() const OVERRIDE; 103 virtual cc::LayerUpdater* updater() const OVERRIDE;
104 virtual void createUpdaterIfNeeded() OVERRIDE { } 104 virtual void createUpdaterIfNeeded() OVERRIDE { }
105 virtual ~FakeTiledLayer(); 105 virtual ~FakeTiledLayer();
106 106
107 private: 107 private:
108 scoped_refptr<FakeLayerUpdater> m_fakeUpdater; 108 scoped_refptr<FakeLayerUpdater> m_fakeUpdater;
109 cc::PrioritizedTextureManager* m_textureManager; 109 cc::PrioritizedResourceManager* m_resourceManager;
110 gfx::RectF m_lastNeedsDisplayRect; 110 gfx::RectF m_lastNeedsDisplayRect;
111 }; 111 };
112 112
113 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer { 113 class FakeTiledLayerWithScaledBounds : public FakeTiledLayer {
114 public: 114 public:
115 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedTextureManager*); 115 explicit FakeTiledLayerWithScaledBounds(cc::PrioritizedResourceManager*);
116 116
117 void setContentBounds(const gfx::Size& contentBounds) { m_forcedContentBound s = contentBounds; } 117 void setContentBounds(const gfx::Size& contentBounds) { m_forcedContentBound s = contentBounds; }
118 virtual gfx::Size contentBounds() const OVERRIDE; 118 virtual gfx::Size contentBounds() const OVERRIDE;
119 virtual float contentsScaleX() const OVERRIDE; 119 virtual float contentsScaleX() const OVERRIDE;
120 virtual float contentsScaleY() const OVERRIDE; 120 virtual float contentsScaleY() const OVERRIDE;
121 virtual void setContentsScale(float) OVERRIDE; 121 virtual void setContentsScale(float) OVERRIDE;
122 122
123 protected: 123 protected:
124 virtual ~FakeTiledLayerWithScaledBounds(); 124 virtual ~FakeTiledLayerWithScaledBounds();
125 gfx::Size m_forcedContentBounds; 125 gfx::Size m_forcedContentBounds;
126 }; 126 };
127 127
128 } 128 }
129 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_ 129 #endif // CC_TEST_TILED_LAYER_TEST_COMMON_H_
OLDNEW
« no previous file with comments | « cc/skpicture_content_layer_updater.cc ('k') | cc/test/tiled_layer_test_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698