OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 * surface or using it as a texture. | 507 * surface or using it as a texture. |
508 */ | 508 */ |
509 void prepareSurfaceForExternalRead(GrSurface*); | 509 void prepareSurfaceForExternalRead(GrSurface*); |
510 | 510 |
511 /** | 511 /** |
512 * Provides a perfomance hint that the render target's contents are allowed | 512 * Provides a perfomance hint that the render target's contents are allowed |
513 * to become undefined. | 513 * to become undefined. |
514 */ | 514 */ |
515 void discardRenderTarget(GrRenderTarget*); | 515 void discardRenderTarget(GrRenderTarget*); |
516 | 516 |
| 517 /** |
| 518 * An ID associated with this context, guaranteed to be unique. |
| 519 */ |
| 520 uint32_t uniqueID() { return fUniqueID; } |
| 521 |
517 /////////////////////////////////////////////////////////////////////////// | 522 /////////////////////////////////////////////////////////////////////////// |
518 // Legacy functions, to be removed once Chromium stops using them. | 523 // Legacy functions, to be removed once Chromium stops using them. |
519 | 524 |
520 enum ScratchTexMatch { | 525 enum ScratchTexMatch { |
521 kExact_ScratchTexMatch = GrTextureProvider::kExact_ScratchTexMatch, | 526 kExact_ScratchTexMatch = GrTextureProvider::kExact_ScratchTexMatch, |
522 kApprox_ScratchTexMatch = GrTextureProvider::kApprox_ScratchTexMatch | 527 kApprox_ScratchTexMatch = GrTextureProvider::kApprox_ScratchTexMatch |
523 }; | 528 }; |
524 | 529 |
525 GrTexture* refScratchTexture(const GrSurfaceDesc& desc, ScratchTexMatch matc
h) { | 530 GrTexture* refScratchTexture(const GrSurfaceDesc& desc, ScratchTexMatch matc
h) { |
526 return this->textureProvider()->refScratchTexture( | 531 return this->textureProvider()->refScratchTexture( |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 struct CleanUpData { | 612 struct CleanUpData { |
608 PFCleanUpFunc fFunc; | 613 PFCleanUpFunc fFunc; |
609 void* fInfo; | 614 void* fInfo; |
610 }; | 615 }; |
611 | 616 |
612 SkTDArray<CleanUpData> fCleanUpData; | 617 SkTDArray<CleanUpData> fCleanUpData; |
613 | 618 |
614 int fMaxTextureSizeOverride; | 619 int fMaxTextureSizeOverride; |
615 | 620 |
616 const Options fOptions; | 621 const Options fOptions; |
| 622 const uint32_t fUniqueID; |
617 | 623 |
618 GrContext(const Options&); // init must be called after the constructor. | 624 GrContext(const Options&); // init must be called after the constructor. |
619 bool init(GrBackend, GrBackendContext); | 625 bool init(GrBackend, GrBackendContext); |
620 void initMockContext(); | 626 void initMockContext(); |
621 void initCommon(); | 627 void initCommon(); |
622 | 628 |
623 void setupDrawBuffer(); | 629 void setupDrawBuffer(); |
624 | 630 |
625 class AutoCheckFlush; | 631 class AutoCheckFlush; |
626 // Sets the paint and returns the target to draw into. | 632 // Sets the paint and returns the target to draw into. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 */ | 681 */ |
676 static void TextBlobCacheOverBudgetCB(void* data); | 682 static void TextBlobCacheOverBudgetCB(void* data); |
677 | 683 |
678 // TODO see note on createTextContext | 684 // TODO see note on createTextContext |
679 friend class SkGpuDevice; | 685 friend class SkGpuDevice; |
680 | 686 |
681 typedef SkRefCnt INHERITED; | 687 typedef SkRefCnt INHERITED; |
682 }; | 688 }; |
683 | 689 |
684 #endif | 690 #endif |
OLD | NEW |