don't call through to the inherited saveLayer, but just call save during record
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 1 Oct 2009 19:16:39 +0000 (19:16 +0000)
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 1 Oct 2009 19:16:39 +0000 (19:16 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@373 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkPictureRecord.cpp

index c7f2c6c041627a0990edaf5af1adc4d16147bf41..b565fc11a8f8e5f6f9b84c481d44efa4b6f9f2d5 100644 (file)
@@ -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() {