| Index: cc/paint/record_paint_canvas.cc
|
| diff --git a/cc/paint/record_paint_canvas.cc b/cc/paint/record_paint_canvas.cc
|
| index a635474a372be797e26a60cc88cb0f56bb645577..258b571bf123871612d53fb3f0cdc73c6169af6f 100644
|
| --- a/cc/paint/record_paint_canvas.cc
|
| +++ b/cc/paint/record_paint_canvas.cc
|
| @@ -15,9 +15,7 @@
|
|
|
| namespace cc {
|
|
|
| -RecordPaintCanvas::RecordPaintCanvas(PaintOpBuffer* buffer,
|
| - const SkRect& bounds)
|
| - : buffer_(buffer), recording_bounds_(bounds) {
|
| +RecordPaintCanvas::RecordPaintCanvas(PaintOpBuffer* buffer) : buffer_(buffer) {
|
| DCHECK(buffer_);
|
| }
|
|
|
| @@ -354,18 +352,20 @@ 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 recording_bounds_ makes a canvas of size (width x height) instead
|
| + // with the cull_rect 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_;
|
| }
|
|
|
|
|