OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CC_TREES_CLIP_EXPANDER_H_ |
| 6 #define CC_TREES_CLIP_EXPANDER_H_ |
| 7 |
| 8 #include "cc/base/cc_export.h" |
| 9 #include "ui/gfx/geometry/rect.h" |
| 10 |
| 11 namespace gfx { |
| 12 class Transform; |
| 13 } |
| 14 |
| 15 namespace cc { |
| 16 |
| 17 class PropertyTrees; |
| 18 |
| 19 class CC_EXPORT ClipExpander { |
| 20 public: |
| 21 ClipExpander(); |
| 22 |
| 23 static ClipExpander CreateForFilter(int effect_node_id); |
| 24 |
| 25 // Maps "forward" to determine which pixels in a destination rect are affected |
| 26 // by pixels in the given source rect. |
| 27 gfx::Rect MapRect(const gfx::Rect& rect, |
| 28 const PropertyTrees* property_trees) const; |
| 29 |
| 30 // Maps "backward" to determine which pixels in the source affect the pixels |
| 31 // in the given destination rect. |
| 32 gfx::Rect MapRectReverse(const gfx::Rect& rect, |
| 33 const PropertyTrees* property_trees) const; |
| 34 |
| 35 // The id of the effect node in whose transform space the expansion happens. |
| 36 int target_effect_id() const { return target_effect_id_; } |
| 37 |
| 38 private: |
| 39 enum class ExpanderType { NONE, FILTER }; |
| 40 |
| 41 ExpanderType expander_type_; |
| 42 |
| 43 ClipExpander(ExpanderType type, int filter_effect_id); |
| 44 |
| 45 int target_effect_id_; |
| 46 }; |
| 47 |
| 48 } // namespace cc |
| 49 |
| 50 #endif // CC_TREES_CLIP_EXPANDER_H_ |
OLD | NEW |