| 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 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 #include "GrGpu.h" | 139 #include "GrGpu.h" |
| 140 | 140 |
| 141 class GrPipeline; | 141 class GrPipeline; |
| 142 | 142 |
| 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 { | |
| 150 return true; | |
| 151 } | |
| 152 | 149 |
| 153 bool getReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight,
size_t rowBytes, | 150 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, |
| 154 GrPixelConfig readConfig, DrawPreference*, | 151 GrPixelConfig readConfig, DrawPreference*, |
| 155 ReadPixelTempDrawInfo*) override { return false; } | 152 ReadPixelTempDrawInfo*) override { return false; } |
| 153 |
| 154 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, size
_t rowBytes, |
| 155 GrPixelConfig srcConfig, DrawPreference*, |
| 156 WritePixelTempDrawInfo*) override { return false;
} |
| 156 | 157 |
| 157 void buildProgramDesc(GrProgramDesc*,const GrPrimitiveProcessor&, | 158 void buildProgramDesc(GrProgramDesc*,const GrPrimitiveProcessor&, |
| 158 const GrPipeline&, | 159 const GrPipeline&, |
| 159 const GrBatchTracker&) const override {} | 160 const GrBatchTracker&) const override {} |
| 160 | 161 |
| 161 void discard(GrRenderTarget*) override {} | 162 void discard(GrRenderTarget*) override {} |
| 162 | 163 |
| 163 bool copySurface(GrSurface* dst, | 164 bool copySurface(GrSurface* dst, |
| 164 GrSurface* src, | 165 GrSurface* src, |
| 165 const SkIRect& srcRect, | 166 const SkIRect& srcRect, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 SkASSERT(NULL == fGpu); | 258 SkASSERT(NULL == fGpu); |
| 258 fGpu = SkNEW_ARGS(MockGpu, (this, options)); | 259 fGpu = SkNEW_ARGS(MockGpu, (this, options)); |
| 259 SkASSERT(fGpu); | 260 SkASSERT(fGpu); |
| 260 this->initCommon(); | 261 this->initCommon(); |
| 261 | 262 |
| 262 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 263 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 263 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 264 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 264 // resources in the buffer pools. | 265 // resources in the buffer pools. |
| 265 fDrawingMgr.abandon(); | 266 fDrawingMgr.abandon(); |
| 266 } | 267 } |
| OLD | NEW |