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 PaintChunker_h | 5 #ifndef PaintChunker_h |
6 #define PaintChunker_h | 6 #define PaintChunker_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "platform/graphics/paint/DisplayItem.h" | 9 #include "platform/graphics/paint/DisplayItem.h" |
10 #include "platform/graphics/paint/PaintChunk.h" | 10 #include "platform/graphics/paint/PaintChunk.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 ~PaintChunker(); | 26 ~PaintChunker(); |
27 | 27 |
28 bool isInInitialState() const { return m_chunks.isEmpty() && m_currentProper
ties == PaintChunkProperties(); } | 28 bool isInInitialState() const { return m_chunks.isEmpty() && m_currentProper
ties == PaintChunkProperties(); } |
29 | 29 |
30 const PaintChunkProperties& currentPaintChunkProperties() const { return m_c
urrentProperties; } | 30 const PaintChunkProperties& currentPaintChunkProperties() const { return m_c
urrentProperties; } |
31 void updateCurrentPaintChunkProperties(const PaintChunk::Id*, const PaintChu
nkProperties&); | 31 void updateCurrentPaintChunkProperties(const PaintChunk::Id*, const PaintChu
nkProperties&); |
32 | 32 |
33 void incrementDisplayItemIndex(const DisplayItem&); | 33 void incrementDisplayItemIndex(const DisplayItem&); |
34 void decrementDisplayItemIndex(); | 34 void decrementDisplayItemIndex(); |
35 | 35 |
| 36 const PaintChunk& lastChunk() const { return m_chunks.last(); } |
| 37 |
36 void clear(); | 38 void clear(); |
37 | 39 |
38 // Releases the generated paint chunk list and resets the state of this | 40 // Releases the generated paint chunk list and resets the state of this |
39 // object. | 41 // object. |
40 Vector<PaintChunk> releasePaintChunks(); | 42 Vector<PaintChunk> releasePaintChunks(); |
41 | 43 |
42 private: | 44 private: |
43 enum ItemBehavior { | 45 enum ItemBehavior { |
44 // Can be combined with adjacent items when building chunks. | 46 // Can be combined with adjacent items when building chunks. |
45 DefaultBehavior = 0, | 47 DefaultBehavior = 0, |
46 | 48 |
47 // Item requires its own paint chunk. | 49 // Item requires its own paint chunk. |
48 RequiresSeparateChunk, | 50 RequiresSeparateChunk, |
49 }; | 51 }; |
50 | 52 |
51 Vector<PaintChunk> m_chunks; | 53 Vector<PaintChunk> m_chunks; |
52 Vector<ItemBehavior> m_chunkBehavior; | 54 Vector<ItemBehavior> m_chunkBehavior; |
53 Optional<PaintChunk::Id> m_currentChunkId; | 55 Optional<PaintChunk::Id> m_currentChunkId; |
54 PaintChunkProperties m_currentProperties; | 56 PaintChunkProperties m_currentProperties; |
55 }; | 57 }; |
56 | 58 |
57 } // namespace blink | 59 } // namespace blink |
58 | 60 |
59 #endif // PaintChunker_h | 61 #endif // PaintChunker_h |
OLD | NEW |