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

Side by Side Diff: Source/platform/graphics/paint/DisplayItemClipTree.h

Issue 1296963002: Put transform tree building in DisplayItemPropertyTreeBuilder. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comment for inline capacity Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW
« no previous file with comments | « Source/platform/exported/WebDisplayItemTransformTree.cpp ('k') | Source/platform/graphics/paint/DisplayItemClipTree.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698