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

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
« no previous file with comments | « ui/gfx/compositor/layer.h ('k') | ui/gfx/compositor/layer_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer.cc
===================================================================
--- ui/gfx/compositor/layer.cc (revision 100773)
+++ ui/gfx/compositor/layer.cc (working copy)
@@ -17,6 +17,7 @@
: compositor_(compositor),
texture_(compositor->CreateTexture()),
parent_(NULL),
+ visible_(true),
fills_bounds_opaquely_(false),
delegate_(NULL) {
}
@@ -161,6 +162,15 @@
bounds_.height() - hole_rect_.bottom()));
}
+void Layer::DrawTree() {
+ if (!visible_)
+ return;
+
+ Draw();
+ for (size_t i = 0; i < children_.size(); ++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 +191,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698