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

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

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/compositor.gyp ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer.h
===================================================================
--- ui/gfx/compositor/layer.h (revision 100773)
+++ ui/gfx/compositor/layer.h (working copy)
@@ -60,6 +60,10 @@
void SetBounds(const gfx::Rect& bounds);
const gfx::Rect& bounds() const { return bounds_; }
+ // Sets |visible_|. The Layer is drawn by Draw() only when visible_ is true.
+ bool visible() const { return visible_; }
+ void set_visible(bool visible) { visible_ = visible; }
+
// Converts a point from the coordinates of |source| to the coordinates of
// |target|. Necessarily, |source| and |target| must inhabit the same Layer
// tree.
@@ -89,25 +93,29 @@
// repaint.
void SchedulePaint(const gfx::Rect& invalid_rect);
-// Draws the layer with hole if hole is non empty.
-// hole looks like:
-//
-// layer____________________________
-// |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
-// |xxxxxxxxxxxxx top xxxxxxxxxxxxxx|
-// |________________________________|
-// |xxxxx| |xxxxx|
-// |xxxxx| Hole Rect |xxxxx|
-// |left | (not composited) |right|
-// |_____|____________________|_____|
-// |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
-// |xxxxxxxxxx bottom xxxxxxxxxxxxxx|
-// |________________________________|
-//
-// Legend:
-// composited area: x
+ // Draws the layer with hole if hole is non empty.
+ // hole looks like:
+ //
+ // layer____________________________
+ // |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
+ // |xxxxxxxxxxxxx top xxxxxxxxxxxxxx|
+ // |________________________________|
+ // |xxxxx| |xxxxx|
+ // |xxxxx| Hole Rect |xxxxx|
+ // |left | (not composited) |right|
+ // |_____|____________________|_____|
+ // |xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx|
+ // |xxxxxxxxxx bottom xxxxxxxxxxxxxx|
+ // |________________________________|
+ //
+ // Legend:
+ // composited area: x
void Draw();
+ // Draws a tree of Layers, by calling Draw() on each in the hierarchy starting
+ // with the receiver.
+ void DrawTree();
+
private:
// calls Texture::Draw only if the region to be drawn is non empty
void DrawRegion(const ui::TextureDrawParams& params,
@@ -144,6 +152,8 @@
gfx::Rect bounds_;
+ bool visible_;
+
bool fills_bounds_opaquely_;
gfx::Rect hole_rect_;
« no previous file with comments | « ui/gfx/compositor/compositor.gyp ('k') | ui/gfx/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698