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

Unified Diff: cc/trees/clip_expander.h

Issue 2423483003: cc: Make visible rect computation aware of pixel-moving filters (Closed)
Patch Set: Rebase Created 4 years, 1 month 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/proto/property_tree.proto ('k') | cc/trees/clip_expander.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/clip_expander.h
diff --git a/cc/trees/clip_expander.h b/cc/trees/clip_expander.h
new file mode 100644
index 0000000000000000000000000000000000000000..4ddad78ec8d02d173f969aa29a5dc2e9fd13c6c4
--- /dev/null
+++ b/cc/trees/clip_expander.h
@@ -0,0 +1,51 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_TREES_CLIP_EXPANDER_H_
+#define CC_TREES_CLIP_EXPANDER_H_
+
+#include "cc/base/cc_export.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace gfx {
+class Transform;
+}
+
+namespace cc {
+
+class PropertyTrees;
+
+class CC_EXPORT ClipExpander {
+ public:
+ enum class ExpanderType { FILTER };
+
+ ClipExpander(ExpanderType type, int filter_effect_id);
weiliangc 2016/10/31 18:20:25 Is there an expander type that is not Filter that
ajuma 2016/10/31 18:28:05 Yeah, I believe there are other kinds of expanding
+ ClipExpander(const ClipExpander& other);
+
+ bool operator==(const ClipExpander& other) const;
+
+ bool operator!=(const ClipExpander& other) const { return !(*this == other); }
+
+ // Maps "forward" to determine which pixels in a destination rect are affected
+ // by pixels in the given source rect.
+ gfx::Rect MapRect(const gfx::Rect& rect,
+ const PropertyTrees* property_trees) const;
+
+ // Maps "backward" to determine which pixels in the source affect the pixels
+ // in the given destination rect.
+ gfx::Rect MapRectReverse(const gfx::Rect& rect,
+ const PropertyTrees* property_trees) const;
+
+ // The id of the effect node in whose transform space the expansion happens.
+ int target_effect_id() const { return target_effect_id_; }
+
+ private:
+ ExpanderType expander_type_;
+
+ int target_effect_id_;
+};
+
+} // namespace cc
+
+#endif // CC_TREES_CLIP_EXPANDER_H_
« no previous file with comments | « cc/proto/property_tree.proto ('k') | cc/trees/clip_expander.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698