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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 // | 156 // |
157 // The class is central to painting and hit-testing. That's because it handles | 157 // The class is central to painting and hit-testing. That's because it handles |
158 // a lot of tasks (we included ones done by associated satellite objects for | 158 // a lot of tasks (we included ones done by associated satellite objects for |
159 // historical reasons): | 159 // historical reasons): |
160 // - Complex painting operations (opacity, clipping, filters, reflections, ...). | 160 // - Complex painting operations (opacity, clipping, filters, reflections, ...). |
161 // - hardware acceleration (through PaintLayerCompositor). | 161 // - hardware acceleration (through PaintLayerCompositor). |
162 // - scrolling (through PaintLayerScrollableArea). | 162 // - scrolling (through PaintLayerScrollableArea). |
163 // - some performance optimizations. | 163 // - some performance optimizations. |
164 // | 164 // |
165 // The compositing code is also based on PaintLayer. The entry to it is the | 165 // The compositing code is also based on PaintLayer. The entry to it is the |
166 // PaintLayerCompositor, which fills |m_compositedLayerMapping| for hardware | 166 // PaintLayerCompositor, which fills |composited_layer_mapping| for hardware |
167 // accelerated layers. | 167 // accelerated layers. |
168 // | 168 // |
169 // TODO(jchaffraix): Expand the documentation about hardware acceleration. | 169 // TODO(jchaffraix): Expand the documentation about hardware acceleration. |
170 // | 170 // |
171 // | 171 // |
172 // ***** SELF-PAINTING LAYER ***** | 172 // ***** SELF-PAINTING LAYER ***** |
173 // One important concept about PaintLayer is "self-painting" | 173 // One important concept about PaintLayer is "self-painting" |
174 // (m_isSelfPaintingLayer). | 174 // (is_self_painting_layer_). |
175 // PaintLayer started as the implementation of a stacking context. This meant | 175 // PaintLayer started as the implementation of a stacking context. This meant |
176 // that we had to use PaintLayer's painting order (the code is now in | 176 // that we had to use PaintLayer's painting order (the code is now in |
177 // PaintLayerPainter and PaintLayerStackingNode) instead of the LayoutObject's | 177 // PaintLayerPainter and PaintLayerStackingNode) instead of the LayoutObject's |
178 // children order. Over the years, as more operations were handled by | 178 // children order. Over the years, as more operations were handled by |
179 // PaintLayer, some LayoutObjects that were not stacking context needed to have | 179 // PaintLayer, some LayoutObjects that were not stacking context needed to have |
180 // a PaintLayer for bookkeeping reasons. One such example is the overflow hidden | 180 // a PaintLayer for bookkeeping reasons. One such example is the overflow hidden |
181 // case that wanted hardware acceleration and thus had to allocate a PaintLayer | 181 // case that wanted hardware acceleration and thus had to allocate a PaintLayer |
182 // to get it. However overflow hidden is something LayoutObject can paint | 182 // to get it. However overflow hidden is something LayoutObject can paint |
183 // without a PaintLayer, which includes a lot of painting overhead. Thus the | 183 // without a PaintLayer, which includes a lot of painting overhead. Thus the |
184 // self-painting flag was introduced. The flag is a band-aid solution done for | 184 // self-painting flag was introduced. The flag is a band-aid solution done for |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 curr = curr->Parent(); | 264 curr = curr->Parent(); |
265 return curr; | 265 return curr; |
266 } | 266 } |
267 | 267 |
268 const LayoutPoint& Location() const { | 268 const LayoutPoint& Location() const { |
269 #if DCHECK_IS_ON() | 269 #if DCHECK_IS_ON() |
270 DCHECK(!needs_position_update_); | 270 DCHECK(!needs_position_update_); |
271 #endif | 271 #endif |
272 return location_; | 272 return location_; |
273 } | 273 } |
274 // FIXME: size() should DCHECK(!m_needsPositionUpdate) as well, but that fails | 274 // FIXME: size() should DCHECK(!needs_position_update_) as well, but that |
275 // in some tests, for example, fast/repaint/clipped-relative.html. | 275 // fails in some tests, for example, fast/repaint/clipped-relative.html. |
276 const IntSize& size() const { return size_; } | 276 const IntSize& size() const { return size_; } |
277 void SetSizeHackForLayoutTreeAsText(const IntSize& size) { size_ = size; } | 277 void SetSizeHackForLayoutTreeAsText(const IntSize& size) { size_ = size; } |
278 | 278 |
279 LayoutRect Rect() const { return LayoutRect(Location(), LayoutSize(size())); } | 279 LayoutRect Rect() const { return LayoutRect(Location(), LayoutSize(size())); } |
280 | 280 |
281 bool IsRootLayer() const { return is_root_layer_; } | 281 bool IsRootLayer() const { return is_root_layer_; } |
282 | 282 |
283 PaintLayerCompositor* Compositor() const; | 283 PaintLayerCompositor* Compositor() const; |
284 | 284 |
285 // Notification from the layoutObject that its content changed (e.g. current | 285 // Notification from the layoutObject that its content changed (e.g. current |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 | 1189 |
1190 unsigned contains_dirty_overlay_scrollbars_ : 1; | 1190 unsigned contains_dirty_overlay_scrollbars_ : 1; |
1191 | 1191 |
1192 unsigned needs_ancestor_dependent_compositing_inputs_update_ : 1; | 1192 unsigned needs_ancestor_dependent_compositing_inputs_update_ : 1; |
1193 unsigned child_needs_compositing_inputs_update_ : 1; | 1193 unsigned child_needs_compositing_inputs_update_ : 1; |
1194 | 1194 |
1195 // Used only while determining what layers should be composited. Applies to | 1195 // Used only while determining what layers should be composited. Applies to |
1196 // the tree of z-order lists. | 1196 // the tree of z-order lists. |
1197 unsigned has_compositing_descendant_ : 1; | 1197 unsigned has_compositing_descendant_ : 1; |
1198 | 1198 |
1199 // True iff we have scrollable overflow and all children of m_layoutObject are | 1199 // True iff we have scrollable overflow and all children of layout_object_ are |
1200 // known to paint exclusively into their own composited layers. Set by | 1200 // known to paint exclusively into their own composited layers. Set by |
1201 // updateScrollingStateAfterCompositingChange(). | 1201 // updateScrollingStateAfterCompositingChange(). |
1202 unsigned is_all_scrolling_content_composited_ : 1; | 1202 unsigned is_all_scrolling_content_composited_ : 1; |
1203 | 1203 |
1204 // Should be for stacking contexts having unisolated blending descendants. | 1204 // Should be for stacking contexts having unisolated blending descendants. |
1205 unsigned should_isolate_composited_descendants_ : 1; | 1205 unsigned should_isolate_composited_descendants_ : 1; |
1206 | 1206 |
1207 // True if this layout layer just lost its grouped mapping due to the | 1207 // True if this layout layer just lost its grouped mapping due to the |
1208 // CompositedLayerMapping being destroyed, and we don't yet know to what | 1208 // CompositedLayerMapping being destroyed, and we don't yet know to what |
1209 // graphics layer this Layer will be assigned. | 1209 // graphics layer this Layer will be assigned. |
1210 unsigned lost_grouped_mapping_ : 1; | 1210 unsigned lost_grouped_mapping_ : 1; |
1211 | 1211 |
1212 unsigned needs_repaint_ : 1; | 1212 unsigned needs_repaint_ : 1; |
1213 unsigned previous_paint_result_ : 1; // PaintResult | 1213 unsigned previous_paint_result_ : 1; // PaintResult |
1214 static_assert(kMaxPaintResult <= 2, | 1214 static_assert(kMaxPaintResult <= 2, |
1215 "Should update number of bits of m_previousPaintResult"); | 1215 "Should update number of bits of previous_paint_result_"); |
1216 | 1216 |
1217 unsigned needs_paint_phase_descendant_outlines_ : 1; | 1217 unsigned needs_paint_phase_descendant_outlines_ : 1; |
1218 unsigned previous_paint_phase_descendant_outlines_was_empty_ : 1; | 1218 unsigned previous_paint_phase_descendant_outlines_was_empty_ : 1; |
1219 unsigned needs_paint_phase_float_ : 1; | 1219 unsigned needs_paint_phase_float_ : 1; |
1220 unsigned previous_paint_phase_float_was_empty_ : 1; | 1220 unsigned previous_paint_phase_float_was_empty_ : 1; |
1221 unsigned needs_paint_phase_descendant_block_backgrounds_ : 1; | 1221 unsigned needs_paint_phase_descendant_block_backgrounds_ : 1; |
1222 unsigned previous_paint_phase_descendant_block_backgrounds_was_empty_ : 1; | 1222 unsigned previous_paint_phase_descendant_block_backgrounds_was_empty_ : 1; |
1223 | 1223 |
1224 // These bitfields are part of ancestor/descendant dependent compositing | 1224 // These bitfields are part of ancestor/descendant dependent compositing |
1225 // inputs. | 1225 // inputs. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 | 1277 |
1278 } // namespace blink | 1278 } // namespace blink |
1279 | 1279 |
1280 #ifndef NDEBUG | 1280 #ifndef NDEBUG |
1281 // Outside the WebCore namespace for ease of invocation from gdb. | 1281 // Outside the WebCore namespace for ease of invocation from gdb. |
1282 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); | 1282 CORE_EXPORT void showLayerTree(const blink::PaintLayer*); |
1283 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); | 1283 CORE_EXPORT void showLayerTree(const blink::LayoutObject*); |
1284 #endif | 1284 #endif |
1285 | 1285 |
1286 #endif // Layer_h | 1286 #endif // Layer_h |
OLD | NEW |