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 #include "platform/graphics/paint/PaintChunker.h" | 5 #include "platform/graphics/paint/PaintChunker.h" |
6 | 6 |
7 #include "platform/RuntimeEnabledFeatures.h" | 7 #include "platform/RuntimeEnabledFeatures.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 bool PaintChunker::decrementDisplayItemIndex() { | 72 bool PaintChunker::decrementDisplayItemIndex() { |
73 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 73 DCHECK(RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
74 DCHECK(!m_chunks.isEmpty()); | 74 DCHECK(!m_chunks.isEmpty()); |
75 | 75 |
76 auto& lastChunk = m_chunks.last(); | 76 auto& lastChunk = m_chunks.last(); |
77 if ((lastChunk.endIndex - lastChunk.beginIndex) > 1) { | 77 if ((lastChunk.endIndex - lastChunk.beginIndex) > 1) { |
78 lastChunk.endIndex--; | 78 lastChunk.endIndex--; |
79 return false; | 79 return false; |
80 } | 80 } |
81 | 81 |
82 m_chunks.removeLast(); | 82 m_chunks.pop_back(); |
83 m_chunkBehavior.removeLast(); | 83 m_chunkBehavior.pop_back(); |
84 return true; | 84 return true; |
85 } | 85 } |
86 | 86 |
87 void PaintChunker::clear() { | 87 void PaintChunker::clear() { |
88 m_chunks.clear(); | 88 m_chunks.clear(); |
89 m_chunkBehavior.clear(); | 89 m_chunkBehavior.clear(); |
90 m_currentChunkId = WTF::nullopt; | 90 m_currentChunkId = WTF::nullopt; |
91 m_currentProperties = PaintChunkProperties(); | 91 m_currentProperties = PaintChunkProperties(); |
92 } | 92 } |
93 | 93 |
94 Vector<PaintChunk> PaintChunker::releasePaintChunks() { | 94 Vector<PaintChunk> PaintChunker::releasePaintChunks() { |
95 Vector<PaintChunk> chunks; | 95 Vector<PaintChunk> chunks; |
96 chunks.swap(m_chunks); | 96 chunks.swap(m_chunks); |
97 m_chunkBehavior.clear(); | 97 m_chunkBehavior.clear(); |
98 m_currentChunkId = WTF::nullopt; | 98 m_currentChunkId = WTF::nullopt; |
99 m_currentProperties = PaintChunkProperties(); | 99 m_currentProperties = PaintChunkProperties(); |
100 return chunks; | 100 return chunks; |
101 } | 101 } |
102 | 102 |
103 } // namespace blink | 103 } // namespace blink |
OLD | NEW |