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

Unified 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, 3 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698