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

Unified Diff: cc/trees/clip_node.h

Issue 2655233006: cc : Clean up cc clip tree (Closed)
Patch Set: rebase Created 3 years, 9 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/tiles/tile_manager_unittest.cc ('k') | cc/trees/clip_node.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/clip_node.h
diff --git a/cc/trees/clip_node.h b/cc/trees/clip_node.h
index 3dc95e9fb8a4a4f139ec8bb1b4316303b0146257..5c204549d1cce6f4d9942ddfabd36668993d87ac 100644
--- a/cc/trees/clip_node.h
+++ b/cc/trees/clip_node.h
@@ -27,6 +27,8 @@ struct CC_EXPORT ClipNode {
~ClipNode();
+ static const int defaultCachedClipsSize = 1;
+
// The node index of this node in the clip tree node vector.
int id;
// The node index of the parent node in the clip tree node vector.
@@ -35,10 +37,6 @@ struct CC_EXPORT ClipNode {
int owning_layer_id;
enum class ClipType {
- // The node doesn't contribute a new clip. It exists only for caching clips
- // or for resetting clipping state.
- NONE,
-
// The node contributes a new clip (that is, |clip| needs to be applied).
APPLIES_LOCAL_CLIP,
@@ -57,46 +55,20 @@ struct CC_EXPORT ClipNode {
// transform node.
gfx::RectF clip;
+ // Each element of this cache stores the accumulated clip from this clip
+ // node to a particular target.
+ mutable std::vector<ClipRectData> cached_clip_rects;
+
+ // This rect accumulates all clips from this node to the root in screen space.
+ // It is used in the computation of layer's visible rect.
+ gfx::RectF cached_accumulated_rect_in_screen_space;
+
// For nodes that expand, this represents the amount of expansion.
std::unique_ptr<ClipExpander> clip_expander;
- // Clip nodes are used for two reasons. First, they are used for determining
- // which parts of each layer are visible. Second, they are used for
- // determining whether a clip needs to be applied when drawing a layer, and if
- // so, the rect that needs to be used. These can be different since not all
- // clips need to be applied directly to each layer. For example, a layer is
- // implicitly clipped by the bounds of its target render surface and by clips
- // applied to this surface. |combined_clip_in_target_space| is used for
- // computing visible rects, and |clip_in_target_space| is used for computing
- // clips applied at draw time. Both rects are expressed in the space of the
- // target transform node, and may include clips contributed by ancestors.
- gfx::RectF combined_clip_in_target_space;
- gfx::RectF clip_in_target_space;
-
// The id of the transform node that defines the clip node's local space.
int transform_id;
- // The id of the transform node that defines the clip node's target space.
- int target_transform_id;
-
- // The id of the effect node that defines the clip node's target space.
- // TODO(crbug.com/642581 crbug.com/642584): As we progress toward SPv2 and
- // layer list mode, there may be layers having the same clip but draw onto
- // different target. Target information shall be removed from here.
- int target_effect_id;
-
- // When true, |clip_in_target_space| does not include clips from ancestor
- // nodes.
- bool layer_clipping_uses_only_local_clip : 1;
-
- // True if layers with this clip tree node need to be drawn with a clip
- // applied.
- bool layers_are_clipped : 1;
- bool layers_are_clipped_when_surfaces_disabled : 1;
-
- // Nodes that correspond to unclipped surfaces disregard ancestor clips.
- bool resets_clip : 1;
-
bool operator==(const ClipNode& other) const;
void AsValueInto(base::trace_event::TracedValue* value) const;
« no previous file with comments | « cc/tiles/tile_manager_unittest.cc ('k') | cc/trees/clip_node.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698