Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: ui/compositor/layer.cc

Issue 10701063: Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index f45fd8471ce856aeb92ca0bb815003694cf64945..495f844bc14233ecb7bd454eb9fd0cffce6decef 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -428,11 +428,20 @@ void Layer::paintContents(WebKit::WebCanvas* web_canvas,
WebKit::WebRect& opaque) {
#endif
TRACE_EVENT0("ui", "Layer::paintContents");
- gfx::Canvas canvas(web_canvas,
- ui::GetScaleFactorFromScale(device_scale_factor_), scale_content_);
+ scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
+ web_canvas, ui::GetScaleFactorFromScale(device_scale_factor_)));
+
+ bool scale_content = scale_content_;
sky 2012/07/16 14:26:51 Why do you need scale_content here?
pkotwicz 2012/07/17 17:19:52 Done.
+ if (scale_content) {
+ canvas->Save();
+ canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_),
+ SkFloatToScalar(device_scale_factor_));
+ }
if (delegate_)
- delegate_->OnPaintLayer(&canvas);
+ delegate_->OnPaintLayer(canvas.get());
+ if (scale_content)
+ canvas->Restore();
}
void Layer::SetForceRenderSurface(bool force) {

Powered by Google App Engine
This is Rietveld 408576698