diff options
author | Robert Phillips <robertphillips@google.com> | 2017-12-04 13:48:14 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-04 18:54:09 +0000 |
commit | 8d1e67ed6b75909ac20211ae3aec130587920cec (patch) | |
tree | 7132b299b0492ae8088f0160faccf06d2bf9878d /include | |
parent | 7d0cd9c3c6262db1a21d22b6ed82241f2463b5ec (diff) |
Add resource cache limits to SkSurfaceCharacterization
Change-Id: I4c3b2f1c6ecc39b2364cefae07d5dee5e3d20d60
Reviewed-on: https://skia-review.googlesource.com/79600
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/private/SkSurfaceCharacterization.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/private/SkSurfaceCharacterization.h b/include/private/SkSurfaceCharacterization.h index f450b704d9..282043a879 100644 --- a/include/private/SkSurfaceCharacterization.h +++ b/include/private/SkSurfaceCharacterization.h @@ -27,7 +27,9 @@ class SkColorSpace; class SkSurfaceCharacterization { public: SkSurfaceCharacterization() - : fOrigin(kBottomLeft_GrSurfaceOrigin) + : fCacheMaxResourceCount(0) + , fCacheMaxResourceBytes(0) + , fOrigin(kBottomLeft_GrSurfaceOrigin) , fWidth(0) , fHeight(0) , fConfig(kUnknown_GrPixelConfig) @@ -43,6 +45,9 @@ public: SkSurfaceCharacterization& operator=(const SkSurfaceCharacterization& other) = default; GrContextThreadSafeProxy* contextInfo() const { return fContextInfo.get(); } + int cacheMaxResourceCount() const { return fCacheMaxResourceCount; } + size_t cacheMaxResourceBytes() const { return fCacheMaxResourceBytes; } + GrSurfaceOrigin origin() const { return fOrigin; } int width() const { return fWidth; } int height() const { return fHeight; } @@ -57,6 +62,8 @@ private: friend class SkSurface_Gpu; // for 'set' void set(sk_sp<GrContextThreadSafeProxy> contextInfo, + int cacheMaxResourceCount, + size_t cacheMaxResourceBytes, GrSurfaceOrigin origin, int width, int height, GrPixelConfig config, @@ -65,6 +72,9 @@ private: sk_sp<SkColorSpace> colorSpace, const SkSurfaceProps& surfaceProps) { fContextInfo = contextInfo; + fCacheMaxResourceCount = cacheMaxResourceCount; + fCacheMaxResourceBytes = cacheMaxResourceBytes; + fOrigin = origin; fWidth = width; fHeight = height; @@ -76,6 +86,9 @@ private: } sk_sp<GrContextThreadSafeProxy> fContextInfo; + int fCacheMaxResourceCount; + size_t fCacheMaxResourceBytes; + GrSurfaceOrigin fOrigin; int fWidth; int fHeight; |