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

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

Issue 11074009: cc: Remove LayerTextureUpdater::Texture::updateRect() callback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 2 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/skpicture_canvas_layer_texture_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 CCTiledLayerTestCommon_h 5 #ifndef CCTiledLayerTestCommon_h
6 #define CCTiledLayerTestCommon_h 6 #define CCTiledLayerTestCommon_h
7 7
8 #include "CCGraphicsContext.h" 8 #include "CCGraphicsContext.h"
9 #include "CCPrioritizedTexture.h" 9 #include "CCPrioritizedTexture.h"
10 #include "CCResourceProvider.h" 10 #include "CCResourceProvider.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class FakeTiledLayerChromium; 23 class FakeTiledLayerChromium;
24 24
25 class FakeLayerTextureUpdater : public cc::LayerTextureUpdater { 25 class FakeLayerTextureUpdater : public cc::LayerTextureUpdater {
26 public: 26 public:
27 class Texture : public cc::LayerTextureUpdater::Texture { 27 class Texture : public cc::LayerTextureUpdater::Texture {
28 public: 28 public:
29 Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::CCPrioritizedTexture>); 29 Texture(FakeLayerTextureUpdater*, scoped_ptr<cc::CCPrioritizedTexture>);
30 virtual ~Texture(); 30 virtual ~Texture();
31 31
32 virtual void updateRect(cc::CCResourceProvider* , const cc::IntRect&, co nst cc::IntSize&) OVERRIDE; 32 virtual void update(cc::CCTextureUpdateQueue&, const cc::IntRect&, const cc::IntSize&, bool, cc::CCRenderingStats&) OVERRIDE;
33 virtual void prepareRect(const cc::IntRect&, cc::CCRenderingStats&) OVER RIDE;
34 33
35 private: 34 private:
36 FakeLayerTextureUpdater* m_layer; 35 FakeLayerTextureUpdater* m_layer;
37 }; 36 };
38 37
39 FakeLayerTextureUpdater(); 38 FakeLayerTextureUpdater();
40 virtual ~FakeLayerTextureUpdater(); 39 virtual ~FakeLayerTextureUpdater();
41 40
42 virtual PassOwnPtr<cc::LayerTextureUpdater::Texture> createTexture(cc::CCPri oritizedTextureManager*) OVERRIDE; 41 virtual PassOwnPtr<cc::LayerTextureUpdater::Texture> createTexture(cc::CCPri oritizedTextureManager*) OVERRIDE;
43 virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE; 42 virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE;
44 43
45 virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSi ze&, float, float, cc::IntRect& resultingOpaqueRect, cc::CCRenderingStats&) OVER RIDE; 44 virtual void prepareToUpdate(const cc::IntRect& contentRect, const cc::IntSi ze&, float, float, cc::IntRect& resultingOpaqueRect, cc::CCRenderingStats&) OVER RIDE;
46 // Sets the rect to invalidate during the next call to prepareToUpdate(). Af ter the next 45 // Sets the rect to invalidate during the next call to prepareToUpdate(). Af ter the next
47 // call to prepareToUpdate() the rect is reset. 46 // call to prepareToUpdate() the rect is reset.
48 void setRectToInvalidate(const cc::IntRect&, FakeTiledLayerChromium*); 47 void setRectToInvalidate(const cc::IntRect&, FakeTiledLayerChromium*);
49 // Last rect passed to prepareToUpdate(). 48 // Last rect passed to prepareToUpdate().
50 const cc::IntRect& lastUpdateRect() const { return m_lastUpdateRect; } 49 const cc::IntRect& lastUpdateRect() const { return m_lastUpdateRect; }
51 50
52 // Number of times prepareToUpdate has been invoked. 51 // Number of times prepareToUpdate has been invoked.
53 int prepareCount() const { return m_prepareCount; } 52 int prepareCount() const { return m_prepareCount; }
54 void clearPrepareCount() { m_prepareCount = 0; } 53 void clearPrepareCount() { m_prepareCount = 0; }
55 54
56 // Number of times updateRect has been invoked. 55 // Number of times update() has been invoked on a texture.
57 int updateCount() const { return m_updateCount; } 56 int updateCount() const { return m_updateCount; }
58 void clearUpdateCount() { m_updateCount = 0; } 57 void clearUpdateCount() { m_updateCount = 0; }
59 void updateRect() { m_updateCount++; } 58 void update() { m_updateCount++; }
60
61 // Number of times prepareRect() has been invoked on a texture.
62 int prepareRectCount() const { return m_prepareRectCount; }
63 void clearPrepareRectCount() { m_prepareRectCount = 0; }
64 void prepareRect() { m_prepareRectCount++; }
65 59
66 void setOpaquePaintRect(const cc::IntRect& opaquePaintRect) { m_opaquePaintR ect = opaquePaintRect; } 60 void setOpaquePaintRect(const cc::IntRect& opaquePaintRect) { m_opaquePaintR ect = opaquePaintRect; }
67 61
68 private: 62 private:
69 int m_prepareCount; 63 int m_prepareCount;
70 int m_updateCount; 64 int m_updateCount;
71 int m_prepareRectCount;
72 cc::IntRect m_rectToInvalidate; 65 cc::IntRect m_rectToInvalidate;
73 cc::IntRect m_lastUpdateRect; 66 cc::IntRect m_lastUpdateRect;
74 cc::IntRect m_opaquePaintRect; 67 cc::IntRect m_opaquePaintRect;
75 scoped_refptr<FakeTiledLayerChromium> m_layer; 68 scoped_refptr<FakeTiledLayerChromium> m_layer;
76 }; 69 };
77 70
78 class FakeCCTiledLayerImpl : public cc::CCTiledLayerImpl { 71 class FakeCCTiledLayerImpl : public cc::CCTiledLayerImpl {
79 public: 72 public:
80 explicit FakeCCTiledLayerImpl(int id); 73 explicit FakeCCTiledLayerImpl(int id);
81 virtual ~FakeCCTiledLayerImpl(); 74 virtual ~FakeCCTiledLayerImpl();
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 class FakeTextureUploader : public cc::TextureUploader { 125 class FakeTextureUploader : public cc::TextureUploader {
133 public: 126 public:
134 virtual size_t numBlockingUploads() OVERRIDE; 127 virtual size_t numBlockingUploads() OVERRIDE;
135 virtual void markPendingUploadsAsNonBlocking() OVERRIDE; 128 virtual void markPendingUploadsAsNonBlocking() OVERRIDE;
136 virtual double estimatedTexturesPerSecond() OVERRIDE; 129 virtual double estimatedTexturesPerSecond() OVERRIDE;
137 virtual void uploadTexture(cc::CCResourceProvider*, Parameters) OVERRIDE; 130 virtual void uploadTexture(cc::CCResourceProvider*, Parameters) OVERRIDE;
138 }; 131 };
139 132
140 } 133 }
141 #endif // CCTiledLayerTestCommon_h 134 #endif // CCTiledLayerTestCommon_h
OLDNEW
« no previous file with comments | « cc/skpicture_canvas_layer_texture_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