Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 497153003: Fix squashing to treat perspective and preserve3d elements as transform ancestors. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 #include "core/rendering/RenderImage.h" 47 #include "core/rendering/RenderImage.h"
48 #include "core/rendering/RenderLayerStackingNodeIterator.h" 48 #include "core/rendering/RenderLayerStackingNodeIterator.h"
49 #include "core/rendering/RenderPart.h" 49 #include "core/rendering/RenderPart.h"
50 #include "core/rendering/RenderVideo.h" 50 #include "core/rendering/RenderVideo.h"
51 #include "core/rendering/RenderView.h" 51 #include "core/rendering/RenderView.h"
52 #include "core/rendering/compositing/RenderLayerCompositor.h" 52 #include "core/rendering/compositing/RenderLayerCompositor.h"
53 #include "core/rendering/style/KeyframeList.h" 53 #include "core/rendering/style/KeyframeList.h"
54 #include "platform/LengthFunctions.h" 54 #include "platform/LengthFunctions.h"
55 #include "platform/RuntimeEnabledFeatures.h" 55 #include "platform/RuntimeEnabledFeatures.h"
56 #include "platform/fonts/FontCache.h" 56 #include "platform/fonts/FontCache.h"
57 #include "platform/geometry/TransformState.h"
57 #include "platform/graphics/GraphicsContext.h" 58 #include "platform/graphics/GraphicsContext.h"
58 #include "wtf/CurrentTime.h" 59 #include "wtf/CurrentTime.h"
59 #include "wtf/text/StringBuilder.h" 60 #include "wtf/text/StringBuilder.h"
60 61
61 namespace blink { 62 namespace blink {
62 63
63 using namespace HTMLNames; 64 using namespace HTMLNames;
64 65
65 static IntRect clipBox(RenderBox* renderer); 66 static IntRect clipBox(RenderBox* renderer);
66 67
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
754 755
755 if (needsToReparentOverflowControls()) { 756 if (needsToReparentOverflowControls()) {
756 if (m_overflowControlsClippingLayer) { 757 if (m_overflowControlsClippingLayer) {
757 m_overflowControlsClippingLayer->setPosition(m_ancestorClippingLayer ->position()); 758 m_overflowControlsClippingLayer->setPosition(m_ancestorClippingLayer ->position());
758 m_overflowControlsClippingLayer->setSize(m_ancestorClippingLayer->si ze()); 759 m_overflowControlsClippingLayer->setSize(m_ancestorClippingLayer->si ze());
759 m_overflowControlsClippingLayer->setOffsetFromRenderer(m_ancestorCli ppingLayer->offsetFromRenderer()); 760 m_overflowControlsClippingLayer->setOffsetFromRenderer(m_ancestorCli ppingLayer->offsetFromRenderer());
760 m_overflowControlsClippingLayer->setMasksToBounds(true); 761 m_overflowControlsClippingLayer->setMasksToBounds(true);
761 762
762 m_overflowControlsHostLayer->setPosition(IntPoint(-m_overflowControl sClippingLayer->offsetFromRenderer())); 763 m_overflowControlsHostLayer->setPosition(IntPoint(-m_overflowControl sClippingLayer->offsetFromRenderer()));
763 } else { 764 } else {
764 ASSERT(m_owningLayer.transformAncestor() == compositingStackingConte xt->transformAncestor()); 765 // The controls are in the same 2D space as the compositing containe r, so we can map them into the space of the container.
765 LayoutPoint localOffsetToTransformedAncestor = m_owningLayer.compute OffsetFromTransformedAncestor(); 766 TransformState transformState(TransformState::ApplyTransformDirectio n, FloatPoint());
766 LayoutPoint compositingStackingContextOffsetToTransformedAncestor = compositingStackingContext->computeOffsetFromTransformedAncestor(); 767 m_owningLayer.renderer()->mapLocalToContainer(compositingStackingCon text->renderer(), transformState, ApplyContainerFlip);
767 768 transformState.flatten();
768 m_overflowControlsHostLayer->setPosition(FloatPoint(localOffsetToTra nsformedAncestor - compositingStackingContextOffsetToTransformedAncestor)); 769 LayoutPoint offsetFromStackingContainer = LayoutPoint(transformState .lastPlanarPoint());
770 m_overflowControlsHostLayer->setPosition(FloatPoint(offsetFromStacki ngContainer));
769 } 771 }
770 } else { 772 } else {
771 m_overflowControlsHostLayer->setPosition(FloatPoint()); 773 m_overflowControlsHostLayer->setPosition(FloatPoint());
772 } 774 }
773 } 775 }
774 776
775 void CompositedLayerMapping::updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds) 777 void CompositedLayerMapping::updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds)
776 { 778 {
777 if (!m_childContainmentLayer) 779 if (!m_childContainmentLayer)
778 return; 780 return;
(...skipping 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after
2278 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2280 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2279 name = "Scrolling Block Selection Layer"; 2281 name = "Scrolling Block Selection Layer";
2280 } else { 2282 } else {
2281 ASSERT_NOT_REACHED(); 2283 ASSERT_NOT_REACHED();
2282 } 2284 }
2283 2285
2284 return name; 2286 return name;
2285 } 2287 }
2286 2288
2287 } // namespace blink 2289 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/compositing/CompositingInputsUpdater.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698