| 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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // Returns the background clip rect of the layer in the local coordinate | 184 // Returns the background clip rect of the layer in the local coordinate |
| 185 // space. Only looks for clips up to the given ancestor. | 185 // space. Only looks for clips up to the given ancestor. |
| 186 LayoutRect LocalClipRect(const PaintLayer& ancestor_layer) const; | 186 LayoutRect LocalClipRect(const PaintLayer& ancestor_layer) const; |
| 187 | 187 |
| 188 // Computes the same thing as backgroundRect in calculateRects(), but skips | 188 // Computes the same thing as backgroundRect in calculateRects(), but skips |
| 189 // applying CSS clip and the visualOverflowRect() of |m_layer|. | 189 // applying CSS clip and the visualOverflowRect() of |m_layer|. |
| 190 void CalculateBackgroundClipRect(const ClipRectsContext&, | 190 void CalculateBackgroundClipRect(const ClipRectsContext&, |
| 191 ClipRect& output) const; | 191 ClipRect& output) const; |
| 192 | 192 |
| 193 // This method figures out our layerBounds in coordinates relative to | 193 // This method figures out our layerBounds in coordinates relative to |
| 194 // |rootLayer|. It also computes our background and foreground clip rects | 194 // |root_layer|. It also computes our background and foreground clip rects |
| 195 // for painting/event handling. Pass offsetFromRoot if known. | 195 // for painting/event handling. Pass offsetFromRoot if known. |
| 196 // If provided, |offset_from_root| is not changed and assumed to already |
| 197 // include subpixel accumualation. Otherwise it is set to the offset from |
| 198 // |layer_| to |root_layer|, plus |context.sub_pixel_accumuation|. |
| 196 void CalculateRects(const ClipRectsContext&, | 199 void CalculateRects(const ClipRectsContext&, |
| 197 const LayoutRect& paint_dirty_rect, | 200 const LayoutRect& paint_dirty_rect, |
| 198 LayoutRect& layer_bounds, | 201 LayoutRect& layer_bounds, |
| 199 ClipRect& background_rect, | 202 ClipRect& background_rect, |
| 200 ClipRect& foreground_rect, | 203 ClipRect& foreground_rect, |
| 201 const LayoutPoint* offset_from_root = 0) const; | 204 const LayoutPoint* offset_from_root = 0) const; |
| 202 | 205 |
| 203 ClipRects& PaintingClipRects(const PaintLayer* root_layer, | 206 ClipRects& PaintingClipRects(const PaintLayer* root_layer, |
| 204 ShouldRespectOverflowClipType, | 207 ShouldRespectOverflowClipType, |
| 205 const LayoutSize& subpixel_accumulation) const; | 208 const LayoutSize& subpixel_accumulation) const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 216 | 219 |
| 217 void GetOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const; | 220 void GetOrCalculateClipRects(const ClipRectsContext&, ClipRects&) const; |
| 218 | 221 |
| 219 ALWAYS_INLINE bool ShouldClipOverflow(const ClipRectsContext&) const; | 222 ALWAYS_INLINE bool ShouldClipOverflow(const ClipRectsContext&) const; |
| 220 ALWAYS_INLINE bool ShouldRespectOverflowClip(const ClipRectsContext&) const; | 223 ALWAYS_INLINE bool ShouldRespectOverflowClip(const ClipRectsContext&) const; |
| 221 | 224 |
| 222 // Returned clip rect in |output| is in the space of the context's rootLayer. | 225 // Returned clip rect in |output| is in the space of the context's rootLayer. |
| 223 ALWAYS_INLINE void CalculateBackgroundClipRectWithGeometryMapper( | 226 ALWAYS_INLINE void CalculateBackgroundClipRectWithGeometryMapper( |
| 224 const ClipRectsContext&, | 227 const ClipRectsContext&, |
| 225 ClipRect& output) const; | 228 ClipRect& output) const; |
| 226 ALWAYS_INLINE void CalculateForegroundClipRectWithGeometryMapper( | |
| 227 const ClipRectsContext&, | |
| 228 ClipRect& output) const; | |
| 229 | 229 |
| 230 ALWAYS_INLINE void InitializeCommonClipRectState( | 230 ALWAYS_INLINE void InitializeCommonClipRectState( |
| 231 const ClipRectsContext&, | 231 const ClipRectsContext&, |
| 232 PropertyTreeState& descendant_property_tree_state, | 232 PropertyTreeState& descendant_property_tree_state, |
| 233 PropertyTreeState& ancestor_property_tree_state) const; | 233 PropertyTreeState& ancestor_property_tree_state) const; |
| 234 | 234 |
| 235 // Same as calculateRects, but using GeometryMapper. | 235 // Same as calculateRects, but using GeometryMapper. |
| 236 ALWAYS_INLINE void CalculateRectsWithGeometryMapper( | 236 ALWAYS_INLINE void CalculateRectsWithGeometryMapper( |
| 237 const ClipRectsContext&, | 237 const ClipRectsContext&, |
| 238 const LayoutRect& paint_dirty_rect, | 238 const LayoutRect& paint_dirty_rect, |
| 239 LayoutRect& layer_bounds, | 239 LayoutRect& layer_bounds, |
| 240 ClipRect& background_rect, | 240 ClipRect& background_rect, |
| 241 ClipRect& foreground_rect, | 241 ClipRect& foreground_rect, |
| 242 const LayoutPoint* offset_from_root = 0) const; | 242 const LayoutPoint* offset_from_root = 0) const; |
| 243 | 243 |
| 244 // Returns the visual rect of m_layer in local space. This includes | 244 // Returns the visual rect of m_layer in local space. This includes |
| 245 // filter effects. | 245 // filter effects. |
| 246 ALWAYS_INLINE LayoutRect LocalVisualRect() const; | 246 ALWAYS_INLINE LayoutRect LocalVisualRect() const; |
| 247 | 247 |
| 248 const PaintLayer& layer_; | 248 const PaintLayer& layer_; |
| 249 bool use_geometry_mapper_; | 249 bool use_geometry_mapper_; |
| 250 | 250 |
| 251 friend class PaintLayerClipperTest; | 251 friend class PaintLayerClipperTest; |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace blink | 254 } // namespace blink |
| 255 | 255 |
| 256 #endif // LayerClipper_h | 256 #endif // LayerClipper_h |
| OLD | NEW |