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

Unified Diff: ui/compositor/layer.cc

Issue 1124223010: ui: Eliminate allocating gfx::Canvas on the heap for every view. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: canvasstack: fixcompile Created 5 years, 7 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 | « no previous file | ui/compositor/paint_recorder.h » ('j') | ui/compositor/paint_recorder.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index f88557c2dba89b0aab0af5ead1a227d118bf2b4e..c1347c4e36cc9456d3aa243e22e462505f1fa95a 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -747,10 +747,10 @@ void Layer::PaintContents(
ContentLayerClient::PaintingControlSetting painting_control) {
TRACE_EVENT1("ui", "Layer::PaintContents", "name", name_);
ClearDamagedRects();
- scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvasWithoutScaling(
- sk_canvas, device_scale_factor_));
- if (delegate_)
- delegate_->OnPaintLayer(PaintContext(canvas.get(), clip));
+ if (delegate_) {
+ gfx::Canvas canvas(sk_canvas, device_scale_factor_);
+ delegate_->OnPaintLayer(PaintContext(&canvas, clip));
+ }
}
void Layer::PaintContentsToDisplayList(
« no previous file with comments | « no previous file | ui/compositor/paint_recorder.h » ('j') | ui/compositor/paint_recorder.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698