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 25 matching lines...) Expand all Loading... | |
36 class GrResourceEntry; | 36 class GrResourceEntry; |
37 class GrResourceCache; | 37 class GrResourceCache; |
38 class GrResourceProvider; | 38 class GrResourceProvider; |
39 class GrTestTarget; | 39 class GrTestTarget; |
40 class GrTextBlobCache; | 40 class GrTextBlobCache; |
41 class GrTextContext; | 41 class GrTextContext; |
42 class GrTextureParams; | 42 class GrTextureParams; |
43 class GrVertexBuffer; | 43 class GrVertexBuffer; |
44 class GrStrokeInfo; | 44 class GrStrokeInfo; |
45 class GrSoftwarePathRenderer; | 45 class GrSoftwarePathRenderer; |
46 class SkTraceMemoryDump; | |
46 | 47 |
47 class SK_API GrContext : public SkRefCnt { | 48 class SK_API GrContext : public SkRefCnt { |
48 public: | 49 public: |
49 /** | 50 /** |
50 * Creates a GrContext for a backend context. | 51 * Creates a GrContext for a backend context. |
51 */ | 52 */ |
52 static GrContext* Create(GrBackend, GrBackendContext, const GrContextOptions & options); | 53 static GrContext* Create(GrBackend, GrBackendContext, const GrContextOptions & options); |
53 static GrContext* Create(GrBackend, GrBackendContext); | 54 static GrContext* Create(GrBackend, GrBackendContext); |
54 | 55 |
55 /** | 56 /** |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
354 void printGpuStats() const; | 355 void printGpuStats() const; |
355 | 356 |
356 /** Specify the TextBlob cache limit. If the current cache exceeds this limi t it will purge. | 357 /** Specify the TextBlob cache limit. If the current cache exceeds this limi t it will purge. |
357 this is for testing only */ | 358 this is for testing only */ |
358 void setTextBlobCacheLimit_ForTesting(size_t bytes); | 359 void setTextBlobCacheLimit_ForTesting(size_t bytes); |
359 | 360 |
360 /** Specify the sizes of the GrAtlasTextContext atlases. The configs pointe r below should be | 361 /** Specify the sizes of the GrAtlasTextContext atlases. The configs pointe r below should be |
361 to an array of 3 entries */ | 362 to an array of 3 entries */ |
362 void setTextContextAtlasSizes_ForTesting(const GrBatchAtlasConfig* configs); | 363 void setTextContextAtlasSizes_ForTesting(const GrBatchAtlasConfig* configs); |
363 | 364 |
365 /** Enumerates all cached GPU resources and dumps their memory to traceMemor yDump. */ | |
366 void onMemoryDump(SkTraceMemoryDump* traceMemoryDump) const; | |
bsalomon
2015/08/26 16:36:00
Can we call this something like dumpMemory? We usu
ericrk
2015/08/26 17:01:09
OnMemoryDump matches the name in chrome, but I'm h
bsalomon
2015/08/26 17:08:56
sgtm
| |
367 | |
364 private: | 368 private: |
365 GrGpu* fGpu; | 369 GrGpu* fGpu; |
366 const GrCaps* fCaps; | 370 const GrCaps* fCaps; |
367 GrResourceCache* fResourceCache; | 371 GrResourceCache* fResourceCache; |
368 // this union exists because the inheritance of GrTextureProvider->GrResourc eProvider | 372 // this union exists because the inheritance of GrTextureProvider->GrResourc eProvider |
369 // is in a private header. | 373 // is in a private header. |
370 union { | 374 union { |
371 GrResourceProvider* fResourceProvider; | 375 GrResourceProvider* fResourceProvider; |
372 GrTextureProvider* fTextureProvider; | 376 GrTextureProvider* fTextureProvider; |
373 }; | 377 }; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 /** | 470 /** |
467 * A callback similar to the above for use by the TextBlobCache | 471 * A callback similar to the above for use by the TextBlobCache |
468 * TODO move textblob draw calls below context so we can use the call above. | 472 * TODO move textblob draw calls below context so we can use the call above. |
469 */ | 473 */ |
470 static void TextBlobCacheOverBudgetCB(void* data); | 474 static void TextBlobCacheOverBudgetCB(void* data); |
471 | 475 |
472 typedef SkRefCnt INHERITED; | 476 typedef SkRefCnt INHERITED; |
473 }; | 477 }; |
474 | 478 |
475 #endif | 479 #endif |
OLD | NEW |