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

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

Issue 10909020: Enable webkit_compositor_unittests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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/CCAnimationTestCommon.cpp ('k') | cc/test/CCTiledLayerTestCommon.cpp » ('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 22 matching lines...) Expand all
33 virtual void prepareRect(const WebCore::IntRect&, WebCore::CCRenderingSt ats&) OVERRIDE; 33 virtual void prepareRect(const WebCore::IntRect&, WebCore::CCRenderingSt ats&) OVERRIDE;
34 34
35 private: 35 private:
36 FakeLayerTextureUpdater* m_layer; 36 FakeLayerTextureUpdater* m_layer;
37 }; 37 };
38 38
39 FakeLayerTextureUpdater(); 39 FakeLayerTextureUpdater();
40 virtual ~FakeLayerTextureUpdater(); 40 virtual ~FakeLayerTextureUpdater();
41 41
42 virtual PassOwnPtr<WebCore::LayerTextureUpdater::Texture> createTexture(WebC ore::CCPrioritizedTextureManager*) OVERRIDE; 42 virtual PassOwnPtr<WebCore::LayerTextureUpdater::Texture> createTexture(WebC ore::CCPrioritizedTextureManager*) OVERRIDE;
43 virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE { return Sa mpledTexelFormatRGBA; } 43 virtual SampledTexelFormat sampledTexelFormat(GC3Denum) OVERRIDE;
44 44
45 virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebC ore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect, WebCore::CCR enderingStats&) OVERRIDE; 45 virtual void prepareToUpdate(const WebCore::IntRect& contentRect, const WebC ore::IntSize&, float, float, WebCore::IntRect& resultingOpaqueRect, WebCore::CCR enderingStats&) OVERRIDE;
46 // Sets the rect to invalidate during the next call to prepareToUpdate(). Af ter the next 46 // Sets the rect to invalidate during the next call to prepareToUpdate(). Af ter the next
47 // call to prepareToUpdate() the rect is reset. 47 // call to prepareToUpdate() the rect is reset.
48 void setRectToInvalidate(const WebCore::IntRect&, FakeTiledLayerChromium*); 48 void setRectToInvalidate(const WebCore::IntRect&, FakeTiledLayerChromium*);
49 // Last rect passed to prepareToUpdate(). 49 // Last rect passed to prepareToUpdate().
50 const WebCore::IntRect& lastUpdateRect() const { return m_lastUpdateRect; } 50 const WebCore::IntRect& lastUpdateRect() const { return m_lastUpdateRect; }
51 51
52 // Number of times prepareToUpdate has been invoked. 52 // Number of times prepareToUpdate has been invoked.
53 int prepareCount() const { return m_prepareCount; } 53 int prepareCount() const { return m_prepareCount; }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 using WebCore::TiledLayerChromium::needsIdlePaint; 95 using WebCore::TiledLayerChromium::needsIdlePaint;
96 using WebCore::TiledLayerChromium::skipsDraw; 96 using WebCore::TiledLayerChromium::skipsDraw;
97 using WebCore::TiledLayerChromium::numPaintedTiles; 97 using WebCore::TiledLayerChromium::numPaintedTiles;
98 using WebCore::TiledLayerChromium::idlePaintRect; 98 using WebCore::TiledLayerChromium::idlePaintRect;
99 99
100 virtual void setNeedsDisplayRect(const WebCore::FloatRect&) OVERRIDE; 100 virtual void setNeedsDisplayRect(const WebCore::FloatRect&) OVERRIDE;
101 const WebCore::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsD isplayRect; } 101 const WebCore::FloatRect& lastNeedsDisplayRect() const { return m_lastNeedsD isplayRect; }
102 102
103 virtual void setTexturePriorities(const WebCore::CCPriorityCalculator&) OVER RIDE; 103 virtual void setTexturePriorities(const WebCore::CCPriorityCalculator&) OVER RIDE;
104 104
105 virtual WebCore::CCPrioritizedTextureManager* textureManager() const OVERRID E { return m_textureManager; } 105 virtual WebCore::CCPrioritizedTextureManager* textureManager() const OVERRID E;
106 FakeLayerTextureUpdater* fakeLayerTextureUpdater() { return m_fakeTextureUpd ater.get(); } 106 FakeLayerTextureUpdater* fakeLayerTextureUpdater() { return m_fakeTextureUpd ater.get(); }
107 WebCore::FloatRect updateRect() { return m_updateRect; } 107 WebCore::FloatRect updateRect() { return m_updateRect; }
108 108
109 protected: 109 protected:
110 virtual WebCore::LayerTextureUpdater* textureUpdater() const OVERRIDE { retu rn m_fakeTextureUpdater.get(); } 110 virtual WebCore::LayerTextureUpdater* textureUpdater() const OVERRIDE;
111 virtual void createTextureUpdaterIfNeeded() OVERRIDE { } 111 virtual void createTextureUpdaterIfNeeded() OVERRIDE { }
112 112
113 private: 113 private:
114 RefPtr<FakeLayerTextureUpdater> m_fakeTextureUpdater; 114 RefPtr<FakeLayerTextureUpdater> m_fakeTextureUpdater;
115 WebCore::CCPrioritizedTextureManager* m_textureManager; 115 WebCore::CCPrioritizedTextureManager* m_textureManager;
116 WebCore::FloatRect m_lastNeedsDisplayRect; 116 WebCore::FloatRect m_lastNeedsDisplayRect;
117 }; 117 };
118 118
119 class FakeTiledLayerWithScaledBounds : public FakeTiledLayerChromium { 119 class FakeTiledLayerWithScaledBounds : public FakeTiledLayerChromium {
120 public: 120 public:
121 explicit FakeTiledLayerWithScaledBounds(WebCore::CCPrioritizedTextureManager *); 121 explicit FakeTiledLayerWithScaledBounds(WebCore::CCPrioritizedTextureManager *);
122 122
123 void setContentBounds(const WebCore::IntSize& contentBounds) { m_forcedConte ntBounds = contentBounds; } 123 void setContentBounds(const WebCore::IntSize& contentBounds) { m_forcedConte ntBounds = contentBounds; }
124 virtual WebCore::IntSize contentBounds() const OVERRIDE { return m_forcedCon tentBounds; } 124 virtual WebCore::IntSize contentBounds() const OVERRIDE;
125 125
126 protected: 126 protected:
127 WebCore::IntSize m_forcedContentBounds; 127 WebCore::IntSize m_forcedContentBounds;
128 }; 128 };
129 129
130 class FakeTextureCopier : public WebCore::TextureCopier { 130 class FakeTextureCopier : public WebCore::TextureCopier {
131 public: 131 public:
132 virtual void copyTexture(Parameters) { } 132 virtual void copyTexture(Parameters) OVERRIDE { }
133 virtual void flush() { } 133 virtual void flush() OVERRIDE { }
134 }; 134 };
135 135
136 class FakeTextureUploader : public WebCore::TextureUploader { 136 class FakeTextureUploader : public WebCore::TextureUploader {
137 public: 137 public:
138 virtual bool isBusy() { return false; } 138 virtual bool isBusy() OVERRIDE;
139 virtual void beginUploads() { } 139 virtual void beginUploads() OVERRIDE { }
140 virtual void endUploads() { } 140 virtual void endUploads() OVERRIDE { }
141 virtual void uploadTexture(WebCore::CCResourceProvider* resourceProvider, Pa rameters upload) { upload.texture->updateRect(resourceProvider, upload.sourceRec t, upload.destOffset); } 141 virtual void uploadTexture(WebCore::CCResourceProvider*, Parameters upload) OVERRIDE;
142 }; 142 };
143 143
144 } 144 }
145 #endif // CCTiledLayerTestCommon_h 145 #endif // CCTiledLayerTestCommon_h
OLDNEW
« no previous file with comments | « cc/test/CCAnimationTestCommon.cpp ('k') | cc/test/CCTiledLayerTestCommon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698