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

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

Issue 1422493003: Change Widget subclasses to use a CullRect instead of an IntRect for painting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/CullRect.h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/CullRect.h b/third_party/WebKit/Source/platform/graphics/paint/CullRect.h
new file mode 100644
index 0000000000000000000000000000000000000000..3173b664c1bfc3cbf66dcd12735ab9dffa672fde
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/CullRect.h
@@ -0,0 +1,60 @@
+// 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 CullRect_h
wkorman 2015/10/28 22:43:29 +1 blank above
chrishtr 2015/10/28 23:10:25 Done.
+#define CullRect_h
+
+// TODO(jchaffraix): Once we unify PaintBehavior and PaintLayerFlags, we should move
wkorman 2015/10/28 22:43:29 is this still relevant here?
chrishtr 2015/10/28 23:10:25 Removed.
+// PaintLayerFlags to PaintPhase and rename it. Thus removing the need for this #include.
+
+#include "platform/geometry/IntRect.h"
+#include "platform/transforms/AffineTransform.h"
+#include "wtf/Allocator.h"
+#include "wtf/HashMap.h"
+#include "wtf/ListHashSet.h"
+
+#include <limits>
+
+namespace blink {
+
+class FloatRect;
+class LayoutBoxModelObject;
+class LayoutInline;
+class LayoutObject;
+class LayoutRect;
+class LayoutUnit;
+class PaintInvalidationState;
+
+class PLATFORM_EXPORT CullRect {
+public:
+ explicit CullRect(const IntRect& rect) : m_rect(rect) { }
+ CullRect(const CullRect&, const IntPoint& offset);
+ CullRect(const CullRect&, const IntSize& offset);
+
+ bool intersectsCullRect(const AffineTransform&, const FloatRect& boundingBox) const;
+ void updateCullRect(const AffineTransform& localToParentTransform);
+ bool intersectsCullRect(const IntRect&) const;
+ bool intersectsCullRect(const LayoutRect&) const;
+ bool intersectsHorizontalRange(LayoutUnit lo, LayoutUnit hi) const;
+ bool intersectsVerticalRange(LayoutUnit lo, LayoutUnit hi) const;
+
+private:
+ IntRect m_rect;
+
+ // TODO(chrishtr): temporary while we implement CullRect everywhere.
+ friend class FramePainter;
+ friend class GridPainter;
+ friend class SVGInlineTextBoxPainter;
+ friend class ScrollbarThemeMacNonOverlayAPI;
+ friend class ReplicaPainter;
+ friend class SVGPaintContext;
+ friend class SVGRootInlineBoxPainter;
+ friend class SVGShapePainter;
+ friend class TableSectionPainter;
+ friend class ThemePainterMac;
+ friend class WebPluginContainerImpl;
+};
+
+} // namespace blink
+
+#endif // CullRect_h
« no previous file with comments | « third_party/WebKit/Source/platform/blink_platform.gypi ('k') | third_party/WebKit/Source/platform/graphics/paint/CullRect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698