OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 DisplayItemClipTree_h |
| 6 #define DisplayItemClipTree_h |
| 7 |
| 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/geometry/FloatRect.h" |
| 10 #include "public/platform/WebDisplayItemClipTree.h" |
| 11 #include "wtf/Vector.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 // Represents a hierarchy of rectangular clips which apply to ranges of a |
| 16 // display list and may be of interest to the compositor. |
| 17 // |
| 18 // This class is also the private implementation of WebDisplayItemClipTree. |
| 19 // For more detail, see WebDisplayItemClipTree.h. |
| 20 class PLATFORM_EXPORT DisplayItemClipTree { |
| 21 public: |
| 22 using ClipNode = WebDisplayItemClipTree::ClipNode; |
| 23 enum : size_t { kInvalidIndex = WebDisplayItemClipTree::kInvalidIndex }; |
| 24 |
| 25 DisplayItemClipTree(); |
| 26 ~DisplayItemClipTree(); |
| 27 |
| 28 size_t nodeCount() const { return m_nodes.size(); } |
| 29 ClipNode& nodeAt(size_t index) { return m_nodes[index]; } |
| 30 const ClipNode& nodeAt(size_t index) const { return m_nodes[index]; } |
| 31 |
| 32 // Returns the new node index. |
| 33 size_t createNewNode(size_t parentNodeIndex, size_t transformNodeIndex, cons
t FloatRect& clipRect) |
| 34 { |
| 35 ASSERT(parentNodeIndex != kInvalidIndex); |
| 36 ASSERT(transformNodeIndex != kInvalidIndex); |
| 37 m_nodes.append(ClipNode(parentNodeIndex, transformNodeIndex, clipRect)); |
| 38 return m_nodes.size() - 1; |
| 39 } |
| 40 |
| 41 private: |
| 42 Vector<ClipNode> m_nodes; |
| 43 }; |
| 44 |
| 45 } // namespace blink |
| 46 |
| 47 #endif // DisplayItemClipTree_h |
OLD | NEW |