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

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

Issue 474683003: Not for review - Rebase of crrev.com/62833003 Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: . Created 6 years, 1 month 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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 m_overflowControlsClippingLayer->setOffsetFromRenderer(m_ancestorCli ppingLayer->offsetFromRenderer()); 795 m_overflowControlsClippingLayer->setOffsetFromRenderer(m_ancestorCli ppingLayer->offsetFromRenderer());
796 m_overflowControlsClippingLayer->setMasksToBounds(true); 796 m_overflowControlsClippingLayer->setMasksToBounds(true);
797 797
798 m_overflowControlsHostLayer->setPosition(IntPoint(-m_overflowControl sClippingLayer->offsetFromRenderer())); 798 m_overflowControlsHostLayer->setPosition(IntPoint(-m_overflowControl sClippingLayer->offsetFromRenderer()));
799 } else { 799 } else {
800 // The controls are in the same 2D space as the compositing containe r, so we can map them into the space of the container. 800 // The controls are in the same 2D space as the compositing containe r, so we can map them into the space of the container.
801 TransformState transformState(TransformState::ApplyTransformDirectio n, FloatPoint()); 801 TransformState transformState(TransformState::ApplyTransformDirectio n, FloatPoint());
802 m_owningLayer.renderer()->mapLocalToContainer(compositingStackingCon text->renderer(), transformState, ApplyContainerFlip); 802 m_owningLayer.renderer()->mapLocalToContainer(compositingStackingCon text->renderer(), transformState, ApplyContainerFlip);
803 transformState.flatten(); 803 transformState.flatten();
804 LayoutPoint offsetFromStackingContainer = LayoutPoint(transformState .lastPlanarPoint()); 804 LayoutPoint offsetFromStackingContainer = LayoutPoint(transformState .lastPlanarPoint());
805 if (RenderLayerScrollableArea* scrollableArea = compositingStackingC ontext->scrollableArea())
806 offsetFromStackingContainer.move(LayoutSize(scrollableArea->adju stedScrollOffset()));
805 m_overflowControlsHostLayer->setPosition(FloatPoint(offsetFromStacki ngContainer)); 807 m_overflowControlsHostLayer->setPosition(FloatPoint(offsetFromStacki ngContainer));
806 } 808 }
807 } else { 809 } else {
808 m_overflowControlsHostLayer->setPosition(FloatPoint()); 810 m_overflowControlsHostLayer->setPosition(FloatPoint());
809 } 811 }
810 } 812 }
811 813
812 void CompositedLayerMapping::updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds) 814 void CompositedLayerMapping::updateChildContainmentLayerGeometry(const IntRect& clippingBox, const IntRect& localCompositingBounds)
813 { 815 {
814 if (!m_childContainmentLayer) 816 if (!m_childContainmentLayer)
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283. 1153 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283.
1152 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi ze(m_owningLayer.scrollableArea()->adjustedScrollOffset()); 1154 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi ze(m_owningLayer.scrollableArea()->adjustedScrollOffset());
1153 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size( ) && m_scrollingBlockSelectionLayer->position() == position) 1155 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size( ) && m_scrollingBlockSelectionLayer->position() == position)
1154 return; 1156 return;
1155 1157
1156 m_scrollingBlockSelectionLayer->setPosition(position); 1158 m_scrollingBlockSelectionLayer->setPosition(position);
1157 m_scrollingBlockSelectionLayer->setSize(blockSelectionGapsBounds.size()); 1159 m_scrollingBlockSelectionLayer->setSize(blockSelectionGapsBounds.size());
1158 m_scrollingBlockSelectionLayer->setOffsetFromRenderer(toIntSize(blockSelecti onGapsBounds.location()), GraphicsLayer::SetNeedsDisplay); 1160 m_scrollingBlockSelectionLayer->setOffsetFromRenderer(toIntSize(blockSelecti onGapsBounds.location()), GraphicsLayer::SetNeedsDisplay);
1159 } 1161 }
1160 1162
1163 void CompositedLayerMapping::unbindAnimatedProperties()
1164 {
1165 TRACE_EVENT0("teleport", "CompositedLayerMapping::unbindAnimatedProperties") ;
1166 m_graphicsLayer->clearAnimatedProperties();
1167 if (m_scrollingContentsLayer)
1168 m_scrollingContentsLayer->clearAnimatedProperties();
1169 }
1170
1171 void CompositedLayerMapping::bindAnimatedProperties(const Vector<String>& proper ties)
1172 {
1173 TRACE_EVENT0("teleport", "CompositedLayerMapping::bindAnimatedProperties");
1174 for (size_t i = 0; i < properties.size(); ++i) {
1175 const String& property = properties[i];
1176 // TODO(vollick): this seems to be repeated a bunch. Can it be consolida ted?
1177 Vector<String> components;
1178 property.split(":", components);
1179 if (components[1] == "scrollTop" || components[1] == "pendingScrollDelta ") {
1180 if (m_scrollingContentsLayer)
1181 m_scrollingContentsLayer->addAnimatedProperty(property);
1182 } else {
1183 m_graphicsLayer->addAnimatedProperty(property);
1184 }
1185 }
1186 }
1187
1161 void CompositedLayerMapping::updateDrawsContent() 1188 void CompositedLayerMapping::updateDrawsContent()
1162 { 1189 {
1163 bool hasPaintedContent = containsPaintedContent(); 1190 bool hasPaintedContent = containsPaintedContent();
1164 m_graphicsLayer->setDrawsContent(hasPaintedContent); 1191 m_graphicsLayer->setDrawsContent(hasPaintedContent);
1165 1192
1166 if (m_scrollingLayer) { 1193 if (m_scrollingLayer) {
1167 // m_scrollingLayer never has backing store. 1194 // m_scrollingLayer never has backing store.
1168 // m_scrollingContentsLayer only needs backing store if the scrolled con tents need to paint. 1195 // m_scrollingContentsLayer only needs backing store if the scrolled con tents need to paint.
1169 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(re nderer()->hasBackground() || paintsChildren()); 1196 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(re nderer()->hasBackground() || paintsChildren());
1170 m_scrollingContentsLayer->setDrawsContent(!paintsIntoCompositedAncestor( ) && !m_scrollingContentsAreEmpty); 1197 m_scrollingContentsLayer->setDrawsContent(!paintsIntoCompositedAncestor( ) && !m_scrollingContentsAreEmpty);
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2373 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2400 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2374 name = "Scrolling Block Selection Layer"; 2401 name = "Scrolling Block Selection Layer";
2375 } else { 2402 } else {
2376 ASSERT_NOT_REACHED(); 2403 ASSERT_NOT_REACHED();
2377 } 2404 }
2378 2405
2379 return name; 2406 return name;
2380 } 2407 }
2381 2408
2382 } // namespace blink 2409 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698