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

Unified Diff: ui/compositor/layer.cc

Issue 10790128: Revert 147915 - 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
« no previous file with comments | « ui/base/native_theme/native_theme_base.cc ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
===================================================================
--- ui/compositor/layer.cc (revision 147935)
+++ ui/compositor/layer.cc (working copy)
@@ -488,19 +488,11 @@
WebKit::WebRect& opaque) {
#endif
TRACE_EVENT0("ui", "Layer::paintContents");
- scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
- web_canvas, ui::GetScaleFactorFromScale(device_scale_factor_)));
+ gfx::Canvas canvas(web_canvas,
+ ui::GetScaleFactorFromScale(device_scale_factor_), scale_content_);
- if (scale_content_) {
- canvas->Save();
- canvas->sk_canvas()->scale(SkFloatToScalar(device_scale_factor_),
- SkFloatToScalar(device_scale_factor_));
- }
-
if (delegate_)
- delegate_->OnPaintLayer(canvas.get());
- if (scale_content_)
- canvas->Restore();
+ delegate_->OnPaintLayer(&canvas);
}
unsigned Layer::prepareTexture(WebKit::WebTextureUpdater& /* updater */) {
« no previous file with comments | « ui/base/native_theme/native_theme_base.cc ('k') | ui/compositor/layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698