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

Side by Side Diff: ui/gfx/compositor/layer.h

Issue 8653005: Make Aura and compositor stacking methods more intuitive. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_ 5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_
6 #define UI_GFX_COMPOSITOR_LAYER_H_ 6 #define UI_GFX_COMPOSITOR_LAYER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 65
66 // Adds a new Layer to this Layer. 66 // Adds a new Layer to this Layer.
67 void Add(Layer* child); 67 void Add(Layer* child);
68 68
69 // Removes a Layer from this Layer. 69 // Removes a Layer from this Layer.
70 void Remove(Layer* child); 70 void Remove(Layer* child);
71 71
72 // Stacks |child| above all other children. 72 // Stacks |child| above all other children.
73 void StackAtTop(Layer* child); 73 void StackAtTop(Layer* child);
74 74
75 // Stacks |child| above |other|, both of which must be children of this layer. 75 // Stacks |child| directly above |other|. Both must be children of this
76 // Does nothing if |other| is already above |child|. 76 // layer. Note that if |child| is initially stacked even higher, calling this
77 // method will result in |child| being lowered in the stacking order.
77 void StackAbove(Layer* child, Layer* other); 78 void StackAbove(Layer* child, Layer* other);
78 79
79 // Returns the child Layers. 80 // Returns the child Layers.
80 const std::vector<Layer*>& children() const { return children_; } 81 const std::vector<Layer*>& children() const { return children_; }
81 82
82 // The parent. 83 // The parent.
83 const Layer* parent() const { return parent_; } 84 const Layer* parent() const { return parent_; }
84 Layer* parent() { return parent_; } 85 Layer* parent() { return parent_; }
85 86
86 // Returns true if this Layer contains |other| somewhere in its children. 87 // Returns true if this Layer contains |other| somewhere in its children.
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 #endif 295 #endif
295 296
296 const LayerType type_; 297 const LayerType type_;
297 298
298 Compositor* compositor_; 299 Compositor* compositor_;
299 300
300 scoped_refptr<ui::Texture> texture_; 301 scoped_refptr<ui::Texture> texture_;
301 302
302 Layer* parent_; 303 Layer* parent_;
303 304
305 // This layer's children, in bottom-to-top stacking order.
304 std::vector<Layer*> children_; 306 std::vector<Layer*> children_;
305 307
306 ui::Transform transform_; 308 ui::Transform transform_;
307 309
308 gfx::Rect bounds_; 310 gfx::Rect bounds_;
309 311
310 // Visibility of this layer. See SetVisible/IsDrawn for more details. 312 // Visibility of this layer. See SetVisible/IsDrawn for more details.
311 bool visible_; 313 bool visible_;
312 314
313 bool fills_bounds_opaquely_; 315 bool fills_bounds_opaquely_;
(...skipping 19 matching lines...) Expand all
333 WebKit::WebLayer web_layer_; 335 WebKit::WebLayer web_layer_;
334 bool web_layer_is_accelerated_; 336 bool web_layer_is_accelerated_;
335 #endif 337 #endif
336 338
337 DISALLOW_COPY_AND_ASSIGN(Layer); 339 DISALLOW_COPY_AND_ASSIGN(Layer);
338 }; 340 };
339 341
340 } // namespace ui 342 } // namespace ui
341 343
342 #endif // UI_GFX_COMPOSITOR_LAYER_H_ 344 #endif // UI_GFX_COMPOSITOR_LAYER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698