Index: src/core/SkCanvasDrawable.cpp |
diff --git a/src/core/SkCanvasDrawable.cpp b/src/core/SkCanvasDrawable.cpp |
index e0120f0bb1128bfbb3d258d5674e4987ac01af2a..0065d430f900b5be411a167e1ee572185bcc66c5 100644 |
--- a/src/core/SkCanvasDrawable.cpp |
+++ b/src/core/SkCanvasDrawable.cpp |
@@ -23,22 +23,9 @@ |
SkCanvasDrawable::SkCanvasDrawable() : fGenerationID(0) {} |
-static void draw_bbox(SkCanvas* canvas, const SkRect& r) { |
- SkPaint paint; |
- paint.setStyle(SkPaint::kStroke_Style); |
- paint.setColor(0xFFFF7088); |
- canvas->drawRect(r, paint); |
- canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint); |
- canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint); |
-} |
- |
void SkCanvasDrawable::draw(SkCanvas* canvas) { |
SkAutoCanvasRestore acr(canvas, true); |
this->onDraw(canvas); |
- |
- if (false) { |
- draw_bbox(canvas, this->getBounds()); |
- } |
} |
SkPicture* SkCanvasDrawable::newPictureSnapshot(SkBBHFactory* bbhFactory, uint32_t recordFlags) { |
@@ -65,13 +52,8 @@ |
#include "SkPictureRecorder.h" |
SkPicture* SkCanvasDrawable::onNewPictureSnapshot(SkBBHFactory* bbhFactory, uint32_t recordFlags) { |
+ const SkRect bounds = this->getBounds(); |
SkPictureRecorder recorder; |
- |
- const SkRect bounds = this->getBounds(); |
- SkCanvas* canvas = recorder.beginRecording(bounds, bbhFactory, recordFlags); |
- this->draw(canvas); |
- if (false) { |
- draw_bbox(canvas, bounds); |
- } |
+ this->draw(recorder.beginRecording(bounds.width(), bounds.height(), bbhFactory, recordFlags)); |
return recorder.endRecording(); |
} |