| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 void clearClipRectsIncludingDescendants(); | 177 void clearClipRectsIncludingDescendants(); |
| 178 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); | 178 void clearClipRectsIncludingDescendants(ClipRectsCacheSlot); |
| 179 | 179 |
| 180 // Returns the background clip rect of the layer in the local coordinate | 180 // Returns the background clip rect of the layer in the local coordinate |
| 181 // space. Only looks for clips up to the given ancestor. | 181 // space. Only looks for clips up to the given ancestor. |
| 182 LayoutRect localClipRect(const PaintLayer& ancestorLayer) const; | 182 LayoutRect localClipRect(const PaintLayer& ancestorLayer) const; |
| 183 | 183 |
| 184 // Computes the same thing as backgroundRect in calculateRects(), but skips | 184 // Computes the same thing as backgroundRect in calculateRects(), but skips |
| 185 // applying CSS clip and the visualOverflowRect() of |m_layer|. | 185 // applying CSS clip and the visualOverflowRect() of |m_layer|. |
| 186 void calculateBackgroundClipRect(const ClipRectsContext&, | 186 ClipRect backgroundClipRect(const ClipRectsContext&) const; |
| 187 ClipRect& output) const; | |
| 188 | 187 |
| 189 // This method figures out our layerBounds in coordinates relative to | 188 // This method figures out our layerBounds in coordinates relative to |
| 190 // |rootLayer|. It also computes our background and foreground clip rects | 189 // |rootLayer|. It also computes our background and foreground clip rects |
| 191 // for painting/event handling. Pass offsetFromRoot if known. | 190 // for painting/event handling. Pass offsetFromRoot if known. |
| 192 void calculateRects(const ClipRectsContext&, | 191 void calculateRects(const ClipRectsContext&, |
| 193 const LayoutRect& paintDirtyRect, | 192 const LayoutRect& paintDirtyRect, |
| 194 LayoutRect& layerBounds, | 193 LayoutRect& layerBounds, |
| 195 ClipRect& backgroundRect, | 194 ClipRect& backgroundRect, |
| 196 ClipRect& foregroundRect, | 195 ClipRect& foregroundRect, |
| 197 const LayoutPoint* offsetFromRoot = 0) const; | 196 const LayoutPoint* offsetFromRoot = 0) const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 208 ClipRects* clipRectsIfCached(const ClipRectsContext&) const; | 207 ClipRects* clipRectsIfCached(const ClipRectsContext&) const; |
| 209 ClipRects& storeClipRectsInCache(const ClipRectsContext&, | 208 ClipRects& storeClipRectsInCache(const ClipRectsContext&, |
| 210 ClipRects* parentClipRects, | 209 ClipRects* parentClipRects, |
| 211 const ClipRects&) const; | 210 const ClipRects&) const; |
| 212 | 211 |
| 213 void getOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const; | 212 void getOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const; |
| 214 | 213 |
| 215 bool shouldClipOverflow(const ClipRectsContext&) const; | 214 bool shouldClipOverflow(const ClipRectsContext&) const; |
| 216 bool shouldRespectOverflowClip(const ClipRectsContext&) const; | 215 bool shouldRespectOverflowClip(const ClipRectsContext&) const; |
| 217 | 216 |
| 218 // Returned clip rect in |output| is in the space of the context's rootLayer. | 217 // Returned clip rect is in the space of the context's rootLayer. |
| 219 void calculateClipRectWithGeometryMapper(const ClipRectsContext&, | 218 ClipRect clipRectWithGeometryMapper(const ClipRectsContext&, |
| 220 bool isForeground, | 219 bool isForeground) const; |
| 221 ClipRect& output) const; | |
| 222 // Mutates the given rect into a rect in the space of the context's | 220 // Mutates the given rect into a rect in the space of the context's |
| 223 // rootLayer. | 221 // rootLayer. |
| 224 void mapLocalToRootWithGeometryMapper(const ClipRectsContext&, | 222 void mapLocalToRootWithGeometryMapper(const ClipRectsContext&, |
| 225 LayoutRect&) const; | 223 LayoutRect&) const; |
| 226 // Same as calculateRects, but using GeometryMapper. | 224 // Same as calculateRects, but using GeometryMapper. |
| 227 void calculateRectsWithGeometryMapper( | 225 void calculateRectsWithGeometryMapper( |
| 228 const ClipRectsContext&, | 226 const ClipRectsContext&, |
| 229 const LayoutRect& paintDirtyRect, | 227 const LayoutRect& paintDirtyRect, |
| 230 LayoutRect& layerBounds, | 228 LayoutRect& layerBounds, |
| 231 ClipRect& backgroundRect, | 229 ClipRect& backgroundRect, |
| 232 ClipRect& foregroundRect, | 230 ClipRect& foregroundRect, |
| 233 const LayoutPoint* offsetFromRoot = 0) const; | 231 const LayoutPoint* offsetFromRoot = 0) const; |
| 234 | 232 |
| 235 void applyOverflowClipToBackgroundRectWithGeometryMapper( | 233 void applyOverflowClipToBackgroundRectWithGeometryMapper( |
| 236 const ClipRectsContext&, | 234 const ClipRectsContext&, |
| 237 ClipRect&) const; | 235 ClipRect&) const; |
| 238 | 236 |
| 239 const PaintLayer& m_layer; | 237 const PaintLayer& m_layer; |
| 240 GeometryMapper* m_geometryMapper; | 238 GeometryMapper* m_geometryMapper; |
| 241 | 239 |
| 242 friend class PaintLayerClipperTest; | 240 friend class PaintLayerClipperTest; |
| 243 }; | 241 }; |
| 244 | 242 |
| 245 } // namespace blink | 243 } // namespace blink |
| 246 | 244 |
| 247 #endif // LayerClipper_h | 245 #endif // LayerClipper_h |
| OLD | NEW |