| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CullRect_h | 5 #ifndef CullRect_h |
| 6 #define CullRect_h | 6 #define CullRect_h |
| 7 | 7 |
| 8 #include "platform/geometry/IntRect.h" | 8 #include "platform/geometry/IntRect.h" |
| 9 #include "platform/transforms/AffineTransform.h" | 9 #include "platform/transforms/AffineTransform.h" |
| 10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
| 11 #include "wtf/HashMap.h" | 11 #include "wtf/HashMap.h" |
| 12 #include "wtf/ListHashSet.h" | 12 #include "wtf/ListHashSet.h" |
| 13 #include "wtf/text/WTFString.h" |
| 13 | 14 |
| 14 #include <limits> | 15 #include <limits> |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 | 18 |
| 18 class FloatRect; | 19 class FloatRect; |
| 19 class LayoutRect; | 20 class LayoutRect; |
| 20 class LayoutUnit; | 21 class LayoutUnit; |
| 21 | 22 |
| 22 class PLATFORM_EXPORT CullRect { | 23 class PLATFORM_EXPORT CullRect { |
| 23 DISALLOW_NEW(); | 24 DISALLOW_NEW(); |
| 24 | 25 |
| 25 public: | 26 public: |
| 26 explicit CullRect(const IntRect& rect) : m_rect(rect) {} | 27 explicit CullRect(const IntRect& rect) : m_rect(rect) {} |
| 27 CullRect(const CullRect&, const IntPoint& offset); | 28 CullRect(const CullRect&, const IntPoint& offset); |
| 28 CullRect(const CullRect&, const IntSize& offset); | 29 CullRect(const CullRect&, const IntSize& offset); |
| 29 | 30 |
| 30 bool intersectsCullRect(const AffineTransform&, | 31 bool intersectsCullRect(const AffineTransform&, |
| 31 const FloatRect& boundingBox) const; | 32 const FloatRect& boundingBox) const; |
| 32 void updateCullRect(const AffineTransform& localToParentTransform); | 33 void updateCullRect(const AffineTransform& localToParentTransform); |
| 33 bool intersectsCullRect(const IntRect&) const; | 34 bool intersectsCullRect(const IntRect&) const; |
| 34 bool intersectsCullRect(const LayoutRect&) const; | 35 bool intersectsCullRect(const LayoutRect&) const; |
| 35 bool intersectsHorizontalRange(LayoutUnit lo, LayoutUnit hi) const; | 36 bool intersectsHorizontalRange(LayoutUnit lo, LayoutUnit hi) const; |
| 36 bool intersectsVerticalRange(LayoutUnit lo, LayoutUnit hi) const; | 37 bool intersectsVerticalRange(LayoutUnit lo, LayoutUnit hi) const; |
| 37 | 38 |
| 39 String toString() const { return m_rect.toString(); } |
| 40 |
| 38 private: | 41 private: |
| 39 IntRect m_rect; | 42 IntRect m_rect; |
| 40 | 43 |
| 41 // TODO(chrishtr): temporary while we implement CullRect everywhere. | 44 // TODO(chrishtr): temporary while we implement CullRect everywhere. |
| 42 friend class FramePainter; | 45 friend class FramePainter; |
| 43 friend class GridPainter; | 46 friend class GridPainter; |
| 44 friend class SVGInlineTextBoxPainter; | 47 friend class SVGInlineTextBoxPainter; |
| 45 friend class SVGPaintContext; | 48 friend class SVGPaintContext; |
| 46 friend class SVGRootInlineBoxPainter; | 49 friend class SVGRootInlineBoxPainter; |
| 47 friend class SVGShapePainter; | 50 friend class SVGShapePainter; |
| 48 friend class TableSectionPainter; | 51 friend class TableSectionPainter; |
| 49 friend class ThemePainterMac; | 52 friend class ThemePainterMac; |
| 50 friend class WebPluginContainerImpl; | 53 friend class WebPluginContainerImpl; |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 } // namespace blink | 56 } // namespace blink |
| 54 | 57 |
| 55 #endif // CullRect_h | 58 #endif // CullRect_h |
| OLD | NEW |