| 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 24 matching lines...) Expand all Loading... |
| 35 class GrResourceEntry; | 35 class GrResourceEntry; |
| 36 class GrResourceCache; | 36 class GrResourceCache; |
| 37 class GrResourceProvider; | 37 class GrResourceProvider; |
| 38 class GrTestTarget; | 38 class GrTestTarget; |
| 39 class GrTextBlobCache; | 39 class GrTextBlobCache; |
| 40 class GrTextContext; | 40 class GrTextContext; |
| 41 class GrTextureParams; | 41 class GrTextureParams; |
| 42 class GrVertexBuffer; | 42 class GrVertexBuffer; |
| 43 class GrStrokeInfo; | 43 class GrStrokeInfo; |
| 44 class GrSoftwarePathRenderer; | 44 class GrSoftwarePathRenderer; |
| 45 class SkTraceMemoryDump; |
| 45 | 46 |
| 46 class SK_API GrContext : public SkRefCnt { | 47 class SK_API GrContext : public SkRefCnt { |
| 47 public: | 48 public: |
| 48 /** | 49 /** |
| 49 * Creates a GrContext for a backend context. | 50 * Creates a GrContext for a backend context. |
| 50 */ | 51 */ |
| 51 static GrContext* Create(GrBackend, GrBackendContext, const GrContextOptions
& options); | 52 static GrContext* Create(GrBackend, GrBackendContext, const GrContextOptions
& options); |
| 52 static GrContext* Create(GrBackend, GrBackendContext); | 53 static GrContext* Create(GrBackend, GrBackendContext); |
| 53 | 54 |
| 54 /** | 55 /** |
| (...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 void printCacheStats() const; | 350 void printCacheStats() const; |
| 350 | 351 |
| 351 /** Prints GPU stats to the string if GR_GPU_STATS == 1. */ | 352 /** Prints GPU stats to the string if GR_GPU_STATS == 1. */ |
| 352 void dumpGpuStats(SkString*) const; | 353 void dumpGpuStats(SkString*) const; |
| 353 void printGpuStats() const; | 354 void printGpuStats() const; |
| 354 | 355 |
| 355 /** Specify the TextBlob cache limit. If the current cache exceeds this limi
t it will purge. | 356 /** Specify the TextBlob cache limit. If the current cache exceeds this limi
t it will purge. |
| 356 this is for testing only */ | 357 this is for testing only */ |
| 357 void setTextBlobCacheLimit_ForTesting(size_t bytes); | 358 void setTextBlobCacheLimit_ForTesting(size_t bytes); |
| 358 | 359 |
| 360 /** Enumerates all cached resources and dumps their memory to traceMemoryDum
p. */ |
| 361 void onMemoryDump(SkTraceMemoryDump* traceMemoryDump) const; |
| 362 |
| 359 private: | 363 private: |
| 360 GrGpu* fGpu; | 364 GrGpu* fGpu; |
| 361 const GrCaps* fCaps; | 365 const GrCaps* fCaps; |
| 362 GrResourceCache* fResourceCache; | 366 GrResourceCache* fResourceCache; |
| 363 // this union exists because the inheritance of GrTextureProvider->GrResourc
eProvider | 367 // this union exists because the inheritance of GrTextureProvider->GrResourc
eProvider |
| 364 // is in a private header. | 368 // is in a private header. |
| 365 union { | 369 union { |
| 366 GrResourceProvider* fResourceProvider; | 370 GrResourceProvider* fResourceProvider; |
| 367 GrTextureProvider* fTextureProvider; | 371 GrTextureProvider* fTextureProvider; |
| 368 }; | 372 }; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 /** | 465 /** |
| 462 * A callback similar to the above for use by the TextBlobCache | 466 * A callback similar to the above for use by the TextBlobCache |
| 463 * TODO move textblob draw calls below context so we can use the call above. | 467 * TODO move textblob draw calls below context so we can use the call above. |
| 464 */ | 468 */ |
| 465 static void TextBlobCacheOverBudgetCB(void* data); | 469 static void TextBlobCacheOverBudgetCB(void* data); |
| 466 | 470 |
| 467 typedef SkRefCnt INHERITED; | 471 typedef SkRefCnt INHERITED; |
| 468 }; | 472 }; |
| 469 | 473 |
| 470 #endif | 474 #endif |
| OLD | NEW |