Index: third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp |
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..526b21e9ad04fc174862383263d1a67d52d3ca3f |
--- /dev/null |
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.cpp |
@@ -0,0 +1,40 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "config.h" |
+#include "platform/graphics/paint/PaintChunker.h" |
+ |
+namespace blink { |
+ |
+PaintChunker::PaintChunker() |
+{ |
+} |
+ |
+PaintChunker::~PaintChunker() |
+{ |
+} |
+ |
+void PaintChunker::updateCurrentPaintProperties(const PaintProperties& properties) |
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
|
+{ |
+ if (m_newChunk.properties == properties) |
+ return; |
+ |
+ if (m_newChunk.beginIndex != m_newChunk.endIndex) |
+ m_chunks.append(m_newChunk); |
+ |
+ m_newChunk = PaintChunk(m_newChunk.endIndex, m_newChunk.endIndex, properties); |
+} |
+ |
+Vector<PaintChunk> PaintChunker::releasePaintChunks() |
+{ |
+ if (m_newChunk.beginIndex != m_newChunk.endIndex) |
+ m_chunks.append(m_newChunk); |
+ |
+ Vector<PaintChunk> chunks; |
+ chunks.swap(m_chunks); |
+ m_newChunk = PaintChunk(); |
+ return chunks; |
+} |
+ |
+} // namespace blink |