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