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

Unified Diff: third_party/WebKit/Source/core/paint/BoxPaintInvalidator.h

Issue 2208463003: First step of PaintInvalidator implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: - Created 4 years, 4 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/core/paint/BoxPaintInvalidator.h
diff --git a/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.h b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.h
new file mode 100644
index 0000000000000000000000000000000000000000..8ab4a212c35b0a2f427538b59fd54a1c8883d992
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/BoxPaintInvalidator.h
@@ -0,0 +1,44 @@
+// Copyright 2016 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 BoxPaintInvalidator_h
+#define BoxPaintInvalidator_h
+
+#include "platform/graphics/PaintInvalidationReason.h"
+#include "wtf/Allocator.h"
+
+namespace blink {
+
+class LayoutBox;
+class LayoutRect;
+class LayoutSize;
+struct PaintInvalidatorContext;
+
+class BoxPaintInvalidator {
+ STACK_ALLOCATED();
+public:
+ BoxPaintInvalidator(const LayoutBox& box, const PaintInvalidatorContext& context)
+ : m_box(box), m_context(context) { }
+
+ static void boxWillBeDestroyed(const LayoutBox&);
+
+ PaintInvalidationReason invalidatePaintIfNeeded();
+
+private:
+ PaintInvalidationReason computePaintInvalidationReason();
+
+ void incrementallyInvalidatePaint();
+ void invalidatePaintRectClippedByOldAndNewBounds(const LayoutRect&);
+
+ bool needsToSavePreviousBoxSizes();
+ void savePreviousBoxSizesIfNeeded();
+ LayoutSize computePreviousBorderBoxSize(const LayoutSize& previousBoundsSize);
+
+ const LayoutBox& m_box;
+ const PaintInvalidatorContext& m_context;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698