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

Unified Diff: Source/core/rendering/PaintInvalidationState.h

Issue 360833002: Divorce PaintInvalidationState from LayoutState (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ToT again... Created 6 years, 5 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: Source/core/rendering/PaintInvalidationState.h
diff --git a/Source/core/rendering/PaintInvalidationState.h b/Source/core/rendering/PaintInvalidationState.h
new file mode 100644
index 0000000000000000000000000000000000000000..8dd5a1e61642b95e57a1ef80fcd2686d73eb8d10
--- /dev/null
+++ b/Source/core/rendering/PaintInvalidationState.h
@@ -0,0 +1,61 @@
+// Copyright 2014 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 PaintInvalidationState_h
+#define PaintInvalidationState_h
+
+#include "platform/geometry/LayoutRect.h"
+#include "wtf/Noncopyable.h"
+
+namespace WebCore {
+
+class RenderBox;
+class RenderInline;
+class RenderLayerModelObject;
+class RenderObject;
+class RenderSVGModelObject;
+
+class PaintInvalidationState {
+ WTF_MAKE_NONCOPYABLE(PaintInvalidationState);
+public:
+ PaintInvalidationState(const PaintInvalidationState& next, RenderInline& renderer, const RenderLayerModelObject& paintInvalidationContainer);
+ PaintInvalidationState(const PaintInvalidationState& next, RenderBox& renderer, const RenderLayerModelObject& paintInvalidationContainer);
+ PaintInvalidationState(const PaintInvalidationState& next, RenderSVGModelObject& renderer, const RenderLayerModelObject& paintInvalidationContainer);
+
+ explicit PaintInvalidationState(RenderObject&);
+
+ const LayoutRect& clipRect() const { return m_clipRect; }
+ const LayoutSize& paintOffset() const { return m_paintOffset; }
+
+ bool cachedOffsetsEnabled() const { return m_cachedOffsetsEnabled; }
+ bool isClipped() const { return m_clipped; }
+
+ const RenderLayerModelObject& paintInvalidationContainer() const { return m_paintInvalidationContainer; }
+ RenderObject& renderer() const { return m_renderer; }
+
+ bool canMapToContainer(const RenderLayerModelObject* container) const
+ {
+ return m_cachedOffsetsEnabled && container == &m_paintInvalidationContainer;
+ }
+private:
+ void applyClipIfNeeded(const RenderObject&);
+
+ friend class ForceHorriblySlowRectMapping;
+
+ bool m_clipped;
+ mutable bool m_cachedOffsetsEnabled;
Julien - ping for review 2014/07/07 22:09:59 Does this field have to be mutable?
+
+ LayoutRect m_clipRect;
+
+ // x/y offset from paint invalidation container. Includes relative positioning and scroll offsets.
+ LayoutSize m_paintOffset;
+
+ const RenderLayerModelObject& m_paintInvalidationContainer;
+
+ RenderObject& m_renderer;
+};
+
+} // namespace WebCore
+
+#endif // PaintInvalidationState_h

Powered by Google App Engine
This is Rietveld 408576698