OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #include "GrTest.h" | 9 #include "GrTest.h" |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 class MockGpu : public GrGpu { | 143 class MockGpu : public GrGpu { |
144 public: | 144 public: |
145 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con
text) { | 145 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con
text) { |
146 fCaps.reset(SkNEW_ARGS(GrCaps, (options))); | 146 fCaps.reset(SkNEW_ARGS(GrCaps, (options))); |
147 } | 147 } |
148 ~MockGpu() override {} | 148 ~MockGpu() override {} |
149 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const
override { | 149 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const
override { |
150 return true; | 150 return true; |
151 } | 151 } |
152 | 152 |
153 bool readPixelsWillPayForYFlip(GrRenderTarget* renderTarget, | 153 bool getReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight,
size_t rowBytes, |
154 int left, int top, | 154 GrPixelConfig readConfig, DrawPreference*, |
155 int width, int height, | 155 ReadPixelTempDrawInfo*) override { return false; } |
156 GrPixelConfig config, | 156 |
157 size_t rowBytes) const override { return fals
e; } | |
158 void buildProgramDesc(GrProgramDesc*,const GrPrimitiveProcessor&, | 157 void buildProgramDesc(GrProgramDesc*,const GrPrimitiveProcessor&, |
159 const GrPipeline&, | 158 const GrPipeline&, |
160 const GrBatchTracker&) const override {} | 159 const GrBatchTracker&) const override {} |
161 | 160 |
162 void discard(GrRenderTarget*) override {} | 161 void discard(GrRenderTarget*) override {} |
163 | 162 |
164 bool copySurface(GrSurface* dst, | 163 bool copySurface(GrSurface* dst, |
165 GrSurface* src, | 164 GrSurface* src, |
166 const SkIRect& srcRect, | 165 const SkIRect& srcRect, |
167 const SkIPoint& dstPoint) override { return false; }; | 166 const SkIPoint& dstPoint) override { return false; }; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 SkASSERT(NULL == fGpu); | 257 SkASSERT(NULL == fGpu); |
259 fGpu = SkNEW_ARGS(MockGpu, (this, options)); | 258 fGpu = SkNEW_ARGS(MockGpu, (this, options)); |
260 SkASSERT(fGpu); | 259 SkASSERT(fGpu); |
261 this->initCommon(); | 260 this->initCommon(); |
262 | 261 |
263 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 262 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
264 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 263 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
265 // resources in the buffer pools. | 264 // resources in the buffer pools. |
266 fDrawingMgr.abandon(); | 265 fDrawingMgr.abandon(); |
267 } | 266 } |
OLD | NEW |