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/PaintChunk.h" | 9 #include "platform/graphics/paint/PaintChunk.h" |
10 #include "platform/graphics/paint/PaintChunkProperties.h" | 10 #include "platform/graphics/paint/PaintChunkProperties.h" |
| 11 #include "wtf/Allocator.h" |
| 12 #include "wtf/Noncopyable.h" |
11 #include "wtf/Vector.h" | 13 #include "wtf/Vector.h" |
12 | 14 |
13 namespace blink { | 15 namespace blink { |
14 | 16 |
15 // Accepts information about changes to |PaintChunkProperties| as drawings are | 17 // Accepts information about changes to |PaintChunkProperties| as drawings are |
16 // accumulated, and produces a series of paint chunks: contiguous ranges of the | 18 // accumulated, and produces a series of paint chunks: contiguous ranges of the |
17 // display list with identical |PaintChunkProperties|. | 19 // display list with identical |PaintChunkProperties|. |
18 class PLATFORM_EXPORT PaintChunker { | 20 class PLATFORM_EXPORT PaintChunker final { |
| 21 DISALLOW_NEW(); |
| 22 WTF_MAKE_NONCOPYABLE(PaintChunker); |
19 public: | 23 public: |
20 PaintChunker(); | 24 PaintChunker(); |
21 ~PaintChunker(); | 25 ~PaintChunker(); |
22 | 26 |
23 bool isInInitialState() const { return m_chunks.isEmpty() && m_currentProper
ties == PaintChunkProperties(); } | 27 bool isInInitialState() const { return m_chunks.isEmpty() && m_currentProper
ties == PaintChunkProperties(); } |
24 | 28 |
25 const PaintChunkProperties& currentPaintChunkProperties() const { return m_c
urrentProperties; } | 29 const PaintChunkProperties& currentPaintChunkProperties() const { return m_c
urrentProperties; } |
26 void updateCurrentPaintChunkProperties(const PaintChunkProperties&); | 30 void updateCurrentPaintChunkProperties(const PaintChunkProperties&); |
27 | 31 |
28 void incrementDisplayItemIndex(); | 32 void incrementDisplayItemIndex(); |
29 void decrementDisplayItemIndex(); | 33 void decrementDisplayItemIndex(); |
30 | 34 |
31 void clear(); | 35 void clear(); |
32 | 36 |
33 // Releases the generated paint chunk list and resets the state of this | 37 // Releases the generated paint chunk list and resets the state of this |
34 // object. | 38 // object. |
35 Vector<PaintChunk> releasePaintChunks(); | 39 Vector<PaintChunk> releasePaintChunks(); |
36 | 40 |
37 private: | 41 private: |
38 Vector<PaintChunk> m_chunks; | 42 Vector<PaintChunk> m_chunks; |
39 PaintChunkProperties m_currentProperties; | 43 PaintChunkProperties m_currentProperties; |
40 }; | 44 }; |
41 | 45 |
42 } // namespace blink | 46 } // namespace blink |
43 | 47 |
44 #endif // PaintChunker_h | 48 #endif // PaintChunker_h |
OLD | NEW |