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..aa0ae2437c26b39d9d6a5864824092fb72649e59 |
--- /dev/null |
+++ b/cc/trees/clip_expander.h |
@@ -0,0 +1,50 @@ |
+// 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: |
+ ClipExpander(); |
+ |
+ static ClipExpander CreateForFilter(int effect_node_id); |
+ |
+ // 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: |
+ enum class ExpanderType { NONE, FILTER }; |
+ |
+ ExpanderType expander_type_; |
+ |
+ ClipExpander(ExpanderType type, int filter_effect_id); |
+ |
+ int target_effect_id_; |
+}; |
+ |
+} // namespace cc |
+ |
+#endif // CC_TREES_CLIP_EXPANDER_H_ |