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()); |
} |