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 PaintChunker_h | |
6 #define PaintChunker_h | |
7 | |
8 #include "platform/PlatformExport.h" | |
9 #include "platform/graphics/paint/PaintChunk.h" | |
10 #include "platform/graphics/paint/PaintProperties.h" | |
11 #include "wtf/Vector.h" | |
12 | |
13 namespace blink { | |
14 | |
15 // Accepts information about changes to |PaintProperties| as drawings are | |
16 // accumulated, and produces a series of paint chunks: contiguous ranges of the | |
17 // display list with identical |PaintProperties|. | |
18 class PLATFORM_EXPORT PaintChunker { | |
19 public: | |
20 PaintChunker(); | |
21 ~PaintChunker(); | |
22 | |
23 bool isInInitialState() const { return m_chunks.isEmpty() && m_newChunk == P aintChunk(); } | |
24 | |
25 void updateCurrentPaintProperties(const PaintProperties&); | |
26 | |
27 void incrementDisplayItemIndex() { m_newChunk.endIndex++; } | |
28 void decrementDisplayItemIndex() { ASSERT(m_newChunk.endIndex > 0); m_newChu nk.endIndex--; } | |
29 | |
30 // Releases the generated paint chunk list and resets the state of this | |
31 // object. | |
32 Vector<PaintChunk> releasePaintChunks(); | |
33 | |
34 private: | |
35 Vector<PaintChunk> m_chunks; | |
36 PaintChunk m_newChunk; | |
pdr.
2015/10/01 00:32:48
Is there a reason for not putting this as the last
jbroman
2015/10/01 18:04:20
Changed to trchen's suggestion. (I did this becaus
| |
37 }; | |
38 | |
39 } // namespace blink | |
40 | |
41 #endif // PaintChunker_h | |
OLD | NEW |