Title: [114507] branches/chromium/1025/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
Revision
114507
Author
[email protected]
Date
2012-04-18 08:45:57 -0700 (Wed, 18 Apr 2012)

Log Message

Merge 114487 - Skia OOM error when upscaling small subsets of images by large quantities
https://bugs.webkit.org/show_bug.cgi?id=84225

Patch by Rachel Blum <[email protected]> on 2012-04-17
Reviewed by David Levin.

Tested with manual tests.

* platform/graphics/skia/NativeImageSkia.cpp:
(WebCore::NativeImageSkia::shouldCacheResampling):

[email protected]
Review URL: https://chromiumcodereview.appspot.com/10035027

Modified Paths

Diff

Modified: branches/chromium/1025/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp (114506 => 114507)


--- branches/chromium/1025/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp	2012-04-18 15:44:13 UTC (rev 114506)
+++ branches/chromium/1025/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp	2012-04-18 15:45:57 UTC (rev 114507)
@@ -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;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to