OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrTest.h" | 8 #include "GrTest.h" |
9 | 9 |
10 #include "GrBatchAtlas.h" | 10 #include "GrBatchAtlas.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 ~MockGpu() override {} | 277 ~MockGpu() override {} |
278 | 278 |
279 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, | 279 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh
t, size_t rowBytes, |
280 GrPixelConfig readConfig, DrawPreference*, | 280 GrPixelConfig readConfig, DrawPreference*, |
281 ReadPixelTempDrawInfo*) override { return false; } | 281 ReadPixelTempDrawInfo*) override { return false; } |
282 | 282 |
283 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, | 283 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, |
284 GrPixelConfig srcConfig, DrawPreference*, | 284 GrPixelConfig srcConfig, DrawPreference*, |
285 WritePixelTempDrawInfo*) override { return false;
} | 285 WritePixelTempDrawInfo*) override { return false;
} |
286 | 286 |
287 void discard(GrRenderTarget*) override {} | |
288 | |
289 bool onCopySurface(GrSurface* dst, | 287 bool onCopySurface(GrSurface* dst, |
290 GrSurface* src, | 288 GrSurface* src, |
291 const SkIRect& srcRect, | 289 const SkIRect& srcRect, |
292 const SkIPoint& dstPoint) override { return false; }; | 290 const SkIPoint& dstPoint) override { return false; }; |
293 | 291 |
294 void onGetMultisampleSpecs(GrRenderTarget* rt, | 292 void onGetMultisampleSpecs(GrRenderTarget* rt, |
295 const GrStencilSettings&, | 293 const GrStencilSettings&, |
296 int* effectiveSampleCnt, | 294 int* effectiveSampleCnt, |
297 SkAutoTDeleteArray<SkPoint>*) override { | 295 SkAutoTDeleteArray<SkPoint>*) override { |
298 *effectiveSampleCnt = rt->desc().fSampleCnt; | 296 *effectiveSampleCnt = rt->desc().fSampleCnt; |
299 } | 297 } |
300 | 298 |
301 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const
override { | 299 bool initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) const
override { |
302 return false; | 300 return false; |
303 } | 301 } |
304 | 302 |
305 GrGpuCommandBuffer* createCommandBuffer(const GrRenderTarget& target, | 303 GrGpuCommandBuffer* createCommandBuffer(GrRenderTarget* target, |
306 GrGpuCommandBuffer::LoadAndStoreOp c
olorOp, | 304 GrGpuCommandBuffer::LoadAndStoreOp c
olorOp, |
307 GrColor colorClear, | 305 GrColor colorClear, |
308 GrGpuCommandBuffer::LoadAndStoreOp s
tencilOp, | 306 GrGpuCommandBuffer::LoadAndStoreOp s
tencilOp, |
309 GrColor stencilClear) override { | 307 GrColor stencilClear) override { |
310 return nullptr; | 308 return nullptr; |
311 } | 309 } |
312 | 310 |
313 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {}
; | 311 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {}
; |
314 | 312 |
315 private: | 313 private: |
(...skipping 20 matching lines...) Expand all Loading... |
336 } | 334 } |
337 | 335 |
338 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override { | 336 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override { |
339 return nullptr; | 337 return nullptr; |
340 } | 338 } |
341 | 339 |
342 GrBuffer* onCreateBuffer(size_t, GrBufferType, GrAccessPattern, const void*)
override { | 340 GrBuffer* onCreateBuffer(size_t, GrBufferType, GrAccessPattern, const void*)
override { |
343 return nullptr; | 341 return nullptr; |
344 } | 342 } |
345 | 343 |
346 void onClear(GrRenderTarget*, const SkIRect& rect, GrColor color) override {
} | |
347 | |
348 void onClearStencilClip(GrRenderTarget*, const SkIRect& rect, bool insideCli
p) override {} | |
349 | |
350 void onDraw(const GrPipeline&, | |
351 const GrPrimitiveProcessor&, | |
352 const GrMesh*, | |
353 int meshCount) override {} | |
354 | |
355 bool onReadPixels(GrSurface* surface, | 344 bool onReadPixels(GrSurface* surface, |
356 int left, int top, int width, int height, | 345 int left, int top, int width, int height, |
357 GrPixelConfig, | 346 GrPixelConfig, |
358 void* buffer, | 347 void* buffer, |
359 size_t rowBytes) override { | 348 size_t rowBytes) override { |
360 return false; | 349 return false; |
361 } | 350 } |
362 | 351 |
363 bool onWritePixels(GrSurface* surface, | 352 bool onWritePixels(GrSurface* surface, |
364 int left, int top, int width, int height, | 353 int left, int top, int width, int height, |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 SkASSERT(nullptr == fGpu); | 395 SkASSERT(nullptr == fGpu); |
407 fGpu = new MockGpu(this, options); | 396 fGpu = new MockGpu(this, options); |
408 SkASSERT(fGpu); | 397 SkASSERT(fGpu); |
409 this->initCommon(options); | 398 this->initCommon(options); |
410 | 399 |
411 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 400 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
412 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 401 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
413 // resources in the buffer pools. | 402 // resources in the buffer pools. |
414 fDrawingManager->abandon(); | 403 fDrawingManager->abandon(); |
415 } | 404 } |
OLD | NEW |