From a5b741a97b2162127f1b1725912d07ecd41fa825 Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Thu, 1 Oct 2009 19:16:39 +0000 Subject: [PATCH] don't call through to the inherited saveLayer, but just call save during record git-svn-id: http://skia.googlecode.com/svn/trunk@373 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkPictureRecord.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp index c7f2c6c..b565fc1 100644 --- a/src/core/SkPictureRecord.cpp +++ b/src/core/SkPictureRecord.cpp @@ -45,7 +45,13 @@ int SkPictureRecord::saveLayer(const SkRect* bounds, const SkPaint* paint, fRestoreOffsetStack.push(0); validate(); - return this->INHERITED::saveLayer(bounds, paint, flags); + /* Don't actually call saveLayer, because that will try to allocate an + offscreen device (potentially very big) which we don't actually need + at this time (and may not be able to afford since during record our + clip starts out the size of the picture, which is often much larger + than the size of the actual device we'll use during playback). + */ + return this->INHERITED::save(flags); } void SkPictureRecord::restore() { -- 2.7.4