Title: [114489] branches/chromium/1084/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp
- Revision
- 114489
- Author
- [email protected]
- Date
- 2012-04-18 00:35:15 -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/10083037
Modified Paths
Diff
Modified: branches/chromium/1084/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp (114488 => 114489)
--- branches/chromium/1084/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp 2012-04-18 06:39:35 UTC (rev 114488)
+++ branches/chromium/1084/Source/WebCore/platform/graphics/skia/NativeImageSkia.cpp 2012-04-18 07:35:15 UTC (rev 114489)
@@ -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