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

Unified Diff: third_party/WebKit/Source/platform/graphics/paint/PaintChunk.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/PaintChunk.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
new file mode 100644
index 0000000000000000000000000000000000000000..b893c2872473187fa7b01d69e31757a8a4922532
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
@@ -0,0 +1,53 @@
+// 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 PaintChunk_h
+#define PaintChunk_h
+
+#include "platform/graphics/paint/PaintProperties.h"
+#include <iosfwd>
+
+namespace blink {
+
+// A contiguous sequence of drawings with common paint properties.
+//
+// This is expected to be owned by the paint artifact which also owns the
+// related drawings.
+//
+// This is a Slimming Paint v2 class.
+struct PaintChunk {
+ PaintChunk() : beginIndex(0), endIndex(0) { }
+ PaintChunk(unsigned begin, unsigned end, const PaintProperties& props)
+ : beginIndex(begin), endIndex(end), properties(props) { }
+
+ // Index of the first drawing in this chunk.
+ unsigned beginIndex;
+
+ // Index of the first drawing not in this chunk, so that there are
+ // |endIndex - beginIndex| drawings in the chunk.
+ unsigned endIndex;
+
+ // The paint properties which apply to this chunk.
+ PaintProperties properties;
+};
+
+inline bool operator==(const PaintChunk& a, const PaintChunk& b)
+{
+ return a.beginIndex == b.beginIndex
+ && a.endIndex == b.endIndex
+ && a.properties == b.properties;
+}
+
+inline bool operator!=(const PaintChunk& a, const PaintChunk& b)
+{
+ return !(a == b);
+}
+
+// Redeclared here to avoid ODR issues.
+// See platform/testing/PaintPrinters.h.
+void PrintTo(const PaintChunk&, std::ostream*);
+
+} // namespace blink
+
+#endif // PaintChunk_h

Powered by Google App Engine
This is Rietveld 408576698