Index: ui/compositor/paint_recorder.cc |
diff --git a/ui/compositor/paint_recorder.cc b/ui/compositor/paint_recorder.cc |
index 8a8c4c28caf55c97e0c6cc0c0bc55e86f98430cc..fb9d018012c3b3927635fa87ddb7854a4d0a9429 100644 |
--- a/ui/compositor/paint_recorder.cc |
+++ b/ui/compositor/paint_recorder.cc |
@@ -32,16 +32,25 @@ PaintRecorder::PaintRecorder(const PaintContext& context, |
DCHECK(!context.inside_paint_recorder_); |
context.inside_paint_recorder_ = true; |
#endif |
+ if (context_.IsPixelCanvas()) { |
+ canvas()->Save(); |
+ canvas()->Scale(context.effective_scale_factor_x(), |
+ context.effective_scale_factor_y()); |
+ } |
} |
PaintRecorder::PaintRecorder(const PaintContext& context, |
const gfx::Size& recording_size) |
- : PaintRecorder(context, recording_size, nullptr) {} |
+ : PaintRecorder(context, |
+ context.ScaleToCorneredPixelSize(recording_size), |
+ 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. |