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

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

Issue 250193002: Offset rects by origin when projecting from composited to graphics layer. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update test expectations Created 6 years, 8 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 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 clipLayer->setSize(clippingBox.size()); 735 clipLayer->setSize(clippingBox.size());
736 clipLayer->setOffsetFromRenderer(toIntSize(clippingBox.location())); 736 clipLayer->setOffsetFromRenderer(toIntSize(clippingBox.location()));
737 if (m_childClippingMaskLayer && !m_scrollingLayer) { 737 if (m_childClippingMaskLayer && !m_scrollingLayer) {
738 m_childClippingMaskLayer->setPosition(clipLayer->position()); 738 m_childClippingMaskLayer->setPosition(clipLayer->position());
739 m_childClippingMaskLayer->setSize(clipLayer->size()); 739 m_childClippingMaskLayer->setSize(clipLayer->size());
740 m_childClippingMaskLayer->setOffsetFromRenderer(clipLayer->offsetFro mRenderer()); 740 m_childClippingMaskLayer->setOffsetFromRenderer(clipLayer->offsetFro mRenderer());
741 } 741 }
742 } else if (m_childTransformLayer) { 742 } else if (m_childTransformLayer) {
743 const IntRect borderBox = toRenderBox(m_owningLayer.renderer())->pixelSn appedBorderBoxRect(); 743 const IntRect borderBox = toRenderBox(m_owningLayer.renderer())->pixelSn appedBorderBoxRect();
744 m_childTransformLayer->setSize(borderBox.size()); 744 m_childTransformLayer->setSize(borderBox.size());
745 m_childTransformLayer->setPosition(FloatPoint(contentOffsetInCompostingL ayer())); 745 m_childTransformLayer->setPosition(FloatPoint(contentOffsetInCompositing Layer()));
746 } 746 }
747 747
748 if (m_maskLayer) { 748 if (m_maskLayer) {
749 if (m_maskLayer->size() != m_graphicsLayer->size()) { 749 if (m_maskLayer->size() != m_graphicsLayer->size()) {
750 m_maskLayer->setSize(m_graphicsLayer->size()); 750 m_maskLayer->setSize(m_graphicsLayer->size());
751 m_maskLayer->setNeedsDisplay(); 751 m_maskLayer->setNeedsDisplay();
752 } 752 }
753 m_maskLayer->setPosition(FloatPoint()); 753 m_maskLayer->setPosition(FloatPoint());
754 m_maskLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer() ); 754 m_maskLayer->setOffsetFromRenderer(m_graphicsLayer->offsetFromRenderer() );
755 } 755 }
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 1690
1691 FloatPoint3D origin; 1691 FloatPoint3D origin;
1692 origin.setX(floatValueForLength(style->transformOriginX(), borderBox.width() )); 1692 origin.setX(floatValueForLength(style->transformOriginX(), borderBox.width() ));
1693 origin.setY(floatValueForLength(style->transformOriginY(), borderBox.height( ))); 1693 origin.setY(floatValueForLength(style->transformOriginY(), borderBox.height( )));
1694 origin.setZ(style->transformOriginZ()); 1694 origin.setZ(style->transformOriginZ());
1695 1695
1696 return origin; 1696 return origin;
1697 } 1697 }
1698 1698
1699 // Return the offset from the top-left of this compositing layer at which the re nderer's contents are painted. 1699 // Return the offset from the top-left of this compositing layer at which the re nderer's contents are painted.
1700 LayoutSize CompositedLayerMapping::contentOffsetInCompostingLayer() const 1700 LayoutSize CompositedLayerMapping::contentOffsetInCompositingLayer() const
1701 { 1701 {
1702 return LayoutSize(-m_compositedBounds.x(), -m_compositedBounds.y()); 1702 return LayoutSize(-m_compositedBounds.x(), -m_compositedBounds.y());
1703 } 1703 }
1704 1704
1705 LayoutRect CompositedLayerMapping::contentsBox() const 1705 LayoutRect CompositedLayerMapping::contentsBox() const
1706 { 1706 {
1707 LayoutRect contentsBox = contentsRect(renderer()); 1707 LayoutRect contentsBox = contentsRect(renderer());
1708 contentsBox.move(contentOffsetInCompostingLayer()); 1708 contentsBox.move(contentOffsetInCompositingLayer());
1709 return contentsBox; 1709 return contentsBox;
1710 } 1710 }
1711 1711
1712 GraphicsLayer* CompositedLayerMapping::parentForSublayers() const 1712 GraphicsLayer* CompositedLayerMapping::parentForSublayers() const
1713 { 1713 {
1714 if (m_scrollingContentsLayer) 1714 if (m_scrollingContentsLayer)
1715 return m_scrollingContentsLayer.get(); 1715 return m_scrollingContentsLayer.get();
1716 1716
1717 if (m_childContainmentLayer) 1717 if (m_childContainmentLayer)
1718 return m_childContainmentLayer.get(); 1718 return m_childContainmentLayer.get();
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2142 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2143 name = "Scrolling Contents Layer"; 2143 name = "Scrolling Contents Layer";
2144 } else { 2144 } else {
2145 ASSERT_NOT_REACHED(); 2145 ASSERT_NOT_REACHED();
2146 } 2146 }
2147 2147
2148 return name; 2148 return name;
2149 } 2149 }
2150 2150
2151 } // namespace WebCore 2151 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/compositing/CompositedLayerMapping.h ('k') | Source/core/testing/Internals.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698