Chromium Code Reviews| 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 |
| 11 #include "GrClip.h" | 11 #include "GrClip.h" |
| 12 #include "GrColor.h" | 12 #include "GrColor.h" |
| 13 #include "GrPaint.h" | 13 #include "GrPaint.h" |
| 14 #include "GrPathRendererChain.h" | 14 #include "GrPathRendererChain.h" |
| 15 #include "GrRenderTarget.h" | 15 #include "GrRenderTarget.h" |
| 16 #include "GrTexture.h" | 16 #include "GrTexture.h" |
| 17 #include "SkMatrix.h" | 17 #include "SkMatrix.h" |
| 18 #include "SkPathEffect.h" | 18 #include "SkPathEffect.h" |
| 19 #include "SkTypes.h" | 19 #include "SkTypes.h" |
| 20 | 20 |
| 21 class GrAARectRenderer; | 21 class GrAARectRenderer; |
| 22 class GrBatchFontCache; | |
| 22 class GrDrawTarget; | 23 class GrDrawTarget; |
| 23 class GrFontCache; | 24 class GrFontCache; |
| 24 class GrFragmentProcessor; | 25 class GrFragmentProcessor; |
| 25 class GrGpu; | 26 class GrGpu; |
| 26 class GrGpuTraceMarker; | 27 class GrGpuTraceMarker; |
| 27 class GrIndexBuffer; | 28 class GrIndexBuffer; |
| 28 class GrIndexBufferAllocPool; | 29 class GrIndexBufferAllocPool; |
| 29 class GrInOrderDrawBuffer; | 30 class GrInOrderDrawBuffer; |
| 30 class GrLayerCache; | 31 class GrLayerCache; |
| 31 class GrOvalRenderer; | 32 class GrOvalRenderer; |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 647 void discardRenderTarget(GrRenderTarget*); | 648 void discardRenderTarget(GrRenderTarget*); |
| 648 | 649 |
| 649 #ifdef SK_DEVELOPER | 650 #ifdef SK_DEVELOPER |
| 650 void dumpFontCache() const; | 651 void dumpFontCache() const; |
| 651 #endif | 652 #endif |
| 652 | 653 |
| 653 /////////////////////////////////////////////////////////////////////////// | 654 /////////////////////////////////////////////////////////////////////////// |
| 654 // Functions intended for internal use only. | 655 // Functions intended for internal use only. |
| 655 GrGpu* getGpu() { return fGpu; } | 656 GrGpu* getGpu() { return fGpu; } |
| 656 const GrGpu* getGpu() const { return fGpu; } | 657 const GrGpu* getGpu() const { return fGpu; } |
| 658 GrBatchFontCache* getBatchFontCache() { return fBatchFontCache; } | |
| 657 GrFontCache* getFontCache() { return fFontCache; } | 659 GrFontCache* getFontCache() { return fFontCache; } |
| 658 GrLayerCache* getLayerCache() { return fLayerCache.get(); } | 660 GrLayerCache* getLayerCache() { return fLayerCache.get(); } |
| 659 GrDrawTarget* getTextTarget(); | 661 GrDrawTarget* getTextTarget(); |
| 660 const GrIndexBuffer* getQuadIndexBuffer() const; | 662 const GrIndexBuffer* getQuadIndexBuffer() const; |
| 661 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } | 663 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } |
| 662 GrResourceCache* getResourceCache() { return fResourceCache; } | 664 GrResourceCache* getResourceCache() { return fResourceCache; } |
| 663 | 665 |
| 664 // Called by tests that draw directly to the context via GrDrawTarget | 666 // Called by tests that draw directly to the context via GrDrawTarget |
| 665 void getTestTarget(GrTestTarget*); | 667 void getTestTarget(GrTestTarget*); |
| 666 | 668 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 688 void printCacheStats() const; | 690 void printCacheStats() const; |
| 689 | 691 |
| 690 /** Prints GPU stats to the string if GR_GPU_STATS == 1. */ | 692 /** Prints GPU stats to the string if GR_GPU_STATS == 1. */ |
| 691 void dumpGpuStats(SkString*) const; | 693 void dumpGpuStats(SkString*) const; |
| 692 void printGpuStats() const; | 694 void printGpuStats() const; |
| 693 | 695 |
| 694 private: | 696 private: |
| 695 GrGpu* fGpu; | 697 GrGpu* fGpu; |
| 696 | 698 |
| 697 GrResourceCache* fResourceCache; | 699 GrResourceCache* fResourceCache; |
| 700 GrBatchFontCache* fBatchFontCache; | |
|
bsalomon
2015/03/24 16:27:53
Is this what gets replaced by skresourcecache?
joshualitt
2015/03/25 14:13:37
This cache replaces fFontCache. SkResourceCache r
bsalomon
2015/03/25 14:19:15
Ah, ok. Haven't looked at this yet.
| |
| 698 GrFontCache* fFontCache; | 701 GrFontCache* fFontCache; |
| 699 SkAutoTDelete<GrLayerCache> fLayerCache; | 702 SkAutoTDelete<GrLayerCache> fLayerCache; |
| 700 | 703 |
| 701 GrPathRendererChain* fPathRendererChain; | 704 GrPathRendererChain* fPathRendererChain; |
| 702 GrSoftwarePathRenderer* fSoftwarePathRenderer; | 705 GrSoftwarePathRenderer* fSoftwarePathRenderer; |
| 703 | 706 |
| 704 GrVertexBufferAllocPool* fDrawBufferVBAllocPool; | 707 GrVertexBufferAllocPool* fDrawBufferVBAllocPool; |
| 705 GrIndexBufferAllocPool* fDrawBufferIBAllocPool; | 708 GrIndexBufferAllocPool* fDrawBufferIBAllocPool; |
| 706 GrInOrderDrawBuffer* fDrawBuffer; | 709 GrInOrderDrawBuffer* fDrawBuffer; |
| 707 | 710 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 781 */ | 784 */ |
| 782 static void OverBudgetCB(void* data); | 785 static void OverBudgetCB(void* data); |
| 783 | 786 |
| 784 // TODO see note on createTextContext | 787 // TODO see note on createTextContext |
| 785 friend class SkGpuDevice; | 788 friend class SkGpuDevice; |
| 786 | 789 |
| 787 typedef SkRefCnt INHERITED; | 790 typedef SkRefCnt INHERITED; |
| 788 }; | 791 }; |
| 789 | 792 |
| 790 #endif | 793 #endif |
| OLD | NEW |