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

Unified Diff: src/core/SkScaledImageCache.cpp

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
Index: src/core/SkScaledImageCache.cpp
diff --git a/src/core/SkScaledImageCache.cpp b/src/core/SkScaledImageCache.cpp
index 6d63edb468fa47c20fa91ef5f8b77e192ab0f0df..6fcec7a600acf573d214e835345dde3a4a027345 100644
--- a/src/core/SkScaledImageCache.cpp
+++ b/src/core/SkScaledImageCache.cpp
@@ -142,6 +142,7 @@ void SkScaledImageCache::init() {
#endif
fBytesUsed = 0;
fCount = 0;
+ fMaximumOutputSizeForHighQualityFilter = 0;
fAllocator = NULL;
// One of these should be explicit set by the caller after we return.
@@ -638,6 +639,14 @@ void SkScaledImageCache::dump() const {
fDiscardableFactory ? "discardable" : "malloc");
}
+void SkScaledImageCache::setMaximumOutputSizeForHighQualityFilter(size_t size) {
+ fMaximumOutputSizeForHighQualityFilter = size;
+}
+
+size_t SkScaledImageCache::getMaximumOutputSizeForHighQualityFilter() const {
+ return fMaximumOutputSizeForHighQualityFilter;
+}
+
///////////////////////////////////////////////////////////////////////////////
#include "SkThread.h"
@@ -749,6 +758,16 @@ void SkScaledImageCache::Dump() {
get_cache()->dump();
}
+void SkScaledImageCache::SetMaximumOutputSizeForHighQualityFilter(size_t size) {
+ SkAutoMutexAcquire am(gMutex);
+ get_cache()->setMaximumOutputSizeForHighQualityFilter(size);
+}
+
+size_t SkScaledImageCache::GetMaximumOutputSizeForHighQualityFilter() {
+ SkAutoMutexAcquire am(gMutex);
+ return get_cache()->getMaximumOutputSizeForHighQualityFilter();
+}
+
///////////////////////////////////////////////////////////////////////////////
#include "SkGraphics.h"

Powered by Google App Engine
This is Rietveld 408576698