| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // Returns true if a new chunk is created. | 40 // Returns true if a new chunk is created. |
| 41 bool incrementDisplayItemIndex(const DisplayItem&); | 41 bool incrementDisplayItemIndex(const DisplayItem&); |
| 42 // Returns true if the last chunk is removed. | 42 // Returns true if the last chunk is removed. |
| 43 bool decrementDisplayItemIndex(); | 43 bool decrementDisplayItemIndex(); |
| 44 | 44 |
| 45 PaintChunk& paintChunkAt(size_t i) { return m_chunks[i]; } | 45 PaintChunk& paintChunkAt(size_t i) { return m_chunks[i]; } |
| 46 size_t lastChunkIndex() const { | 46 size_t lastChunkIndex() const { |
| 47 return m_chunks.isEmpty() ? kNotFound : m_chunks.size() - 1; | 47 return m_chunks.isEmpty() ? kNotFound : m_chunks.size() - 1; |
| 48 } | 48 } |
| 49 PaintChunk& lastChunk() { return m_chunks.last(); } | 49 PaintChunk& lastChunk() { return m_chunks.back(); } |
| 50 | 50 |
| 51 PaintChunk& findChunkByDisplayItemIndex(size_t index) { | 51 PaintChunk& findChunkByDisplayItemIndex(size_t index) { |
| 52 auto chunk = findChunkInVectorByDisplayItemIndex(m_chunks, index); | 52 auto chunk = findChunkInVectorByDisplayItemIndex(m_chunks, index); |
| 53 DCHECK(chunk != m_chunks.end()); | 53 DCHECK(chunk != m_chunks.end()); |
| 54 return *chunk; | 54 return *chunk; |
| 55 } | 55 } |
| 56 | 56 |
| 57 void clear(); | 57 void clear(); |
| 58 | 58 |
| 59 // Releases the generated paint chunk list and resets the state of this | 59 // Releases the generated paint chunk list and resets the state of this |
| (...skipping 24 matching lines...) Expand all Loading... |
| 84 DisableNullPaintPropertyChecks(); | 84 DisableNullPaintPropertyChecks(); |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 AutoReset<bool> m_disabler; | 87 AutoReset<bool> m_disabler; |
| 88 }; | 88 }; |
| 89 #endif // DCHECK_IS_ON() | 89 #endif // DCHECK_IS_ON() |
| 90 | 90 |
| 91 } // namespace blink | 91 } // namespace blink |
| 92 | 92 |
| 93 #endif // PaintChunker_h | 93 #endif // PaintChunker_h |
| OLD | NEW |