| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2009, 2012 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. | 3 * Copyright (C) 2013 Intel Corporation. All rights reserved. |
| 4 * | 4 * |
| 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 5 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 6 * | 6 * |
| 7 * Other contributors: | 7 * Other contributors: |
| 8 * Robert O'Callahan <roc+@cs.cmu.edu> | 8 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 9 * David Baron <dbaron@fas.harvard.edu> | 9 * David Baron <dbaron@fas.harvard.edu> |
| 10 * Christian Biesinger <cbiesinger@web.de> | 10 * Christian Biesinger <cbiesinger@web.de> |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 class RenderLayerClipper { | 78 class RenderLayerClipper { |
| 79 WTF_MAKE_NONCOPYABLE(RenderLayerClipper); | 79 WTF_MAKE_NONCOPYABLE(RenderLayerClipper); |
| 80 public: | 80 public: |
| 81 explicit RenderLayerClipper(RenderBox&); | 81 explicit RenderLayerClipper(RenderBox&); |
| 82 | 82 |
| 83 void clearClipRectsIncludingDescendants(); | 83 void clearClipRectsIncludingDescendants(); |
| 84 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); | 84 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); |
| 85 | 85 |
| 86 LayoutRect childrenClipRect() const; // Returns the foreground clip rect of
the layer in the document's coordinate space. | |
| 87 LayoutRect localClipRect() const; // Returns the background clip rect of the
layer in the local coordinate space. | 86 LayoutRect localClipRect() const; // Returns the background clip rect of the
layer in the local coordinate space. |
| 88 | 87 |
| 89 ClipRects* getClipRects(const ClipRectsContext&) const; | 88 ClipRects* getClipRects(const ClipRectsContext&) const; |
| 90 | 89 |
| 91 ClipRect backgroundClipRect(const ClipRectsContext&) const; | 90 ClipRect backgroundClipRect(const ClipRectsContext&) const; |
| 92 | 91 |
| 93 // This method figures out our layerBounds in coordinates relative to | 92 // This method figures out our layerBounds in coordinates relative to |
| 94 // |rootLayer|. It also computes our background and foreground clip rects | 93 // |rootLayer|. It also computes our clip rects for painting/event handling. |
| 95 // for painting/event handling. | |
| 96 // Pass offsetFromRoot if known. | |
| 97 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRec
t, LayoutRect& layerBounds, | 94 void calculateRects(const ClipRectsContext&, const LayoutRect& paintDirtyRec
t, LayoutRect& layerBounds, |
| 98 ClipRect& backgroundRect, ClipRect& foregroundRect, const LayoutPoint* o
ffsetFromRoot = 0) const; | 95 ClipRect& backgroundRect, const LayoutPoint* offsetFromRoot = 0) const; |
| 99 | 96 |
| 100 private: | 97 private: |
| 101 void calculateClipRects(const ClipRectsContext&, ClipRects&) const; | 98 void calculateClipRects(const ClipRectsContext&, ClipRects&) const; |
| 102 | 99 |
| 103 ClipRects* clipRectsIfCached(const ClipRectsContext&) const; | 100 ClipRects* clipRectsIfCached(const ClipRectsContext&) const; |
| 104 ClipRects* storeClipRectsInCache(const ClipRectsContext&, ClipRects* parentC
lipRects, const ClipRects&) const; | 101 ClipRects* storeClipRectsInCache(const ClipRectsContext&, ClipRects* parentC
lipRects, const ClipRects&) const; |
| 105 | 102 |
| 106 // cachedClipRects looks buggy: It doesn't check whether context.rootLayer a
nd entry.root match. | 103 // cachedClipRects looks buggy: It doesn't check whether context.rootLayer a
nd entry.root match. |
| 107 // FIXME: Move callers to clipRectsIfCached, which does the proper checks. | 104 // FIXME: Move callers to clipRectsIfCached, which does the proper checks. |
| 108 ClipRects* cachedClipRects(const ClipRectsContext& context) const | 105 ClipRects* cachedClipRects(const ClipRectsContext& context) const |
| (...skipping 13 matching lines...) Expand all Loading... |
| 122 } | 119 } |
| 123 | 120 |
| 124 // FIXME: Could this be a RenderBox? | 121 // FIXME: Could this be a RenderBox? |
| 125 RenderBox& m_renderer; | 122 RenderBox& m_renderer; |
| 126 mutable OwnPtr<ClipRectsCache> m_cache; | 123 mutable OwnPtr<ClipRectsCache> m_cache; |
| 127 }; | 124 }; |
| 128 | 125 |
| 129 } // namespace blink | 126 } // namespace blink |
| 130 | 127 |
| 131 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ | 128 #endif // SKY_ENGINE_CORE_RENDERING_RENDERLAYERCLIPPER_H_ |
| OLD | NEW |