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 const GrGpuCommandBuffer::LoadAndSto
reInfo&, |
307 GrColor colorClear, | 305 const GrGpuCommandBuffer::LoadAndSto
reInfo&) override { |
308 GrGpuCommandBuffer::LoadAndStoreOp s
tencilOp, | |
309 GrColor stencilClear) override { | |
310 return nullptr; | 306 return nullptr; |
311 } | 307 } |
312 | 308 |
313 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {}
; | 309 void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) override {}
; |
314 | 310 |
315 private: | 311 private: |
316 void onResetContext(uint32_t resetBits) override {} | 312 void onResetContext(uint32_t resetBits) override {} |
317 | 313 |
318 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} | 314 void xferBarrier(GrRenderTarget*, GrXferBarrierType) override {} |
319 | 315 |
(...skipping 16 matching lines...) Expand all Loading... |
336 } | 332 } |
337 | 333 |
338 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override { | 334 GrRenderTarget* onWrapBackendTextureAsRenderTarget(const GrBackendTextureDes
c&) override { |
339 return nullptr; | 335 return nullptr; |
340 } | 336 } |
341 | 337 |
342 GrBuffer* onCreateBuffer(size_t, GrBufferType, GrAccessPattern, const void*)
override { | 338 GrBuffer* onCreateBuffer(size_t, GrBufferType, GrAccessPattern, const void*)
override { |
343 return nullptr; | 339 return nullptr; |
344 } | 340 } |
345 | 341 |
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, | 342 bool onReadPixels(GrSurface* surface, |
356 int left, int top, int width, int height, | 343 int left, int top, int width, int height, |
357 GrPixelConfig, | 344 GrPixelConfig, |
358 void* buffer, | 345 void* buffer, |
359 size_t rowBytes) override { | 346 size_t rowBytes) override { |
360 return false; | 347 return false; |
361 } | 348 } |
362 | 349 |
363 bool onWritePixels(GrSurface* surface, | 350 bool onWritePixels(GrSurface* surface, |
364 int left, int top, int width, int height, | 351 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); | 393 SkASSERT(nullptr == fGpu); |
407 fGpu = new MockGpu(this, options); | 394 fGpu = new MockGpu(this, options); |
408 SkASSERT(fGpu); | 395 SkASSERT(fGpu); |
409 this->initCommon(options); | 396 this->initCommon(options); |
410 | 397 |
411 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 398 // 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 | 399 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
413 // resources in the buffer pools. | 400 // resources in the buffer pools. |
414 fDrawingManager->abandon(); | 401 fDrawingManager->abandon(); |
415 } | 402 } |
OLD | NEW |