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 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 /** | 953 /** |
954 * This returns a copy of the the GrContext::Options that was passed to the | 954 * This returns a copy of the the GrContext::Options that was passed to the |
955 * constructor of this class. | 955 * constructor of this class. |
956 */ | 956 */ |
957 const Options& getOptions() const { return fOptions; } | 957 const Options& getOptions() const { return fOptions; } |
958 | 958 |
959 #if GR_CACHE_STATS | 959 #if GR_CACHE_STATS |
960 void printCacheStats() const; | 960 void printCacheStats() const; |
961 #endif | 961 #endif |
962 | 962 |
| 963 class GPUStats { |
| 964 public: |
| 965 #if GR_GPU_STATS |
| 966 GPUStats() { this->reset(); } |
| 967 |
| 968 void reset() { fRenderTargetBinds = 0; fShaderCompilations = 0; } |
| 969 |
| 970 int renderTargetBinds() const { return fRenderTargetBinds; } |
| 971 void incRenderTargetBinds() { fRenderTargetBinds++; } |
| 972 int shaderCompilations() const { return fShaderCompilations; } |
| 973 void incShaderCompilations() { fShaderCompilations++; } |
| 974 private: |
| 975 int fRenderTargetBinds; |
| 976 int fShaderCompilations; |
| 977 #else |
| 978 void incRenderTargetBinds() {} |
| 979 void incShaderCompilations() {} |
| 980 #endif |
| 981 }; |
| 982 |
| 983 #if GR_GPU_STATS |
| 984 const GPUStats* gpuStats() const; |
| 985 #endif |
| 986 |
963 private: | 987 private: |
964 // Used to indicate whether a draw should be performed immediately or queued
in fDrawBuffer. | 988 // Used to indicate whether a draw should be performed immediately or queued
in fDrawBuffer. |
965 enum BufferedDraw { | 989 enum BufferedDraw { |
966 kYes_BufferedDraw, | 990 kYes_BufferedDraw, |
967 kNo_BufferedDraw, | 991 kNo_BufferedDraw, |
968 }; | 992 }; |
969 BufferedDraw fLastDrawWasBuffered; | 993 BufferedDraw fLastDrawWasBuffered; |
970 | 994 |
971 GrGpu* fGpu; | 995 GrGpu* fGpu; |
972 SkMatrix fViewMatrix; | 996 SkMatrix fViewMatrix; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 } | 1162 } |
1139 | 1163 |
1140 GrTexture* texture() { return fTexture; } | 1164 GrTexture* texture() { return fTexture; } |
1141 | 1165 |
1142 private: | 1166 private: |
1143 GrContext* fContext; | 1167 GrContext* fContext; |
1144 GrTexture* fTexture; | 1168 GrTexture* fTexture; |
1145 }; | 1169 }; |
1146 | 1170 |
1147 #endif | 1171 #endif |
OLD | NEW |