override drawOval and drawRRect in GatherPixelRefDevice, so we don't miss those,
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 24 Jan 2013 18:27:42 +0000 (18:27 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 24 Jan 2013 18:27:42 +0000 (18:27 +0000)
and possibly crash trying to raster into an empty device.

http://code.google.com/p/skia/issues/detail?id=1086
Review URL: https://codereview.appspot.com/7193057

git-svn-id: http://skia.googlecode.com/svn/trunk@7372 2bbb7eff-a529-9590-31e7-b0007b416f81

src/utils/SkPictureUtils.cpp
tests/PictureTest.cpp

index 46ca6d6f9e7f394a348913585703f8675752552f..0b147fa5ef9b8aaa1fbba745846310f88a616725 100644 (file)
@@ -84,7 +84,15 @@ public:
                             const SkPoint[], const SkPaint& paint) SK_OVERRIDE {
         this->addBitmapFromPaint(paint);
     }
-    virtual void drawRect(const SkDraw&, const SkRect& r,
+    virtual void drawRect(const SkDraw&, const SkRect&,
+                          const SkPaint& paint) SK_OVERRIDE {
+        this->addBitmapFromPaint(paint);
+    }
+    virtual void drawOval(const SkDraw&, const SkRect&,
+                          const SkPaint& paint) SK_OVERRIDE {
+        this->addBitmapFromPaint(paint);
+    }
+    virtual void drawRRect(const SkDraw&, const SkRRect&,
                           const SkPaint& paint) SK_OVERRIDE {
         this->addBitmapFromPaint(paint);
     }
index da8d13a69ed2d77f3e94394d77e35aae49ad5143..395ce4aa88fdb9d501d2b64ee82b0f27d5041cc5 100644 (file)
@@ -11,6 +11,7 @@
 #include "SkPaint.h"
 #include "SkPicture.h"
 #include "SkRandom.h"
+#include "SkRRect.h"
 #include "SkShader.h"
 #include "SkStream.h"
 
@@ -54,6 +55,10 @@ static void drawshader_proc(SkCanvas* canvas, const SkBitmap& bm,
     SkPaint paint;
     paint.setShader(s)->unref();
     canvas->drawRect(r, paint);
+    canvas->drawOval(r, paint);
+    SkRRect rr;
+    rr.setRectXY(r, 10, 10);
+    canvas->drawRRect(rr, paint);
 }
 
 // Return a picture with the bitmaps drawn at the specified positions.