Index: ui/compositor/paint_recorder.cc |
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc |
index 8a8c4c28caf55c97e0c6cc0c0bc55e86f98430cc..e1cb2807176bf93e943b48423633af44ec44e014 100644 |
--- a/ui/compositor/paint_recorder.cc |
+++ b/ui/compositor/paint_recorder.cc |
@@ -32,16 +32,27 @@ PaintRecorder::PaintRecorder(const PaintContext& context, |
DCHECK(!context.inside_paint_recorder_); |
context.inside_paint_recorder_ = true; |
#endif |
+ if (context_.IsPixelCanvas()) { |
+ canvas()->Save(); |
+ canvas()->Scale(context.paint_recording_scale_x_, |
+ context.paint_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.paint_recording_scale_x_, |
+ context.paint_recording_scale_y_), |
+ nullptr) {} |
PaintRecorder::~PaintRecorder() { |
#if DCHECK_IS_ON() |
context_.inside_paint_recorder_ = false; |
#endif |
+ if (context_.IsPixelCanvas()) |
+ 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. |