| 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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 bool allowSW, | 788 bool allowSW, |
| 789 GrPathRendererChain::DrawType drawType = GrPathRendererChain
::kColor_DrawType, | 789 GrPathRendererChain::DrawType drawType = GrPathRendererChain
::kColor_DrawType, |
| 790 GrPathRendererChain::StencilSupport* stencilSupport = NULL); | 790 GrPathRendererChain::StencilSupport* stencilSupport = NULL); |
| 791 | 791 |
| 792 /** | 792 /** |
| 793 * This returns a copy of the the GrContext::Options that was passed to the | 793 * This returns a copy of the the GrContext::Options that was passed to the |
| 794 * constructor of this class. | 794 * constructor of this class. |
| 795 */ | 795 */ |
| 796 const Options& getOptions() const { return fOptions; } | 796 const Options& getOptions() const { return fOptions; } |
| 797 | 797 |
| 798 #if GR_CACHE_STATS | 798 /** Prints cache stats to the string if GR_CACHE_STATS == 1. */ |
| 799 void dumpCacheStats(SkString*) const; |
| 799 void printCacheStats() const; | 800 void printCacheStats() const; |
| 800 #endif | |
| 801 | 801 |
| 802 class GPUStats { | 802 /** Prints GPU stats to the string if GR_GPU_STATS == 1. */ |
| 803 public: | 803 void dumpGpuStats(SkString*) const; |
| 804 #if GR_GPU_STATS | 804 void printGpuStats() const; |
| 805 GPUStats() { this->reset(); } | |
| 806 | |
| 807 void reset() { fRenderTargetBinds = 0; fShaderCompilations = 0; } | |
| 808 | |
| 809 int renderTargetBinds() const { return fRenderTargetBinds; } | |
| 810 void incRenderTargetBinds() { fRenderTargetBinds++; } | |
| 811 int shaderCompilations() const { return fShaderCompilations; } | |
| 812 void incShaderCompilations() { fShaderCompilations++; } | |
| 813 private: | |
| 814 int fRenderTargetBinds; | |
| 815 int fShaderCompilations; | |
| 816 #else | |
| 817 void incRenderTargetBinds() {} | |
| 818 void incShaderCompilations() {} | |
| 819 #endif | |
| 820 }; | |
| 821 | |
| 822 #if GR_GPU_STATS | |
| 823 const GPUStats* gpuStats() const; | |
| 824 #endif | |
| 825 | 805 |
| 826 private: | 806 private: |
| 827 GrGpu* fGpu; | 807 GrGpu* fGpu; |
| 828 SkAutoTUnref<GrRenderTarget> fRenderTarget; | 808 SkAutoTUnref<GrRenderTarget> fRenderTarget; |
| 829 const GrClipData* fClip; // TODO: make this ref counted | 809 const GrClipData* fClip; // TODO: make this ref counted |
| 830 | 810 |
| 831 GrResourceCache2* fResourceCache2; | 811 GrResourceCache2* fResourceCache2; |
| 832 GrFontCache* fFontCache; | 812 GrFontCache* fFontCache; |
| 833 SkAutoTDelete<GrLayerCache> fLayerCache; | 813 SkAutoTDelete<GrLayerCache> fLayerCache; |
| 834 | 814 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 897 /** | 877 /** |
| 898 * This callback allows the resource cache to callback into the GrContext | 878 * This callback allows the resource cache to callback into the GrContext |
| 899 * when the cache is still over budget after a purge. | 879 * when the cache is still over budget after a purge. |
| 900 */ | 880 */ |
| 901 static void OverBudgetCB(void* data); | 881 static void OverBudgetCB(void* data); |
| 902 | 882 |
| 903 typedef SkRefCnt INHERITED; | 883 typedef SkRefCnt INHERITED; |
| 904 }; | 884 }; |
| 905 | 885 |
| 906 #endif | 886 #endif |
| OLD | NEW |