| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 , m_needsToRecomputeBounds(true) | 129 , m_needsToRecomputeBounds(true) |
| 130 , m_renderer(renderer) | 130 , m_renderer(renderer) |
| 131 , m_parent(0) | 131 , m_parent(0) |
| 132 , m_previous(0) | 132 , m_previous(0) |
| 133 , m_next(0) | 133 , m_next(0) |
| 134 , m_first(0) | 134 , m_first(0) |
| 135 , m_last(0) | 135 , m_last(0) |
| 136 , m_staticInlinePosition(0) | 136 , m_staticInlinePosition(0) |
| 137 , m_staticBlockPosition(0) | 137 , m_staticBlockPosition(0) |
| 138 , m_enclosingPaginationLayer(0) | 138 , m_enclosingPaginationLayer(0) |
| 139 , m_3dRenderingContextRoot(0) | |
| 140 , m_groupedMapping(0) | 139 , m_groupedMapping(0) |
| 141 , m_repainter(renderer) | 140 , m_repainter(renderer) |
| 142 , m_clipper(renderer) | 141 , m_clipper(renderer) |
| 143 , m_blendInfo(renderer) | 142 , m_blendInfo(renderer) |
| 144 { | 143 { |
| 145 updateStackingNode(); | 144 updateStackingNode(); |
| 146 | 145 |
| 147 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); | 146 m_isSelfPaintingLayer = shouldBeSelfPaintingLayer(); |
| 148 | 147 |
| 149 if (!renderer->firstChild() && renderer->style()) { | 148 if (!renderer->firstChild() && renderer->style()) { |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 ASSERT(box); | 554 ASSERT(box); |
| 556 m_transform->makeIdentity(); | 555 m_transform->makeIdentity(); |
| 557 box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRec
t().size(), RenderStyle::IncludeTransformOrigin); | 556 box->style()->applyTransform(*m_transform, box->pixelSnappedBorderBoxRec
t().size(), RenderStyle::IncludeTransformOrigin); |
| 558 makeMatrixRenderable(*m_transform, canRender3DTransforms()); | 557 makeMatrixRenderable(*m_transform, canRender3DTransforms()); |
| 559 } | 558 } |
| 560 | 559 |
| 561 if (had3DTransform != has3DTransform()) | 560 if (had3DTransform != has3DTransform()) |
| 562 dirty3DTransformedDescendantStatus(); | 561 dirty3DTransformedDescendantStatus(); |
| 563 } | 562 } |
| 564 | 563 |
| 565 // Note: this function assumes that all ancestors have an updated 3d rendering c
ontext root. | 564 static RenderLayer* enclosingLayerForContainingBlock(RenderLayer* layer) |
| 566 void RenderLayer::update3dRenderingContext() | |
| 567 { | 565 { |
| 568 m_3dRenderingContextRoot = 0; | 566 if (RenderObject* containingBlock = layer->renderer()->containingBlock()) |
| 567 return containingBlock->enclosingLayer(); |
| 568 return 0; |
| 569 } |
| 569 | 570 |
| 570 if (!shouldFlattenTransform()) | 571 RenderLayer* RenderLayer::renderingContextRoot() |
| 571 m_3dRenderingContextRoot = this; | 572 { |
| 573 RenderLayer* renderingContext = 0; |
| 572 | 574 |
| 573 if (RenderObject* containingBlock = renderer()->containingBlock()) { | 575 if (shouldPreserve3D()) |
| 574 if (RenderLayer* ancestorLayer = containingBlock->enclosingLayer()) { | 576 renderingContext = this; |
| 575 if (!ancestorLayer->shouldFlattenTransform()) | 577 |
| 576 m_3dRenderingContextRoot = ancestorLayer->renderingContextRoot()
; | 578 for (RenderLayer* current = enclosingLayerForContainingBlock(this); current
&& current->shouldPreserve3D(); current = enclosingLayerForContainingBlock(curre
nt)) |
| 577 } | 579 renderingContext = current; |
| 578 } | 580 |
| 581 return renderingContext; |
| 579 } | 582 } |
| 580 | 583 |
| 581 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
igin applyOrigin) const | 584 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
igin applyOrigin) const |
| 582 { | 585 { |
| 583 if (!m_transform) | 586 if (!m_transform) |
| 584 return TransformationMatrix(); | 587 return TransformationMatrix(); |
| 585 | 588 |
| 586 // m_transform includes transform-origin, so we need to recompute the transf
orm here. | 589 // m_transform includes transform-origin, so we need to recompute the transf
orm here. |
| 587 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { | 590 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { |
| 588 RenderBox* box = renderBox(); | 591 RenderBox* box = renderBox(); |
| (...skipping 3590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4179 } | 4182 } |
| 4180 } | 4183 } |
| 4181 | 4184 |
| 4182 void showLayerTree(const WebCore::RenderObject* renderer) | 4185 void showLayerTree(const WebCore::RenderObject* renderer) |
| 4183 { | 4186 { |
| 4184 if (!renderer) | 4187 if (!renderer) |
| 4185 return; | 4188 return; |
| 4186 showLayerTree(renderer->enclosingLayer()); | 4189 showLayerTree(renderer->enclosingLayer()); |
| 4187 } | 4190 } |
| 4188 #endif | 4191 #endif |
| OLD | NEW |