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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 namespace blink { | 61 namespace blink { |
62 | 62 |
63 class FilterEffectRenderer; | 63 class FilterEffectRenderer; |
64 class FilterOperations; | 64 class FilterOperations; |
65 class HitTestRequest; | 65 class HitTestRequest; |
66 class HitTestResult; | 66 class HitTestResult; |
67 class HitTestingTransformState; | 67 class HitTestingTransformState; |
68 class DeprecatedPaintLayerCompositor; | 68 class DeprecatedPaintLayerCompositor; |
69 class CompositedDeprecatedPaintLayerMapping; | 69 class CompositedDeprecatedPaintLayerMapping; |
70 class LayoutStyle; | 70 class ComputedStyle; |
71 class TransformationMatrix; | 71 class TransformationMatrix; |
72 | 72 |
73 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; | 73 enum IncludeSelfOrNot { IncludeSelf, ExcludeSelf }; |
74 | 74 |
75 enum CompositingQueryMode { | 75 enum CompositingQueryMode { |
76 CompositingQueriesAreAllowed, | 76 CompositingQueriesAreAllowed, |
77 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases | 77 CompositingQueriesAreOnlyAllowedInCertainDocumentLifecyclePhases |
78 }; | 78 }; |
79 | 79 |
80 // FIXME: remove this once the compositing query ASSERTS are no longer hit. | 80 // FIXME: remove this once the compositing query ASSERTS are no longer hit. |
(...skipping 29 matching lines...) Expand all Loading... |
110 DeprecatedPaintLayer* lastChild() const { return m_last; } | 110 DeprecatedPaintLayer* lastChild() const { return m_last; } |
111 | 111 |
112 const DeprecatedPaintLayer* compositingContainer() const; | 112 const DeprecatedPaintLayer* compositingContainer() const; |
113 | 113 |
114 void addChild(DeprecatedPaintLayer* newChild, DeprecatedPaintLayer* beforeCh
ild = 0); | 114 void addChild(DeprecatedPaintLayer* newChild, DeprecatedPaintLayer* beforeCh
ild = 0); |
115 DeprecatedPaintLayer* removeChild(DeprecatedPaintLayer*); | 115 DeprecatedPaintLayer* removeChild(DeprecatedPaintLayer*); |
116 | 116 |
117 void removeOnlyThisLayer(); | 117 void removeOnlyThisLayer(); |
118 void insertOnlyThisLayer(); | 118 void insertOnlyThisLayer(); |
119 | 119 |
120 void styleChanged(StyleDifference, const LayoutStyle* oldStyle); | 120 void styleChanged(StyleDifference, const ComputedStyle* oldStyle); |
121 | 121 |
122 // FIXME: Many people call this function while it has out-of-date informatio
n. | 122 // FIXME: Many people call this function while it has out-of-date informatio
n. |
123 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } | 123 bool isSelfPaintingLayer() const { return m_isSelfPaintingLayer; } |
124 | 124 |
125 void setLayerType(DeprecatedPaintLayerType layerType) { m_layerType = layerT
ype; } | 125 void setLayerType(DeprecatedPaintLayerType layerType) { m_layerType = layerT
ype; } |
126 | 126 |
127 bool isTransparent() const { return layoutObject()->isTransparent() || layou
tObject()->style()->hasBlendMode() || layoutObject()->hasMask(); } | 127 bool isTransparent() const { return layoutObject()->isTransparent() || layou
tObject()->style()->hasBlendMode() || layoutObject()->hasMask(); } |
128 | 128 |
129 bool isReflection() const { return layoutObject()->isReplica(); } | 129 bool isReflection() const { return layoutObject()->isReplica(); } |
130 DeprecatedPaintLayerReflectionInfo* reflectionInfo() { return m_reflectionIn
fo.get(); } | 130 DeprecatedPaintLayerReflectionInfo* reflectionInfo() { return m_reflectionIn
fo.get(); } |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 265 |
266 bool hasTransformRelatedProperty() const { return layoutObject()->hasTransfo
rmRelatedProperty(); } | 266 bool hasTransformRelatedProperty() const { return layoutObject()->hasTransfo
rmRelatedProperty(); } |
267 // Note that this transform has the transform-origin baked in. | 267 // Note that this transform has the transform-origin baked in. |
268 TransformationMatrix* transform() const { return m_transform.get(); } | 268 TransformationMatrix* transform() const { return m_transform.get(); } |
269 void setTransform(PassOwnPtr<TransformationMatrix> transform) { m_transform
= transform; } | 269 void setTransform(PassOwnPtr<TransformationMatrix> transform) { m_transform
= transform; } |
270 void clearTransform() { m_transform.clear(); } | 270 void clearTransform() { m_transform.clear(); } |
271 | 271 |
272 // currentTransform computes a transform which takes accelerated animations
into account. The | 272 // currentTransform computes a transform which takes accelerated animations
into account. The |
273 // resulting transform has transform-origin baked in. If the layer does not
have a transform, | 273 // resulting transform has transform-origin baked in. If the layer does not
have a transform, |
274 // returns the identity matrix. | 274 // returns the identity matrix. |
275 TransformationMatrix currentTransform(LayoutStyle::ApplyTransformOrigin = La
youtStyle::IncludeTransformOrigin) const; | 275 TransformationMatrix currentTransform(ComputedStyle::ApplyTransformOrigin =
ComputedStyle::IncludeTransformOrigin) const; |
276 TransformationMatrix renderableTransform(PaintBehavior) const; | 276 TransformationMatrix renderableTransform(PaintBehavior) const; |
277 | 277 |
278 // Get the perspective transform, which is applied to transformed sublayers. | 278 // Get the perspective transform, which is applied to transformed sublayers. |
279 // Returns true if the layer has a -webkit-perspective. | 279 // Returns true if the layer has a -webkit-perspective. |
280 // Note that this transform has the perspective-origin baked in. | 280 // Note that this transform has the perspective-origin baked in. |
281 TransformationMatrix perspectiveTransform() const; | 281 TransformationMatrix perspectiveTransform() const; |
282 FloatPoint perspectiveOrigin() const; | 282 FloatPoint perspectiveOrigin() const; |
283 bool preserves3D() const { return layoutObject()->style()->transformStyle3D(
) == TransformStyle3DPreserve3D; } | 283 bool preserves3D() const { return layoutObject()->style()->transformStyle3D(
) == TransformStyle3DPreserve3D; } |
284 bool has3DTransform() const { return m_transform && !m_transform->isAffine()
; } | 284 bool has3DTransform() const { return m_transform && !m_transform->isAffine()
; } |
285 | 285 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 bool paintsWithTransform(PaintBehavior) const; | 340 bool paintsWithTransform(PaintBehavior) const; |
341 | 341 |
342 // Returns true if background phase is painted opaque in the given rect. | 342 // Returns true if background phase is painted opaque in the given rect. |
343 // The query rect is given in local coordinates. | 343 // The query rect is given in local coordinates. |
344 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 344 bool backgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
345 | 345 |
346 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS
crollbars; } | 346 bool containsDirtyOverlayScrollbars() const { return m_containsDirtyOverlayS
crollbars; } |
347 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir
tyOverlayScrollbars = dirtyScrollbars; } | 347 void setContainsDirtyOverlayScrollbars(bool dirtyScrollbars) { m_containsDir
tyOverlayScrollbars = dirtyScrollbars; } |
348 | 348 |
349 FilterOperations computeFilterOperations(const LayoutStyle&); | 349 FilterOperations computeFilterOperations(const ComputedStyle&); |
350 bool paintsWithFilters() const; | 350 bool paintsWithFilters() const; |
351 FilterEffectRenderer* filterRenderer() const | 351 FilterEffectRenderer* filterRenderer() const |
352 { | 352 { |
353 DeprecatedPaintLayerFilterInfo* filterInfo = this->filterInfo(); | 353 DeprecatedPaintLayerFilterInfo* filterInfo = this->filterInfo(); |
354 return filterInfo ? filterInfo->layoutObject() : 0; | 354 return filterInfo ? filterInfo->layoutObject() : 0; |
355 } | 355 } |
356 | 356 |
357 DeprecatedPaintLayerFilterInfo* filterInfo() const { return hasFilterInfo()
? DeprecatedPaintLayerFilterInfo::filterInfoForLayer(this) : 0; } | 357 DeprecatedPaintLayerFilterInfo* filterInfo() const { return hasFilterInfo()
? DeprecatedPaintLayerFilterInfo::filterInfoForLayer(this) : 0; } |
358 DeprecatedPaintLayerFilterInfo* ensureFilterInfo() { return DeprecatedPaintL
ayerFilterInfo::createFilterInfoForLayerIfNeeded(this); } | 358 DeprecatedPaintLayerFilterInfo* ensureFilterInfo() { return DeprecatedPaintL
ayerFilterInfo::createFilterInfoForLayerIfNeeded(this); } |
359 void removeFilterInfoIfNeeded() | 359 void removeFilterInfoIfNeeded() |
360 { | 360 { |
361 if (hasFilterInfo()) | 361 if (hasFilterInfo()) |
362 DeprecatedPaintLayerFilterInfo::removeFilterInfoForLayer(this); | 362 DeprecatedPaintLayerFilterInfo::removeFilterInfoForLayer(this); |
363 } | 363 } |
364 | 364 |
365 bool hasFilterInfo() const { return m_hasFilterInfo; } | 365 bool hasFilterInfo() const { return m_hasFilterInfo; } |
366 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo;
} | 366 void setHasFilterInfo(bool hasFilterInfo) { m_hasFilterInfo = hasFilterInfo;
} |
367 | 367 |
368 void updateFilters(const LayoutStyle* oldStyle, const LayoutStyle& newStyle)
; | 368 void updateFilters(const ComputedStyle* oldStyle, const ComputedStyle& newSt
yle); |
369 | 369 |
370 Node* enclosingElement() const; | 370 Node* enclosingElement() const; |
371 | 371 |
372 bool isInTopLayer() const; | 372 bool isInTopLayer() const; |
373 | 373 |
374 bool scrollsWithViewport() const; | 374 bool scrollsWithViewport() const; |
375 bool scrollsWithRespectTo(const DeprecatedPaintLayer*) const; | 375 bool scrollsWithRespectTo(const DeprecatedPaintLayer*) const; |
376 | 376 |
377 void addLayerHitTestRects(LayerHitTestRects&) const; | 377 void addLayerHitTestRects(LayerHitTestRects&) const; |
378 | 378 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); | 582 const LayoutRect& hitTestRect, const HitTestLocation&, const HitTestingT
ransformState* = 0, double* zOffset = 0); |
583 | 583 |
584 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; | 584 bool childBackgroundIsKnownToBeOpaqueInRect(const LayoutRect&) const; |
585 | 585 |
586 bool shouldBeSelfPaintingLayer() const; | 586 bool shouldBeSelfPaintingLayer() const; |
587 | 587 |
588 // FIXME: We should only create the stacking node if needed. | 588 // FIXME: We should only create the stacking node if needed. |
589 bool requiresStackingNode() const { return true; } | 589 bool requiresStackingNode() const { return true; } |
590 void updateStackingNode(); | 590 void updateStackingNode(); |
591 | 591 |
592 void updateReflectionInfo(const LayoutStyle*); | 592 void updateReflectionInfo(const ComputedStyle*); |
593 | 593 |
594 // FIXME: We could lazily allocate our ScrollableArea based on style propert
ies ('overflow', ...) | 594 // FIXME: We could lazily allocate our ScrollableArea based on style propert
ies ('overflow', ...) |
595 // but for now, we are always allocating it for LayoutBox as it's safer. crb
ug.com/467721. | 595 // but for now, we are always allocating it for LayoutBox as it's safer. crb
ug.com/467721. |
596 bool requiresScrollableArea() const { return layoutBox(); } | 596 bool requiresScrollableArea() const { return layoutBox(); } |
597 void updateScrollableArea(); | 597 void updateScrollableArea(); |
598 | 598 |
599 void dirtyAncestorChainVisibleDescendantStatus(); | 599 void dirtyAncestorChainVisibleDescendantStatus(); |
600 | 600 |
601 bool attemptDirectCompositingUpdate(StyleDifference, const LayoutStyle* oldS
tyle); | 601 bool attemptDirectCompositingUpdate(StyleDifference, const ComputedStyle* ol
dStyle); |
602 void updateTransform(const LayoutStyle* oldStyle, const LayoutStyle& newStyl
e); | 602 void updateTransform(const ComputedStyle* oldStyle, const ComputedStyle& new
Style); |
603 | 603 |
604 void dirty3DTransformedDescendantStatus(); | 604 void dirty3DTransformedDescendantStatus(); |
605 // Both updates the status, and returns true if descendants of this have 3d. | 605 // Both updates the status, and returns true if descendants of this have 3d. |
606 bool update3DTransformedDescendantStatus(); | 606 bool update3DTransformedDescendantStatus(); |
607 | 607 |
608 void updateOrRemoveFilterClients(); | 608 void updateOrRemoveFilterClients(); |
609 | 609 |
610 void updatePaginationRecursive(bool needsPaginationUpdate = false); | 610 void updatePaginationRecursive(bool needsPaginationUpdate = false); |
611 void updatePagination(); | 611 void updatePagination(); |
612 void clearPaginationRecursive(); | 612 void clearPaginationRecursive(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
723 | 723 |
724 } // namespace blink | 724 } // namespace blink |
725 | 725 |
726 #ifndef NDEBUG | 726 #ifndef NDEBUG |
727 // Outside the WebCore namespace for ease of invocation from gdb. | 727 // Outside the WebCore namespace for ease of invocation from gdb. |
728 void showLayerTree(const blink::DeprecatedPaintLayer*); | 728 void showLayerTree(const blink::DeprecatedPaintLayer*); |
729 void showLayerTree(const blink::LayoutObject*); | 729 void showLayerTree(const blink::LayoutObject*); |
730 #endif | 730 #endif |
731 | 731 |
732 #endif // Layer_h | 732 #endif // Layer_h |
OLD | NEW |