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

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: enable RuntimeEnabledFeature for PaintChunkerTest 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 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..33f5a7af3ef67a63ce6aebbd094950b6689fcace
--- /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_currentProperties == PaintProperties(); }
+
+ void updateCurrentPaintProperties(const PaintProperties&);
+
+ void incrementDisplayItemIndex();
+ void decrementDisplayItemIndex();
+
+ // Releases the generated paint chunk list and resets the state of this
+ // object.
+ Vector<PaintChunk> releasePaintChunks();
+
+private:
+ Vector<PaintChunk> m_chunks;
+ PaintProperties m_currentProperties;
+};
+
+} // namespace blink
+
+#endif // PaintChunker_h

Powered by Google App Engine
This is Rietveld 408576698