Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp

Issue 1379883003: Create PaintChunk and begin writing code to build paint chunks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698