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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h

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.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
new file mode 100644
index 0000000000000000000000000000000000000000..536f9691349b8c1b81a8d2eb1a029b15428449b9
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunker.h
@@ -0,0 +1,41 @@
+// 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.
+
+#ifndef PaintChunker_h
+#define PaintChunker_h
+
+#include "platform/PlatformExport.h"
+#include "platform/graphics/paint/PaintChunk.h"
+#include "platform/graphics/paint/PaintProperties.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+// Accepts information about changes to |PaintProperties| as drawings are
+// accumulated, and produces a series of paint chunks: contiguous ranges of the
+// display list with identical |PaintProperties|.
+class PLATFORM_EXPORT PaintChunker {
+public:
+ PaintChunker();
+ ~PaintChunker();
+
+ bool isInInitialState() const { return m_chunks.isEmpty() && m_newChunk == PaintChunk(); }
+
+ void updateCurrentPaintProperties(const PaintProperties&);
+
+ void incrementDisplayItemIndex() { m_newChunk.endIndex++; }
+ void decrementDisplayItemIndex() { ASSERT(m_newChunk.endIndex > 0); m_newChunk.endIndex--; }
+
+ // Releases the generated paint chunk list and resets the state of this
+ // object.
+ Vector<PaintChunk> releasePaintChunks();
+
+private:
+ Vector<PaintChunk> m_chunks;
+ PaintChunk m_newChunk;
pdr. 2015/10/01 00:32:48 Is there a reason for not putting this as the last
jbroman 2015/10/01 18:04:20 Changed to trchen's suggestion. (I did this becaus
+};
+
+} // namespace blink
+
+#endif // PaintChunker_h

Powered by Google App Engine
This is Rietveld 408576698