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

Unified Diff: cc/trees/property_tree.h

Issue 2639723002: [NOT FOR REVIEW]
Patch Set: . Created 3 years, 11 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 | « cc/trees/layer_tree_settings.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.h
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h
index 58d4f5f823d3cdf8e1e8937f279dc7abac405666..77e70367cca2798032177d0a9b2e443f06dd1e15 100644
--- a/cc/trees/property_tree.h
+++ b/cc/trees/property_tree.h
@@ -100,6 +100,7 @@ class CC_EXPORT PropertyTree {
private:
std::vector<T> nodes_;
+ friend class ClipTree;
friend class TransformTree;
bool needs_update_;
PropertyTrees* property_trees_;
@@ -286,6 +287,7 @@ class CC_EXPORT ClipTree final : public PropertyTree<ClipNode> {
void SetViewportClip(gfx::RectF viewport_rect);
gfx::RectF ViewportClip() const;
+ void set_needs_update(bool needs_update);
};
class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
@@ -534,10 +536,33 @@ struct DrawTransformData {
transforms(gfx::Transform(), gfx::Transform()) {}
};
+struct ConditionalClip {
+ bool is_clipped;
+ gfx::RectF clip_rect;
+};
+
+struct ClipRectData {
+ int update_number;
+ int target_id;
+ ConditionalClip clip;
+
+ ClipRectData() : update_number(-1), target_id(-1) {}
+};
+
+struct VisibleRectData {
+ int update_number;
+ gfx::RectF visible_rect;
+
+ VisibleRectData() : update_number(-1) {}
+};
+
struct PropertyTreesCachedData {
int transform_tree_update_number;
+ int clip_tree_update_number;
std::vector<AnimationScaleData> animation_scales;
mutable std::vector<std::vector<DrawTransformData>> draw_transforms;
+ mutable std::vector<std::vector<ClipRectData>> clip_rects;
+ mutable std::vector<VisibleRectData> visible_rects;
PropertyTreesCachedData();
~PropertyTreesCachedData();
@@ -636,6 +661,7 @@ class CC_EXPORT PropertyTrees final {
void ResetCachedData();
void UpdateTransformTreeUpdateNumber();
+ void UpdateClipTreeUpdateNumber();
gfx::Transform ToScreenSpaceTransformWithoutSurfaceContentsScale(
int transform_id,
int effect_id) const;
@@ -644,6 +670,17 @@ class CC_EXPORT PropertyTrees final {
int effect_id,
gfx::Transform* transform) const;
+ ConditionalClip& FetchClipRectFromCache(int clip_id,
+ int target_id,
+ int cache_index) const;
+ int ClipRectCacheId(int clip_id, int target_id) const;
+ void AddToClipRectCache(int clip_id,
+ int target_id,
+ const ConditionalClip& clip);
+ bool IsInVisibleRectCache(int clip_id) const;
+ gfx::RectF FetchVisibleRectFromCache(int clip_id) const;
+ void AddToVisibleRectCache(int clip_id, const gfx::RectF& rect);
+
private:
gfx::Vector2dF inner_viewport_container_bounds_delta_;
gfx::Vector2dF outer_viewport_container_bounds_delta_;
« no previous file with comments | « cc/trees/layer_tree_settings.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698