Chromium Code Reviews| Index: ui/gfx/canvas.cc |
| diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc |
| index 49e32350a42e45c8c498aa7cd00534f6c578b4fb..503cee00e9a7b8ef12c29d0e8653dbacfd4ec106 100644 |
| --- a/ui/gfx/canvas.cc |
| +++ b/ui/gfx/canvas.cc |
| @@ -180,6 +180,13 @@ void Canvas::Save() { |
| canvas_->save(); |
| } |
| +float Canvas::SaveAndUnscale() { |
|
sky
2015/10/13 22:23:11
How expensive is save? The common case is scale=1.
Peter Kasting
2015/10/13 22:34:42
Save() is very cheap. Also we can't get rid of it
|
| + Save(); |
| + SkScalar scale_factor = 1.0f / image_scale_; |
|
sky
2015/10/13 22:23:11
I'm not familiar enough with what we want to happe
Peter Kasting
2015/10/13 22:34:42
I did, but I'm not convinced that's what we actual
|
| + canvas_->scale(scale_factor, scale_factor); |
| + return image_scale_; |
| +} |
| + |
| void Canvas::SaveLayerAlpha(uint8 alpha) { |
| canvas_->saveLayerAlpha(NULL, alpha); |
| } |