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

Unified Diff: cc/trees/clip_node.h

Issue 2423483003: cc: Make visible rect computation aware of pixel-moving filters (Closed)
Patch Set: Rebaseline Created 4 years, 2 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
Index: cc/trees/clip_node.h
diff --git a/cc/trees/clip_node.h b/cc/trees/clip_node.h
index fe315d460528f20b3e10a66d55842edbe5dffe93..81cf806333216ce212cd7680acc6fbe8b41c5700 100644
--- a/cc/trees/clip_node.h
+++ b/cc/trees/clip_node.h
@@ -6,6 +6,7 @@
#define CC_TREES_CLIP_NODE_H_
#include "cc/base/cc_export.h"
+#include "cc/trees/clip_expander.h"
#include "ui/gfx/geometry/rect_f.h"
namespace base {
@@ -34,7 +35,15 @@ struct CC_EXPORT ClipNode {
NONE,
// The node contributes a new clip (that is, |clip| needs to be applied).
- APPLIES_LOCAL_CLIP
+ APPLIES_LOCAL_CLIP,
+
+ // This node represents a space expansion. When computing visible rects,
+ // the accumulated clip inherited by this node gets expanded. Similarly,
+ // when mapping a rect in descendant space to the rect in ancestor space
+ // that depends on the descendant rect's contents, this node expands the
+ // descendant rect. This is used for effects like pixel-moving filters,
+ // where clipped-out content can affect visible output.
+ EXPANDS_CLIP
};
ClipType clip_type;
@@ -43,6 +52,9 @@ struct CC_EXPORT ClipNode {
// transform node.
gfx::RectF clip;
+ // For nodes that expand, this represents the amount of expansion.
+ ClipExpander clip_expander;
weiliangc 2016/10/26 16:57:03 Why not a nullable unique_ptr? We could avoid defa
ajuma 2016/10/31 17:43:07 Done. Also added the protobuf transfer logic and a
+
// 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

Powered by Google App Engine
This is Rietveld 408576698