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

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

Issue 2307623002: [SPv2] Defer decision of raster invalidation after paint for changes z-index, transform, etc. (Closed)
Patch Set: Remove duplicated spv2 expectation entries Created 4 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/PaintChunk.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
index 1bbda6742d97664b95a629c4ceccf289048d1ef6..701f218b0221f7ade9a2b928a71e4879f64903da 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintChunk.h
@@ -10,6 +10,7 @@
#include "platform/graphics/paint/PaintChunkProperties.h"
#include "wtf/Allocator.h"
#include "wtf/Optional.h"
+#include "wtf/Vector.h"
#include <iosfwd>
namespace blink {
@@ -101,6 +102,23 @@ inline bool operator!=(const PaintChunk& a, const PaintChunk& b)
return !(a == b);
}
+inline bool chunkLessThanIndex(const PaintChunk& chunk, size_t index)
+{
+ return chunk.endIndex <= index;
+}
+
+inline Vector<PaintChunk>::iterator findChunkInVectorByDisplayItemIndex(Vector<PaintChunk>& chunks, size_t index)
+{
+ auto chunk = std::lower_bound(chunks.begin(), chunks.end(), index, chunkLessThanIndex);
+ DCHECK(chunk == chunks.end() || (index >= chunk->beginIndex && index < chunk->endIndex));
+ return chunk;
+}
+
+inline Vector<PaintChunk>::const_iterator findChunkInVectorByDisplayItemIndex(const Vector<PaintChunk>& chunks, size_t index)
+{
+ return findChunkInVectorByDisplayItemIndex(const_cast<Vector<PaintChunk>&>(chunks), index);
+}
+
// Redeclared here to avoid ODR issues.
// See platform/testing/PaintPrinters.h.
void PrintTo(const PaintChunk&, std::ostream*);

Powered by Google App Engine
This is Rietveld 408576698