summaryrefslogtreecommitdiffstats
path: root/skia/effects/SkLayerRasterizer.cpp
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 12:50:58 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-30 12:50:58 +0000
commit9a136cdf89222c11b0dae86e19ff0b14956f929a (patch)
tree44f007a586303dce4a7a7024fd785eee22da61fe /skia/effects/SkLayerRasterizer.cpp
parente91a73a43d79d437c59a5a44396e919628f3f707 (diff)
downloadchromium_src-9a136cdf89222c11b0dae86e19ff0b14956f929a.zip
chromium_src-9a136cdf89222c11b0dae86e19ff0b14956f929a.tar.gz
chromium_src-9a136cdf89222c11b0dae86e19ff0b14956f929a.tar.bz2
Integrate change of Skia upstream.
This is a cherry-pick of the following change: http://code.google.com/p/skia/source/detail?r=159 We introduce this change for the 'lighter' composite operation. We need kAdd_Mode, which is introduced in this change for the operation. Patch by Shinichiro Hamaji. BUG=1619 Review URL: http://codereview.chromium.org/93093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14938 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/effects/SkLayerRasterizer.cpp')
-rw-r--r--skia/effects/SkLayerRasterizer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/skia/effects/SkLayerRasterizer.cpp b/skia/effects/SkLayerRasterizer.cpp
index 390e3a3..4fd1d26 100644
--- a/skia/effects/SkLayerRasterizer.cpp
+++ b/skia/effects/SkLayerRasterizer.cpp
@@ -108,8 +108,12 @@ bool SkLayerRasterizer::onRasterize(const SkPath& path, const SkMatrix& matrix,
{
mask->fFormat = SkMask::kA8_Format;
mask->fRowBytes = SkToU16(mask->fBounds.width());
- mask->fImage = SkMask::AllocImage(mask->computeImageSize());
- memset(mask->fImage, 0, mask->computeImageSize());
+ size_t size = mask->computeImageSize();
+ if (0 == size) {
+ return false; // too big to allocate, abort
+ }
+ mask->fImage = SkMask::AllocImage(size);
+ memset(mask->fImage, 0, size);
}
if (SkMask::kJustComputeBounds_CreateMode != mode)