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

Unified Diff: Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp

Issue 10035027: Merge 114487 - Skia OOM error when upscaling small subsets of images by large quantities (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1025/
Patch Set: Created 8 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
===================================================================
--- Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp (revision 114506)
+++ Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp (working copy)
@@ -127,6 +127,11 @@
if (!isDataComplete())
return false;
+ // If the destination bitmap is excessively large, we'll never allow caching.
+ static const unsigned long long kLargeBitmapSize = 4096ULL * 4096ULL;
+ if ((static_cast<unsigned long long>(destWidth) * static_cast<unsigned long long>(destHeight)) > kLargeBitmapSize)
+ return false;
+
// If the destination bitmap is small, we'll always allow caching, since
// there is not very much penalty for computing it and it may come in handy.
static const int kSmallBitmapSize = 4096;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698