| 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 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 bool allowSW, | 761 bool allowSW, |
| 762 GrPathRendererChain::DrawType drawType = GrPathRendererChain
::kColor_DrawType, | 762 GrPathRendererChain::DrawType drawType = GrPathRendererChain
::kColor_DrawType, |
| 763 GrPathRendererChain::StencilSupport* stencilSupport = NULL); | 763 GrPathRendererChain::StencilSupport* stencilSupport = NULL); |
| 764 | 764 |
| 765 /** | 765 /** |
| 766 * This returns a copy of the the GrContext::Options that was passed to the | 766 * This returns a copy of the the GrContext::Options that was passed to the |
| 767 * constructor of this class. | 767 * constructor of this class. |
| 768 */ | 768 */ |
| 769 const Options& getOptions() const { return fOptions; } | 769 const Options& getOptions() const { return fOptions; } |
| 770 | 770 |
| 771 #if GR_CACHE_STATS | 771 /** Prints cache stats to the string if GR_CACHE_STATS == 1. */ |
| 772 void dumpCacheStats(SkString*) const; |
| 772 void printCacheStats() const; | 773 void printCacheStats() const; |
| 773 #endif | |
| 774 | 774 |
| 775 class GPUStats { | 775 /** Prints GPU stats to the string if GR_GPU_STATS == 1. */ |
| 776 public: | 776 void dumpGpuStats(SkString*) const; |
| 777 #if GR_GPU_STATS | 777 void printGpuStats() const; |
| 778 GPUStats() { this->reset(); } | |
| 779 | |
| 780 void reset() { fRenderTargetBinds = 0; fShaderCompilations = 0; } | |
| 781 | |
| 782 int renderTargetBinds() const { return fRenderTargetBinds; } | |
| 783 void incRenderTargetBinds() { fRenderTargetBinds++; } | |
| 784 int shaderCompilations() const { return fShaderCompilations; } | |
| 785 void incShaderCompilations() { fShaderCompilations++; } | |
| 786 private: | |
| 787 int fRenderTargetBinds; | |
| 788 int fShaderCompilations; | |
| 789 #else | |
| 790 void incRenderTargetBinds() {} | |
| 791 void incShaderCompilations() {} | |
| 792 #endif | |
| 793 }; | |
| 794 | |
| 795 #if GR_GPU_STATS | |
| 796 const GPUStats* gpuStats() const; | |
| 797 #endif | |
| 798 | 778 |
| 799 private: | 779 private: |
| 800 GrGpu* fGpu; | 780 GrGpu* fGpu; |
| 801 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 781 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
| 802 const GrClipData* fClip; // TODO: make this ref counted | 782 const GrClipData* fClip; // TODO: make this ref counted |
| 803 | 783 |
| 804 GrResourceCache2* fResourceCache2; | 784 GrResourceCache2* fResourceCache2; |
| 805 GrFontCache* fFontCache; | 785 GrFontCache* fFontCache; |
| 806 SkAutoTDelete<GrLayerCache> fLayerCache; | 786 SkAutoTDelete<GrLayerCache> fLayerCache; |
| 807 | 787 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 /** | 850 /** |
| 871 * This callback allows the resource cache to callback into the GrContext | 851 * This callback allows the resource cache to callback into the GrContext |
| 872 * when the cache is still over budget after a purge. | 852 * when the cache is still over budget after a purge. |
| 873 */ | 853 */ |
| 874 static void OverBudgetCB(void* data); | 854 static void OverBudgetCB(void* data); |
| 875 | 855 |
| 876 typedef SkRefCnt INHERITED; | 856 typedef SkRefCnt INHERITED; |
| 877 }; | 857 }; |
| 878 | 858 |
| 879 #endif | 859 #endif |
| OLD | NEW |