Chromium Code Reviews| 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 #include "config.h" | |
| 6 #include "platform/graphics/paint/PaintChunker.h" | |
| 7 | |
| 8 namespace blink { | |
| 9 | |
| 10 PaintChunker::PaintChunker() | |
| 11 { | |
| 12 } | |
| 13 | |
| 14 PaintChunker::~PaintChunker() | |
| 15 { | |
| 16 } | |
| 17 | |
| 18 void PaintChunker::updateCurrentPaintProperties(const PaintProperties& propertie s) | |
|
trchen
2015/10/01 02:19:36
I think we can improve this a little bit.
IMO we s
jbroman
2015/10/01 18:04:20
I'd have expected that case to be rare, because Bl
| |
| 19 { | |
| 20 if (m_newChunk.properties == properties) | |
| 21 return; | |
| 22 | |
| 23 if (m_newChunk.beginIndex != m_newChunk.endIndex) | |
| 24 m_chunks.append(m_newChunk); | |
| 25 | |
| 26 m_newChunk = PaintChunk(m_newChunk.endIndex, m_newChunk.endIndex, properties ); | |
| 27 } | |
| 28 | |
| 29 Vector<PaintChunk> PaintChunker::releasePaintChunks() | |
| 30 { | |
| 31 if (m_newChunk.beginIndex != m_newChunk.endIndex) | |
| 32 m_chunks.append(m_newChunk); | |
| 33 | |
| 34 Vector<PaintChunk> chunks; | |
| 35 chunks.swap(m_chunks); | |
| 36 m_newChunk = PaintChunk(); | |
| 37 return chunks; | |
| 38 } | |
| 39 | |
| 40 } // namespace blink | |
| OLD | NEW |