| Index: ui/compositor/paint_recorder.cc
|
| diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc
|
| index ddf9f1b76c9c4abe4fee81dc05775eac97802267..4e222eb420127e912b5c9e0fb6ae96d15967a807 100644
|
| --- a/ui/compositor/paint_recorder.cc
|
| +++ b/ui/compositor/paint_recorder.cc
|
| @@ -21,6 +21,7 @@ namespace ui {
|
| // to the |context|'s PaintOpBuffer.
|
| PaintRecorder::PaintRecorder(const PaintContext& context,
|
| const gfx::Size& recording_size,
|
| + const gfx::PointF& recording_scale,
|
| PaintCache* cache)
|
| : context_(context),
|
| local_list_(cache ? base::MakeRefCounted<cc::DisplayItemList>(
|
| @@ -38,19 +39,32 @@ PaintRecorder::PaintRecorder(const PaintContext& context,
|
| }
|
|
|
| #if DCHECK_IS_ON()
|
| - DCHECK(!context.inside_paint_recorder_);
|
| - context.inside_paint_recorder_ = true;
|
| + DCHECK(!context_.inside_paint_recorder_);
|
| + context_.inside_paint_recorder_ = true;
|
| #endif
|
| + if (context_.is_pixel_canvas()) {
|
| + canvas()->Save();
|
| + canvas()->Scale(recording_scale.x(), recording_scale.y());
|
| + }
|
| }
|
|
|
| PaintRecorder::PaintRecorder(const PaintContext& context,
|
| const gfx::Size& recording_size)
|
| - : PaintRecorder(context, recording_size, nullptr) {}
|
| + : PaintRecorder(
|
| + context,
|
| + gfx::ScaleToRoundedSize(
|
| + recording_size,
|
| + context.is_pixel_canvas() ? context.device_scale_factor_ : 1.f),
|
| + gfx::PointF(context.device_scale_factor_,
|
| + context.device_scale_factor_),
|
| + nullptr) {}
|
|
|
| PaintRecorder::~PaintRecorder() {
|
| #if DCHECK_IS_ON()
|
| context_.inside_paint_recorder_ = false;
|
| #endif
|
| + if (context_.is_pixel_canvas())
|
| + canvas()->Restore();
|
| // If using cache, append what we've saved there to the PaintContext.
|
| // Otherwise, the content is already stored in the PaintContext, and we can
|
| // just close it.
|
|
|