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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 Stats() { this->reset(); } | 400 Stats() { this->reset(); } |
401 | 401 |
402 void reset() { | 402 void reset() { |
403 fRenderTargetBinds = 0; | 403 fRenderTargetBinds = 0; |
404 fShaderCompilations = 0; | 404 fShaderCompilations = 0; |
405 fTextureCreates = 0; | 405 fTextureCreates = 0; |
406 fTextureUploads = 0; | 406 fTextureUploads = 0; |
407 fTransfersToTexture = 0; | 407 fTransfersToTexture = 0; |
408 fStencilAttachmentCreates = 0; | 408 fStencilAttachmentCreates = 0; |
409 fNumDraws = 0; | 409 fNumDraws = 0; |
| 410 fNumFailedDraws = 0; |
410 } | 411 } |
411 | 412 |
412 int renderTargetBinds() const { return fRenderTargetBinds; } | 413 int renderTargetBinds() const { return fRenderTargetBinds; } |
413 void incRenderTargetBinds() { fRenderTargetBinds++; } | 414 void incRenderTargetBinds() { fRenderTargetBinds++; } |
414 int shaderCompilations() const { return fShaderCompilations; } | 415 int shaderCompilations() const { return fShaderCompilations; } |
415 void incShaderCompilations() { fShaderCompilations++; } | 416 void incShaderCompilations() { fShaderCompilations++; } |
416 int textureCreates() const { return fTextureCreates; } | 417 int textureCreates() const { return fTextureCreates; } |
417 void incTextureCreates() { fTextureCreates++; } | 418 void incTextureCreates() { fTextureCreates++; } |
418 int textureUploads() const { return fTextureUploads; } | 419 int textureUploads() const { return fTextureUploads; } |
419 void incTextureUploads() { fTextureUploads++; } | 420 void incTextureUploads() { fTextureUploads++; } |
420 int transfersToTexture() const { return fTransfersToTexture; } | 421 int transfersToTexture() const { return fTransfersToTexture; } |
421 void incTransfersToTexture() { fTransfersToTexture++; } | 422 void incTransfersToTexture() { fTransfersToTexture++; } |
422 void incStencilAttachmentCreates() { fStencilAttachmentCreates++; } | 423 void incStencilAttachmentCreates() { fStencilAttachmentCreates++; } |
423 void incNumDraws() { fNumDraws++; } | 424 void incNumDraws() { fNumDraws++; } |
| 425 void incNumFailedDraws() { ++fNumFailedDraws; } |
424 void dump(SkString*); | 426 void dump(SkString*); |
425 void dumpKeyValuePairs(SkTArray<SkString>* keys, SkTArray<double>* value
s); | 427 void dumpKeyValuePairs(SkTArray<SkString>* keys, SkTArray<double>* value
s); |
426 | 428 int numDraws() const { return fNumDraws; } |
| 429 int numFailedDraws() const { return fNumFailedDraws; } |
427 private: | 430 private: |
428 int fRenderTargetBinds; | 431 int fRenderTargetBinds; |
429 int fShaderCompilations; | 432 int fShaderCompilations; |
430 int fTextureCreates; | 433 int fTextureCreates; |
431 int fTextureUploads; | 434 int fTextureUploads; |
432 int fTransfersToTexture; | 435 int fTransfersToTexture; |
433 int fStencilAttachmentCreates; | 436 int fStencilAttachmentCreates; |
434 int fNumDraws; | 437 int fNumDraws; |
| 438 int fNumFailedDraws; |
435 #else | 439 #else |
436 void dump(SkString*) {} | 440 void dump(SkString*) {} |
437 void dumpKeyValuePairs(SkTArray<SkString>*, SkTArray<double>*) {} | 441 void dumpKeyValuePairs(SkTArray<SkString>*, SkTArray<double>*) {} |
438 void incRenderTargetBinds() {} | 442 void incRenderTargetBinds() {} |
439 void incShaderCompilations() {} | 443 void incShaderCompilations() {} |
440 void incTextureCreates() {} | 444 void incTextureCreates() {} |
441 void incTextureUploads() {} | 445 void incTextureUploads() {} |
442 void incTransfersToTexture() {} | 446 void incTransfersToTexture() {} |
443 void incStencilAttachmentCreates() {} | 447 void incStencilAttachmentCreates() {} |
444 void incNumDraws() {} | 448 void incNumDraws() {} |
| 449 void incNumFailedDraws() {} |
445 #endif | 450 #endif |
446 }; | 451 }; |
447 | 452 |
448 Stats* stats() { return &fStats; } | 453 Stats* stats() { return &fStats; } |
449 | 454 |
450 /** Creates a texture directly in the backend API without wrapping it in a G
rTexture. This is | 455 /** Creates a texture directly in the backend API without wrapping it in a G
rTexture. This is |
451 only to be used for testing (particularly for testing the methods that i
mport an externally | 456 only to be used for testing (particularly for testing the methods that i
mport an externally |
452 created texture into Skia. Must be matched with a call to deleteTestingO
nlyTexture(). */ | 457 created texture into Skia. Must be matched with a call to deleteTestingO
nlyTexture(). */ |
453 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w,
int h, | 458 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w,
int h, |
454 GrPixelConfig config
) = 0; | 459 GrPixelConfig config
) = 0; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; | 631 SkTArray<const MultisampleSpecs*, true> fMultisa
mpleSpecsMap; |
627 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; | 632 GrTAllocator<MultisampleSpecs> fMultisa
mpleSpecsAllocator; |
628 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 633 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
629 GrContext* fContext
; | 634 GrContext* fContext
; |
630 | 635 |
631 friend class GrPathRendering; | 636 friend class GrPathRendering; |
632 typedef SkRefCnt INHERITED; | 637 typedef SkRefCnt INHERITED; |
633 }; | 638 }; |
634 | 639 |
635 #endif | 640 #endif |
OLD | NEW |