Index: cc/layers/layer.h |
diff --git a/cc/layers/layer.h b/cc/layers/layer.h |
index f37218642e13259fbfaa0822c412b380d20bfa85..3cd41034bc017af833cdfbd8b658a3792e4ddc9c 100644 |
--- a/cc/layers/layer.h |
+++ b/cc/layers/layer.h |
@@ -24,6 +24,7 @@ |
#include "cc/layers/paint_properties.h" |
#include "cc/layers/render_surface.h" |
#include "cc/output/filter_operations.h" |
+#include "cc/trees/property_tree.h" |
#include "skia/ext/refptr.h" |
#include "third_party/skia/include/core/SkColor.h" |
#include "third_party/skia/include/core/SkImageFilter.h" |
@@ -180,7 +181,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
bool transform_is_invertible() const { return transform_is_invertible_; } |
void SetTransformOrigin(const gfx::Point3F&); |
- gfx::Point3F transform_origin() { return transform_origin_; } |
+ gfx::Point3F transform_origin() const { return transform_origin_; } |
void SetScrollParent(Layer* parent); |
@@ -245,6 +246,10 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
gfx::Rect visible_content_rect() const { |
return draw_properties_.visible_content_rect; |
} |
+ bool has_render_target() const { |
enne (OOO)
2014/12/10 23:45:59
What does this mean? When does something not have
Ian Vollick
2014/12/12 03:01:47
Yeah, this surprised me too. It can happen when, e
enne (OOO)
2014/12/12 19:05:48
If the subtree is skipped, why are you asking for
Ian Vollick
2014/12/15 21:45:17
Turns out that there are quite a few reasons we sk
|
+ return draw_properties_.render_target && |
+ draw_properties_.render_target->render_surface(); |
+ } |
Layer* render_target() { |
DCHECK(!draw_properties_.render_target || |
draw_properties_.render_target->render_surface()); |
@@ -457,11 +462,39 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
needs_push_properties_ = false; |
} |
+ bool NeedsVisibleRectUpdated() const; |
+ |
virtual void RunMicroBenchmark(MicroBenchmark* benchmark); |
void Set3dSortingContextId(int id); |
int sorting_context_id() const { return sorting_context_id_; } |
+ void set_transform_tree_index(int index) { transform_tree_index_ = index; } |
+ void set_clip_tree_index(int index) { clip_tree_index_ = index; } |
+ int clip_tree_index() const { return clip_tree_index_; } |
+ int transform_tree_index() const { return transform_tree_index_; } |
+ |
+ void set_offset_to_transform_parent(gfx::Vector2dF offset) { |
+ offset_to_transform_parent_ = offset; |
+ } |
+ gfx::Vector2dF offset_to_transform_parent() const { |
+ return offset_to_transform_parent_; |
+ } |
+ |
+ // TODO(vollick): Once we transition to transform and clip trees, rename these |
+ // functions and related values. The "debug" functions below use the |
+ // transform and clip trees. Eventually, we will use these functions to |
+ // compute the official values, but these functions are retained for testing |
+ // purposes until we've migrated. |
+ |
+ const gfx::Rect& debug_visible_rect() const { return debug_visible_rect_; } |
enne (OOO)
2014/12/10 23:45:59
bikeshedding, but maybe visible_rect_from_property
Ian Vollick
2014/12/12 03:01:47
Done.
|
+ void set_debug_visible_rect(const gfx::Rect& rect) { |
+ debug_visible_rect_ = rect; |
+ } |
+ |
+ gfx::Transform debug_screen_space_transform(const TransformTree& tree) const; |
+ gfx::Transform debug_draw_transform(const TransformTree& tree) const; |
+ |
protected: |
friend class LayerImpl; |
friend class TreeSynchronizer; |
@@ -589,6 +622,10 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
// this layer. |
int scroll_clip_layer_id_; |
int num_descendants_that_draw_content_; |
+ int transform_tree_index_; |
+ int opacity_tree_index_; |
+ int clip_tree_index_; |
+ gfx::Vector2dF offset_to_transform_parent_; |
bool should_scroll_on_main_thread_ : 1; |
bool have_wheel_event_handlers_ : 1; |
bool have_scroll_event_handlers_ : 1; |
@@ -641,6 +678,7 @@ class CC_EXPORT Layer : public base::RefCounted<Layer>, |
PaintProperties paint_properties_; |
+ gfx::Rect debug_visible_rect_; |
DISALLOW_COPY_AND_ASSIGN(Layer); |
}; |