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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment*, GrRenderTar
get*) override { | 228 bool attachStencilAttachmentToRenderTarget(GrStencilAttachment*, GrRenderTar
get*) override { |
229 return false; | 229 return false; |
230 } | 230 } |
231 | 231 |
232 void clearStencil(GrRenderTarget* target) override {} | 232 void clearStencil(GrRenderTarget* target) override {} |
233 | 233 |
234 void didAddGpuTraceMarker() override {} | 234 void didAddGpuTraceMarker() override {} |
235 | 235 |
236 void didRemoveGpuTraceMarker() override {} | 236 void didRemoveGpuTraceMarker() override {} |
237 | 237 |
238 GrBackendObject createBackendTexture(void* pixels, int w, int h, | 238 GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, |
239 GrPixelConfig config) const override {
return 0; } | 239 GrPixelConfig config) const
override { |
240 bool isBackendTexture(GrBackendObject id) const override { return false; } | 240 return 0; |
241 void deleteBackendTexture(GrBackendObject id) const override {} | 241 } |
| 242 bool isTestingOnlyBackendTexture(GrBackendObject id) const override { return
false; } |
| 243 void deleteTestingOnlyBackendTexture(GrBackendObject id) const override {} |
242 | 244 |
243 typedef GrGpu INHERITED; | 245 typedef GrGpu INHERITED; |
244 }; | 246 }; |
245 | 247 |
246 GrContext* GrContext::CreateMockContext() { | 248 GrContext* GrContext::CreateMockContext() { |
247 GrContext* context = SkNEW(GrContext); | 249 GrContext* context = SkNEW(GrContext); |
248 | 250 |
249 context->initMockContext(); | 251 context->initMockContext(); |
250 return context; | 252 return context; |
251 } | 253 } |
252 | 254 |
253 void GrContext::initMockContext() { | 255 void GrContext::initMockContext() { |
254 GrContextOptions options; | 256 GrContextOptions options; |
255 options.fGeometryBufferMapThreshold = 0; | 257 options.fGeometryBufferMapThreshold = 0; |
256 SkASSERT(NULL == fGpu); | 258 SkASSERT(NULL == fGpu); |
257 fGpu = SkNEW_ARGS(MockGpu, (this, options)); | 259 fGpu = SkNEW_ARGS(MockGpu, (this, options)); |
258 SkASSERT(fGpu); | 260 SkASSERT(fGpu); |
259 this->initCommon(); | 261 this->initCommon(); |
260 | 262 |
261 // 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 |
262 // 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 |
263 // resources in the buffer pools. | 265 // resources in the buffer pools. |
264 fDrawingMgr.abandon(); | 266 fDrawingMgr.abandon(); |
265 } | 267 } |
OLD | NEW |