diff options
| author | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-18 10:55:06 +0200 |
|---|---|---|
| committer | Simon Hausmann <simon.hausmann@digia.com> | 2012-10-18 10:55:06 +0200 |
| commit | ee4c86d1990a9e26277a6948e7027ad8d525ebfa (patch) | |
| tree | 1e2d3408cd097606571f40ab63353c27bcb7dd5c /Source/WebCore/rendering/RenderLayer.cpp | |
| parent | d882bec96d0d30aeeda2141bfadfca7f038ee862 (diff) | |
| download | qtwebkit-ee4c86d1990a9e26277a6948e7027ad8d525ebfa.tar.gz | |
Imported WebKit commit 795dcd25a9649fccaf1c9b685f6e2ffedaf7e620 (http://svn.webkit.org/repository/webkit/trunk@131718)
New snapshot that includes the return of -fkeep-memory at link time
to reduce memory pressure as well as modularized documentation
Diffstat (limited to 'Source/WebCore/rendering/RenderLayer.cpp')
| -rw-r--r-- | Source/WebCore/rendering/RenderLayer.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp index c850a2f4d..62606f196 100644 --- a/Source/WebCore/rendering/RenderLayer.cpp +++ b/Source/WebCore/rendering/RenderLayer.cpp @@ -597,7 +597,7 @@ void RenderLayer::updateTransform() dirty3DTransformedDescendantStatus(); } -TransformationMatrix RenderLayer::currentTransform() const +TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOrigin applyOrigin) const { if (!m_transform) return TransformationMatrix(); @@ -606,7 +606,16 @@ TransformationMatrix RenderLayer::currentTransform() const if (renderer()->style()->isRunningAcceleratedAnimation()) { TransformationMatrix currTransform; RefPtr<RenderStyle> style = renderer()->animation()->getAnimatedStyleForRenderer(renderer()); - style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxRect().size(), RenderStyle::IncludeTransformOrigin); + style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxRect().size(), applyOrigin); + makeMatrixRenderable(currTransform, canRender3DTransforms()); + return currTransform; + } + + // m_transform includes transform-origin, so we need to recompute the transform here. + if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { + RenderBox* box = renderBox(); + TransformationMatrix currTransform; + box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRect().size(), RenderStyle::ExcludeTransformOrigin); makeMatrixRenderable(currTransform, canRender3DTransforms()); return currTransform; } @@ -3495,6 +3504,8 @@ bool RenderLayer::hitTest(const HitTestRequest& request, HitTestResult& result) bool RenderLayer::hitTest(const HitTestRequest& request, const HitTestLocation& hitTestLocation, HitTestResult& result) { + ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); + renderer()->document()->updateLayout(); LayoutRect hitTestArea = renderer()->isRenderFlowThread() ? toRenderFlowThread(renderer())->borderBoxRect() : renderer()->view()->documentRect(); @@ -3615,6 +3626,9 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont const LayoutRect& hitTestRect, const HitTestLocation& hitTestLocation, bool appliedTransform, const HitTestingTransformState* transformState, double* zOffset) { + if (!isSelfPaintingLayer() && !hasSelfPaintingLayerDescendant()) + return 0; + // The natural thing would be to keep HitTestingTransformState on the stack, but it's big, so we heap-allocate. bool useTemporaryClipRects = renderer()->view()->frameView()->containsScrollableAreaWithOverlayScrollbars(); @@ -3786,6 +3800,8 @@ RenderLayer* RenderLayer::hitTestLayer(RenderLayer* rootLayer, RenderLayer* cont bool RenderLayer::hitTestContents(const HitTestRequest& request, HitTestResult& result, const LayoutRect& layerBounds, const HitTestLocation& hitTestLocation, HitTestFilter hitTestFilter) const { + ASSERT(isSelfPaintingLayer() || hasSelfPaintingLayerDescendant()); + if (!renderer()->hitTest(request, result, hitTestLocation, toLayoutPoint(layerBounds.location() - renderBoxLocation()), hitTestFilter)) { @@ -3820,7 +3836,10 @@ RenderLayer* RenderLayer::hitTestList(Vector<RenderLayer*>* list, RenderLayer* r { if (!list) return 0; - + + if (!hasSelfPaintingLayerDescendant()) + return 0; + RenderLayer* resultLayer = 0; for (int i = list->size() - 1; i >= 0; --i) { RenderLayer* childLayer = list->at(i); |
