OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 #ifndef GrGpu_DEFINED | 8 #ifndef GrGpu_DEFINED |
9 #define GrGpu_DEFINED | 9 #define GrGpu_DEFINED |
10 | 10 |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 void incShaderCompilations() {} | 356 void incShaderCompilations() {} |
357 void incTextureCreates() {} | 357 void incTextureCreates() {} |
358 void incTextureUploads() {} | 358 void incTextureUploads() {} |
359 void incStencilAttachmentCreates() {} | 359 void incStencilAttachmentCreates() {} |
360 void incNumDraws() {} | 360 void incNumDraws() {} |
361 #endif | 361 #endif |
362 }; | 362 }; |
363 | 363 |
364 Stats* stats() { return &fStats; } | 364 Stats* stats() { return &fStats; } |
365 | 365 |
366 // creation and deletion of raw texture for testing | 366 /** Creates a texture directly in the backend API without wrapping it in a G
rTexture. This is |
367 // only to be used in GPU-specific tests | 367 only to be used for testing (particularly for testing the methods that i
mport an externally |
| 368 created texture into Skia. Must be matched with a call to deleteTestingO
nlyTexture(). */ |
368 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w,
int h, | 369 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w,
int h, |
369 GrPixelConfig config
) const = 0; | 370 GrPixelConfig config
) const = 0; |
370 virtual bool isTestingOnlyBackendTexture(GrBackendObject id) const = 0; | 371 /** Check a handle represents an actual texture in the backend API that has
not been freed. */ |
371 virtual void deleteTestingOnlyBackendTexture(GrBackendObject id) const = 0; | 372 virtual bool isTestingOnlyBackendTexture(GrBackendObject) const = 0; |
| 373 /** If ownership of the backend texture has been transferred pass true for a
bandonTexture. This |
| 374 will do any necessary cleanup of the handle without freeing the texture
in the backend |
| 375 API. */ |
| 376 virtual void deleteTestingOnlyBackendTexture(GrBackendObject, |
| 377 bool abandonTexture = false) co
nst = 0; |
372 | 378 |
373 // width and height may be larger than rt (if underlying API allows it). | 379 // width and height may be larger than rt (if underlying API allows it). |
374 // Returns nullptr if compatible sb could not be created, otherwise the call
er owns the ref on | 380 // Returns nullptr if compatible sb could not be created, otherwise the call
er owns the ref on |
375 // the GrStencilAttachment. | 381 // the GrStencilAttachment. |
376 virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const Gr
RenderTarget*, | 382 virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const Gr
RenderTarget*, |
377 int widt
h, | 383 int widt
h, |
378 int heig
ht) = 0; | 384 int heig
ht) = 0; |
379 // clears target's entire stencil buffer to 0 | 385 // clears target's entire stencil buffer to 0 |
380 virtual void clearStencil(GrRenderTarget* target) = 0; | 386 virtual void clearStencil(GrRenderTarget* target) = 0; |
381 | 387 |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 ResetTimestamp fResetTi
mestamp; | 501 ResetTimestamp fResetTi
mestamp; |
496 uint32_t fResetBi
ts; | 502 uint32_t fResetBi
ts; |
497 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 503 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
498 GrContext* fContext
; | 504 GrContext* fContext
; |
499 | 505 |
500 friend class GrPathRendering; | 506 friend class GrPathRendering; |
501 typedef SkRefCnt INHERITED; | 507 typedef SkRefCnt INHERITED; |
502 }; | 508 }; |
503 | 509 |
504 #endif | 510 #endif |
OLD | NEW |