Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: include/gpu/GrContext.h

Issue 1302663003: Sample for GPU memory dumping using new SkTraceMemoryDump. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | include/gpu/GrGpuResource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « no previous file | include/gpu/GrGpuResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698