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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 return false; | 206 return false; |
207 } | 207 } |
208 | 208 |
209 private: | 209 private: |
210 void onResetContext(uint32_t resetBits) override {} | 210 void onResetContext(uint32_t resetBits) override {} |
211 | 211 |
212 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} | 212 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} |
213 | 213 |
214 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, | 214 GrTexture* onCreateTexture(const GrSurfaceDesc& desc, GrGpuResource::LifeCyc
le lifeCycle, |
215 const void* srcData, size_t rowBytes) override { | 215 const void* srcData, size_t rowBytes) override { |
216 return NULL; | 216 return nullptr; |
217 } | 217 } |
218 | 218 |
219 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, GrGpuResourc
e::LifeCycle, | 219 GrTexture* onCreateCompressedTexture(const GrSurfaceDesc& desc, GrGpuResourc
e::LifeCycle, |
220 const void* srcData) override { | 220 const void* srcData) override { |
221 return NULL; | 221 return nullptr; |
222 } | 222 } |
223 | 223 |
224 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, | 224 GrTexture* onWrapBackendTexture(const GrBackendTextureDesc&, |
225 GrWrapOwnership) override { return NULL; } | 225 GrWrapOwnership) override { return nullptr;
} |
226 | 226 |
227 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, | 227 GrRenderTarget* onWrapBackendRenderTarget(const GrBackendRenderTargetDesc&, |
228 GrWrapOwnership) override { | 228 GrWrapOwnership) override { |
229 return NULL; | 229 return nullptr; |
230 } | 230 } |
231 | 231 |
232 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override { r
eturn NULL; } | 232 GrVertexBuffer* onCreateVertexBuffer(size_t size, bool dynamic) override { r
eturn nullptr; } |
233 | 233 |
234 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override { ret
urn NULL; } | 234 GrIndexBuffer* onCreateIndexBuffer(size_t size, bool dynamic) override { ret
urn nullptr; } |
235 | 235 |
236 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override {
} | 236 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override {
} |
237 | 237 |
238 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override {} | 238 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override {} |
239 | 239 |
240 void onDraw(const DrawArgs&, const GrNonInstancedVertices&) override {} | 240 void onDraw(const DrawArgs&, const GrNonInstancedVertices&) override {} |
241 | 241 |
242 bool onReadPixels(GrSurface* surface, | 242 bool onReadPixels(GrSurface* surface, |
243 int left, int top, int width, int height, | 243 int left, int top, int width, int height, |
244 GrPixelConfig, | 244 GrPixelConfig, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 GrContext* GrContext::CreateMockContext() { | 283 GrContext* GrContext::CreateMockContext() { |
284 GrContext* context = new GrContext; | 284 GrContext* context = new GrContext; |
285 | 285 |
286 context->initMockContext(); | 286 context->initMockContext(); |
287 return context; | 287 return context; |
288 } | 288 } |
289 | 289 |
290 void GrContext::initMockContext() { | 290 void GrContext::initMockContext() { |
291 GrContextOptions options; | 291 GrContextOptions options; |
292 options.fGeometryBufferMapThreshold = 0; | 292 options.fGeometryBufferMapThreshold = 0; |
293 SkASSERT(NULL == fGpu); | 293 SkASSERT(nullptr == fGpu); |
294 fGpu = new MockGpu(this, options); | 294 fGpu = new MockGpu(this, options); |
295 SkASSERT(fGpu); | 295 SkASSERT(fGpu); |
296 this->initCommon(); | 296 this->initCommon(); |
297 | 297 |
298 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 298 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
299 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 299 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
300 // resources in the buffer pools. | 300 // resources in the buffer pools. |
301 fDrawingMgr.abandon(); | 301 fDrawingMgr.abandon(); |
302 } | 302 } |
OLD | NEW |