OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PaintArtifact_h | 5 #ifndef PaintArtifact_h |
6 #define PaintArtifact_h | 6 #define PaintArtifact_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/graphics/paint/DisplayItemList.h" | 9 #include "platform/graphics/paint/DisplayItemList.h" |
10 #include "platform/graphics/paint/PaintChunk.h" | 10 #include "platform/graphics/paint/PaintChunk.h" |
(...skipping 25 matching lines...) Loading... |
36 public: | 36 public: |
37 PaintArtifact(); | 37 PaintArtifact(); |
38 PaintArtifact(DisplayItemList, Vector<PaintChunk>); | 38 PaintArtifact(DisplayItemList, Vector<PaintChunk>); |
39 PaintArtifact(PaintArtifact&&); | 39 PaintArtifact(PaintArtifact&&); |
40 ~PaintArtifact(); | 40 ~PaintArtifact(); |
41 | 41 |
42 PaintArtifact& operator=(PaintArtifact&&); | 42 PaintArtifact& operator=(PaintArtifact&&); |
43 | 43 |
44 bool isEmpty() const { return m_displayItemList.isEmpty(); } | 44 bool isEmpty() const { return m_displayItemList.isEmpty(); } |
45 | 45 |
46 DisplayItemList& displayItemList() { return m_displayItemList; } | 46 DisplayItemList& getDisplayItemList() { return m_displayItemList; } |
47 const DisplayItemList& displayItemList() const { return m_displayItemList; } | 47 const DisplayItemList& getDisplayItemList() const { return m_displayItemList
; } |
48 | 48 |
49 Vector<PaintChunk>& paintChunks() { return m_paintChunks; } | 49 Vector<PaintChunk>& paintChunks() { return m_paintChunks; } |
50 const Vector<PaintChunk>& paintChunks() const { return m_paintChunks; } | 50 const Vector<PaintChunk>& paintChunks() const { return m_paintChunks; } |
51 | 51 |
52 // Resets to an empty paint artifact. | 52 // Resets to an empty paint artifact. |
53 void reset(); | 53 void reset(); |
54 | 54 |
55 // Returns the approximate memory usage, excluding memory likely to be | 55 // Returns the approximate memory usage, excluding memory likely to be |
56 // shared with the embedder after copying to WebDisplayItemList. | 56 // shared with the embedder after copying to WebDisplayItemList. |
57 size_t approximateUnsharedMemoryUsage() const; | 57 size_t approximateUnsharedMemoryUsage() const; |
58 | 58 |
59 // Draws the paint artifact to a GraphicsContext. | 59 // Draws the paint artifact to a GraphicsContext. |
60 void replay(GraphicsContext&) const; | 60 void replay(GraphicsContext&) const; |
61 | 61 |
62 // Writes the paint artifact into a WebDisplayItemList. | 62 // Writes the paint artifact into a WebDisplayItemList. |
63 void appendToWebDisplayItemList(WebDisplayItemList*) const; | 63 void appendToWebDisplayItemList(WebDisplayItemList*) const; |
64 | 64 |
65 private: | 65 private: |
66 DisplayItemList m_displayItemList; | 66 DisplayItemList m_displayItemList; |
67 Vector<PaintChunk> m_paintChunks; | 67 Vector<PaintChunk> m_paintChunks; |
68 | 68 |
69 friend class PaintControllerTest; | 69 friend class PaintControllerTest; |
70 }; | 70 }; |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
73 | 73 |
74 #endif // PaintArtifact_h | 74 #endif // PaintArtifact_h |
OLD | NEW |