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

Unified Diff: ui/gfx/compositor/layer.cc

Issue 7845033: Rework View Layer Draw() to use the Layer::DrawTree() method and the LayerDelegate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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/gfx/compositor/layer.cc
===================================================================
--- ui/gfx/compositor/layer.cc (revision 100773)
+++ ui/gfx/compositor/layer.cc (working copy)
@@ -118,6 +118,9 @@
}
void Layer::Draw() {
+ if (!visible_)
+ return;
+
UpdateLayerCanvas();
ui::TextureDrawParams texture_draw_params;
@@ -161,6 +164,12 @@
bounds_.height() - hole_rect_.bottom()));
}
+void Layer::DrawTree() {
+ Draw();
+ for (size_t i = 0; i < children_.size(); ++i)
sky 2011/09/13 17:47:06 I don't think you want to paint children if this i
+ children_.at(i)->DrawTree();
+}
+
void Layer::DrawRegion(const ui::TextureDrawParams& params,
const gfx::Rect& region_to_draw) {
if (!region_to_draw.IsEmpty())
@@ -181,7 +190,7 @@
scoped_ptr<gfx::Canvas> canvas(gfx::Canvas::CreateCanvas(
draw_rect.width(), draw_rect.height(), false));
canvas->TranslateInt(draw_rect.x(), draw_rect.y());
- delegate_->OnPaint(canvas.get());
+ delegate_->OnPaintLayer(canvas.get());
SetCanvas(*canvas->AsCanvasSkia(), bounds().origin());
}
« no previous file with comments | « ui/gfx/compositor/layer.h ('k') | ui/gfx/compositor/layer_delegate.h » ('j') | views/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698