Index: cc/paint/record_paint_canvas.cc |
diff --git a/cc/paint/record_paint_canvas.cc b/cc/paint/record_paint_canvas.cc |
index 258b571bf123871612d53fb3f0cdc73c6169af6f..a635474a372be797e26a60cc88cb0f56bb645577 100644 |
--- a/cc/paint/record_paint_canvas.cc |
+++ b/cc/paint/record_paint_canvas.cc |
@@ -15,7 +15,9 @@ |
namespace cc { |
-RecordPaintCanvas::RecordPaintCanvas(PaintOpBuffer* buffer) : buffer_(buffer) { |
+RecordPaintCanvas::RecordPaintCanvas(PaintOpBuffer* buffer, |
+ const SkRect& bounds) |
+ : buffer_(buffer), recording_bounds_(bounds) { |
DCHECK(buffer_); |
} |
@@ -352,20 +354,18 @@ SkNoDrawCanvas* RecordPaintCanvas::GetCanvas() { |
if (canvas_) |
return &*canvas_; |
- SkRect recording_bounds = buffer_->cullRect(); |
- |
// Size the canvas to be large enough to contain the |recording_bounds|, which |
// may not be positioned at th origin. |
- SkIRect enclosing_rect = recording_bounds.roundOut(); |
+ SkIRect enclosing_rect = recording_bounds_.roundOut(); |
canvas_.emplace(enclosing_rect.right(), enclosing_rect.bottom()); |
// This is part of the "recording canvases have a size, but why" dance. |
// By creating a canvas of size (right x bottom) and then clipping it, |
// It makes getDeviceClipBounds return the original cull rect, which code |
// in GraphicsContextCanvas on Mac expects. (Just creating an SkNoDrawCanvas |
- // with the cull_rect makes a canvas of size (width x height) instead |
+ // with the recording_bounds_ makes a canvas of size (width x height) instead |
// which is incorrect. SkRecorder cheats with private resetForNextCanvas. |
- canvas_->clipRect(recording_bounds, SkClipOp::kIntersect, false); |
+ canvas_->clipRect(recording_bounds_, SkClipOp::kIntersect, false); |
return &*canvas_; |
} |