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

Unified Diff: src/core/SkScaledImageCache.h

Issue 394003003: Set maximum output size for scaled-image-cache images (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rename, runtime Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkScaledImageCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkScaledImageCache.h
diff --git a/src/core/SkScaledImageCache.h b/src/core/SkScaledImageCache.h
index fe072306d383f44eec7554724f4c3d8b94ae9fdf..48f143b204d3256f0d33a5d119cbb71c86e03681 100644
--- a/src/core/SkScaledImageCache.h
+++ b/src/core/SkScaledImageCache.h
@@ -64,6 +64,9 @@ public:
static size_t GetByteLimit();
static size_t SetByteLimit(size_t newLimit);
+ static void SetMaximumOutputSizeForHighQualityFilter(size_t);
reed1 2014/07/16 18:38:00 What if we rename SetByteLimit to SetTotalByteLimi
+ static size_t GetMaximumOutputSizeForHighQualityFilter();
+
static SkBitmap::Allocator* GetAllocator();
/**
@@ -148,6 +151,12 @@ public:
size_t getByteLimit() const { return fByteLimit; }
/**
+ * This is respected by SkBitmapProcState::possiblyScaleImage.
+ * 0 is no maximum at all; this is the default.
+ */
+ void setMaximumOutputSizeForHighQualityFilter(size_t maximumAllocationSize);
+ size_t getMaximumOutputSizeForHighQualityFilter() const;
+ /**
* Set the maximum number of bytes available to this cache. If the current
* cache exceeds this new value, it will be purged to try to fit within
* this new limit.
@@ -177,6 +186,7 @@ private:
size_t fBytesUsed;
size_t fByteLimit;
+ size_t fMaximumOutputSizeForHighQualityFilter;
int fCount;
Rec* findAndLock(uint32_t generationID, SkScalar sx, SkScalar sy,
« no previous file with comments | « src/core/SkBitmapProcState.cpp ('k') | src/core/SkScaledImageCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698