| OLD | NEW |
| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 return 0; | 157 return 0; |
| 158 | 158 |
| 159 return page->scrollingCoordinator(); | 159 return page->scrollingCoordinator(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 CompositedLayerMapping::CompositedLayerMapping(RenderLayer& layer) | 162 CompositedLayerMapping::CompositedLayerMapping(RenderLayer& layer) |
| 163 : m_owningLayer(layer) | 163 : m_owningLayer(layer) |
| 164 , m_contentOffsetInCompositingLayerDirty(false) | 164 , m_contentOffsetInCompositingLayerDirty(false) |
| 165 , m_pendingUpdateScope(GraphicsLayerUpdateNone) | 165 , m_pendingUpdateScope(GraphicsLayerUpdateNone) |
| 166 , m_isMainFrameRenderViewLayer(false) | 166 , m_isMainFrameRenderViewLayer(false) |
| 167 , m_requiresOwnBackingStoreForIntrinsicReasons(false) | |
| 168 , m_requiresOwnBackingStoreForAncestorReasons(false) | |
| 169 , m_backgroundLayerPaintsFixedRootBackground(false) | 167 , m_backgroundLayerPaintsFixedRootBackground(false) |
| 170 , m_scrollingContentsAreEmpty(false) | 168 , m_scrollingContentsAreEmpty(false) |
| 171 { | 169 { |
| 172 if (layer.isRootLayer() && renderer()->frame()->isMainFrame()) | 170 if (layer.isRootLayer() && renderer()->frame()->isMainFrame()) |
| 173 m_isMainFrameRenderViewLayer = true; | 171 m_isMainFrameRenderViewLayer = true; |
| 174 | 172 |
| 175 createPrimaryGraphicsLayer(); | 173 createPrimaryGraphicsLayer(); |
| 176 } | 174 } |
| 177 | 175 |
| 178 CompositedLayerMapping::~CompositedLayerMapping() | 176 CompositedLayerMapping::~CompositedLayerMapping() |
| (...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 return; | 1137 return; |
| 1140 | 1138 |
| 1141 if (!m_scrollingContentsAreEmpty) { | 1139 if (!m_scrollingContentsAreEmpty) { |
| 1142 // In this case, the selection will be painted directly into m_scrolling
ContentsLayer. | 1140 // In this case, the selection will be painted directly into m_scrolling
ContentsLayer. |
| 1143 m_scrollingBlockSelectionLayer->setDrawsContent(false); | 1141 m_scrollingBlockSelectionLayer->setDrawsContent(false); |
| 1144 return; | 1142 return; |
| 1145 } | 1143 } |
| 1146 | 1144 |
| 1147 const IntRect blockSelectionGapsBounds = m_owningLayer.blockSelectionGapsBou
nds(); | 1145 const IntRect blockSelectionGapsBounds = m_owningLayer.blockSelectionGapsBou
nds(); |
| 1148 const bool shouldDrawContent = !blockSelectionGapsBounds.isEmpty(); | 1146 const bool shouldDrawContent = !blockSelectionGapsBounds.isEmpty(); |
| 1149 m_scrollingBlockSelectionLayer->setDrawsContent(!paintsIntoCompositedAncesto
r() && shouldDrawContent); | 1147 m_scrollingBlockSelectionLayer->setDrawsContent(shouldDrawContent); |
| 1150 if (!shouldDrawContent) | 1148 if (!shouldDrawContent) |
| 1151 return; | 1149 return; |
| 1152 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283. | 1150 // FIXME: Remove the flooredIntSize conversion. crbug.com/414283. |
| 1153 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi
ze(m_owningLayer.scrollableArea()->adjustedScrollOffset()); | 1151 const IntPoint position = blockSelectionGapsBounds.location() + flooredIntSi
ze(m_owningLayer.scrollableArea()->adjustedScrollOffset()); |
| 1154 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size(
) && m_scrollingBlockSelectionLayer->position() == position) | 1152 if (m_scrollingBlockSelectionLayer->size() == blockSelectionGapsBounds.size(
) && m_scrollingBlockSelectionLayer->position() == position) |
| 1155 return; | 1153 return; |
| 1156 | 1154 |
| 1157 m_scrollingBlockSelectionLayer->setPosition(position); | 1155 m_scrollingBlockSelectionLayer->setPosition(position); |
| 1158 m_scrollingBlockSelectionLayer->setSize(blockSelectionGapsBounds.size()); | 1156 m_scrollingBlockSelectionLayer->setSize(blockSelectionGapsBounds.size()); |
| 1159 m_scrollingBlockSelectionLayer->setOffsetFromRenderer(toIntSize(blockSelecti
onGapsBounds.location()), GraphicsLayer::SetNeedsDisplay); | 1157 m_scrollingBlockSelectionLayer->setOffsetFromRenderer(toIntSize(blockSelecti
onGapsBounds.location()), GraphicsLayer::SetNeedsDisplay); |
| 1160 } | 1158 } |
| 1161 | 1159 |
| 1162 void CompositedLayerMapping::updateDrawsContent() | 1160 void CompositedLayerMapping::updateDrawsContent() |
| 1163 { | 1161 { |
| 1164 bool hasPaintedContent = containsPaintedContent(); | 1162 bool hasPaintedContent = containsPaintedContent(); |
| 1165 m_graphicsLayer->setDrawsContent(hasPaintedContent); | 1163 m_graphicsLayer->setDrawsContent(hasPaintedContent); |
| 1166 | 1164 |
| 1167 if (m_scrollingLayer) { | 1165 if (m_scrollingLayer) { |
| 1168 // m_scrollingLayer never has backing store. | 1166 // m_scrollingLayer never has backing store. |
| 1169 // m_scrollingContentsLayer only needs backing store if the scrolled con
tents need to paint. | 1167 // m_scrollingContentsLayer only needs backing store if the scrolled con
tents need to paint. |
| 1170 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(re
nderer()->hasBackground() || paintsChildren()); | 1168 m_scrollingContentsAreEmpty = !m_owningLayer.hasVisibleContent() || !(re
nderer()->hasBackground() || paintsChildren()); |
| 1171 m_scrollingContentsLayer->setDrawsContent(!paintsIntoCompositedAncestor(
) && !m_scrollingContentsAreEmpty); | 1169 m_scrollingContentsLayer->setDrawsContent(!m_scrollingContentsAreEmpty); |
| 1172 updateScrollingBlockSelection(); | 1170 updateScrollingBlockSelection(); |
| 1173 } | 1171 } |
| 1174 | 1172 |
| 1175 if (hasPaintedContent && isAcceleratedCanvas(renderer())) { | 1173 if (hasPaintedContent && isAcceleratedCanvas(renderer())) { |
| 1176 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node()
)->renderingContext(); | 1174 CanvasRenderingContext* context = toHTMLCanvasElement(renderer()->node()
)->renderingContext(); |
| 1177 // Content layer may be null if context is lost. | 1175 // Content layer may be null if context is lost. |
| 1178 if (WebLayer* contentLayer = context->platformLayer()) { | 1176 if (WebLayer* contentLayer = context->platformLayer()) { |
| 1179 Color bgColor(Color::transparent); | 1177 Color bgColor(Color::transparent); |
| 1180 if (contentLayerSupportsDirectBackgroundComposition(renderer())) { | 1178 if (contentLayerSupportsDirectBackgroundComposition(renderer())) { |
| 1181 bgColor = rendererBackgroundColor(); | 1179 bgColor = rendererBackgroundColor(); |
| 1182 hasPaintedContent = false; | 1180 hasPaintedContent = false; |
| 1183 } | 1181 } |
| 1184 contentLayer->setBackgroundColor(bgColor.rgb()); | 1182 contentLayer->setBackgroundColor(bgColor.rgb()); |
| 1185 } | 1183 } |
| 1186 } | 1184 } |
| 1187 | 1185 |
| 1188 // FIXME: we could refine this to only allocate backings for one of these la
yers if possible. | 1186 // FIXME: we could refine this to only allocate backings for one of these la
yers if possible. |
| 1189 if (m_foregroundLayer) | 1187 if (m_foregroundLayer) |
| 1190 m_foregroundLayer->setDrawsContent(hasPaintedContent); | 1188 m_foregroundLayer->setDrawsContent(hasPaintedContent); |
| 1191 | 1189 |
| 1192 if (m_backgroundLayer) | 1190 if (m_backgroundLayer) |
| 1193 m_backgroundLayer->setDrawsContent(hasPaintedContent); | 1191 m_backgroundLayer->setDrawsContent(hasPaintedContent); |
| 1194 | 1192 |
| 1195 if (m_maskLayer) | 1193 if (m_maskLayer) |
| 1196 m_maskLayer->setDrawsContent(!paintsIntoCompositedAncestor()); | 1194 m_maskLayer->setDrawsContent(true); |
| 1197 | 1195 |
| 1198 if (m_childClippingMaskLayer) | 1196 if (m_childClippingMaskLayer) |
| 1199 m_childClippingMaskLayer->setDrawsContent(!paintsIntoCompositedAncestor(
)); | 1197 m_childClippingMaskLayer->setDrawsContent(true); |
| 1200 } | 1198 } |
| 1201 | 1199 |
| 1202 void CompositedLayerMapping::updateChildrenTransform() | 1200 void CompositedLayerMapping::updateChildrenTransform() |
| 1203 { | 1201 { |
| 1204 if (GraphicsLayer* childTransformLayer = layerForChildrenTransform()) { | 1202 if (GraphicsLayer* childTransformLayer = layerForChildrenTransform()) { |
| 1205 childTransformLayer->setTransform(owningLayer().perspectiveTransform()); | 1203 childTransformLayer->setTransform(owningLayer().perspectiveTransform()); |
| 1206 childTransformLayer->setTransformOrigin(FloatPoint3D(childTransformLayer
->size().width() * 0.5f, childTransformLayer->size().height() * 0.5f, 0.f)); | 1204 childTransformLayer->setTransformOrigin(FloatPoint3D(childTransformLayer
->size().width() * 0.5f, childTransformLayer->size().height() * 0.5f, 0.f)); |
| 1207 } | 1205 } |
| 1208 | 1206 |
| 1209 updateShouldFlattenTransform(); | 1207 updateShouldFlattenTransform(); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1693 | 1691 |
| 1694 // If we found a composited layer, regardless of whether it actually | 1692 // If we found a composited layer, regardless of whether it actually |
| 1695 // paints into it, we want to compute opacity relative to it. So we can | 1693 // paints into it, we want to compute opacity relative to it. So we can |
| 1696 // break here. | 1694 // break here. |
| 1697 // | 1695 // |
| 1698 // FIXME: with grouped backings, a composited descendant will have to | 1696 // FIXME: with grouped backings, a composited descendant will have to |
| 1699 // continue past the grouped (squashed) layers that its parents may | 1697 // continue past the grouped (squashed) layers that its parents may |
| 1700 // contribute to. This whole confusion can be avoided by specifying | 1698 // contribute to. This whole confusion can be avoided by specifying |
| 1701 // explicitly the composited ancestor where we would stop accumulating | 1699 // explicitly the composited ancestor where we would stop accumulating |
| 1702 // opacity. | 1700 // opacity. |
| 1703 if (curr->compositingState() == PaintsIntoOwnBacking || curr->compositin
gState() == HasOwnBackingButPaintsIntoAncestor) | 1701 if (curr->compositingState() == PaintsIntoOwnBacking) |
| 1704 break; | 1702 break; |
| 1705 | 1703 |
| 1706 finalOpacity *= curr->renderer()->opacity(); | 1704 finalOpacity *= curr->renderer()->opacity(); |
| 1707 } | 1705 } |
| 1708 | 1706 |
| 1709 return finalOpacity; | 1707 return finalOpacity; |
| 1710 } | 1708 } |
| 1711 | 1709 |
| 1712 Color CompositedLayerMapping::rendererBackgroundColor() const | 1710 Color CompositedLayerMapping::rendererBackgroundColor() const |
| 1713 { | 1711 { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 continue; | 1756 continue; |
| 1759 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(
curLayer)) | 1757 if (curLayer->hasVisibleContent() || hasVisibleNonCompositingDescendant(
curLayer)) |
| 1760 return true; | 1758 return true; |
| 1761 } | 1759 } |
| 1762 | 1760 |
| 1763 return false; | 1761 return false; |
| 1764 } | 1762 } |
| 1765 | 1763 |
| 1766 bool CompositedLayerMapping::containsPaintedContent() const | 1764 bool CompositedLayerMapping::containsPaintedContent() const |
| 1767 { | 1765 { |
| 1768 if (paintsIntoCompositedAncestor() || m_owningLayer.isReflection()) | 1766 if (m_owningLayer.isReflection()) |
| 1769 return false; | 1767 return false; |
| 1770 | 1768 |
| 1771 if (renderer()->isImage() && isDirectlyCompositedImage()) | 1769 if (renderer()->isImage() && isDirectlyCompositedImage()) |
| 1772 return false; | 1770 return false; |
| 1773 | 1771 |
| 1774 RenderObject* renderObject = renderer(); | 1772 RenderObject* renderObject = renderer(); |
| 1775 // FIXME: we could optimize cases where the image, video or canvas is known
to fill the border box entirely, | 1773 // FIXME: we could optimize cases where the image, video or canvas is known
to fill the border box entirely, |
| 1776 // and set background color on the layer in that case, instead of allocating
backing store and painting. | 1774 // and set background color on the layer in that case, instead of allocating
backing store and painting. |
| 1777 if (renderObject->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo
()) | 1775 if (renderObject->isVideo() && toRenderVideo(renderer())->shouldDisplayVideo
()) |
| 1778 return m_owningLayer.hasBoxDecorationsOrBackground(); | 1776 return m_owningLayer.hasBoxDecorationsOrBackground(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1945 | 1943 |
| 1946 GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const | 1944 GraphicsLayer* CompositedLayerMapping::layerForChildrenTransform() const |
| 1947 { | 1945 { |
| 1948 if (GraphicsLayer* clipLayer = clippingLayer()) | 1946 if (GraphicsLayer* clipLayer = clippingLayer()) |
| 1949 return clipLayer; | 1947 return clipLayer; |
| 1950 if (m_scrollingLayer) | 1948 if (m_scrollingLayer) |
| 1951 return m_scrollingLayer.get(); | 1949 return m_scrollingLayer.get(); |
| 1952 return m_childTransformLayer.get(); | 1950 return m_childTransformLayer.get(); |
| 1953 } | 1951 } |
| 1954 | 1952 |
| 1955 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForAncestorReasons(con
st RenderLayer* compositingAncestorLayer) | |
| 1956 { | |
| 1957 unsigned previousRequiresOwnBackingStoreForAncestorReasons = m_requiresOwnBa
ckingStoreForAncestorReasons; | |
| 1958 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); | |
| 1959 bool canPaintIntoAncestor = compositingAncestorLayer | |
| 1960 && (compositingAncestorLayer->compositedLayerMapping()->mainGraphicsLaye
r()->drawsContent() | |
| 1961 || compositingAncestorLayer->compositedLayerMapping()->paintsIntoCom
positedAncestor()); | |
| 1962 | |
| 1963 m_requiresOwnBackingStoreForAncestorReasons = !canPaintIntoAncestor; | |
| 1964 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor)
{ | |
| 1965 // Back out the change temporarily while invalidating with respect to th
e old container. | |
| 1966 m_requiresOwnBackingStoreForAncestorReasons = !m_requiresOwnBackingStore
ForAncestorReasons; | |
| 1967 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer); | |
| 1968 m_requiresOwnBackingStoreForAncestorReasons = !m_requiresOwnBackingStore
ForAncestorReasons; | |
| 1969 } | |
| 1970 | |
| 1971 return m_requiresOwnBackingStoreForAncestorReasons != previousRequiresOwnBac
kingStoreForAncestorReasons; | |
| 1972 } | |
| 1973 | |
| 1974 bool CompositedLayerMapping::updateRequiresOwnBackingStoreForIntrinsicReasons() | |
| 1975 { | |
| 1976 unsigned previousRequiresOwnBackingStoreForIntrinsicReasons = m_requiresOwnB
ackingStoreForIntrinsicReasons; | |
| 1977 bool previousPaintsIntoCompositedAncestor = paintsIntoCompositedAncestor(); | |
| 1978 RenderObject* renderer = m_owningLayer.renderer(); | |
| 1979 m_requiresOwnBackingStoreForIntrinsicReasons = m_owningLayer.isRootLayer() | |
| 1980 || (m_owningLayer.compositingReasons() & CompositingReasonComboReasonsTh
atRequireOwnBacking) | |
| 1981 || m_owningLayer.transform() | |
| 1982 || m_owningLayer.clipsCompositingDescendantsWithBorderRadius() // FIXME:
Revisit this if the paintsIntoCompositedAncestor state is removed. | |
| 1983 || renderer->isTransparent() | |
| 1984 || renderer->hasMask() | |
| 1985 || renderer->hasReflection() | |
| 1986 || renderer->hasFilter(); | |
| 1987 | |
| 1988 if (paintsIntoCompositedAncestor() != previousPaintsIntoCompositedAncestor)
{ | |
| 1989 // Back out the change temporarily while invalidating with respect to th
e old container. | |
| 1990 m_requiresOwnBackingStoreForIntrinsicReasons = !m_requiresOwnBackingStor
eForIntrinsicReasons; | |
| 1991 compositor()->paintInvalidationOnCompositingChange(&m_owningLayer); | |
| 1992 m_requiresOwnBackingStoreForIntrinsicReasons = !m_requiresOwnBackingStor
eForIntrinsicReasons; | |
| 1993 } | |
| 1994 | |
| 1995 return m_requiresOwnBackingStoreForIntrinsicReasons != previousRequiresOwnBa
ckingStoreForIntrinsicReasons; | |
| 1996 } | |
| 1997 | |
| 1998 void CompositedLayerMapping::setBlendMode(WebBlendMode blendMode) | 1953 void CompositedLayerMapping::setBlendMode(WebBlendMode blendMode) |
| 1999 { | 1954 { |
| 2000 if (m_ancestorClippingLayer) { | 1955 if (m_ancestorClippingLayer) { |
| 2001 m_ancestorClippingLayer->setBlendMode(blendMode); | 1956 m_ancestorClippingLayer->setBlendMode(blendMode); |
| 2002 m_graphicsLayer->setBlendMode(WebBlendModeNormal); | 1957 m_graphicsLayer->setBlendMode(WebBlendModeNormal); |
| 2003 } else { | 1958 } else { |
| 2004 m_graphicsLayer->setBlendMode(blendMode); | 1959 m_graphicsLayer->setBlendMode(blendMode); |
| 2005 } | 1960 } |
| 2006 } | 1961 } |
| 2007 | 1962 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2021 }; | 1976 }; |
| 2022 | 1977 |
| 2023 void CompositedLayerMapping::setSquashingContentsNeedDisplay() | 1978 void CompositedLayerMapping::setSquashingContentsNeedDisplay() |
| 2024 { | 1979 { |
| 2025 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToSquashi
ngLayer); | 1980 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToSquashi
ngLayer); |
| 2026 } | 1981 } |
| 2027 | 1982 |
| 2028 void CompositedLayerMapping::setContentsNeedDisplay() | 1983 void CompositedLayerMapping::setContentsNeedDisplay() |
| 2029 { | 1984 { |
| 2030 // FIXME: need to split out paint invalidations for the background. | 1985 // FIXME: need to split out paint invalidations for the background. |
| 2031 ASSERT(!paintsIntoCompositedAncestor()); | |
| 2032 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToContent
Layers); | 1986 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToContent
Layers); |
| 2033 } | 1987 } |
| 2034 | 1988 |
| 2035 struct SetContentsNeedsDisplayInRectFunctor { | 1989 struct SetContentsNeedsDisplayInRectFunctor { |
| 2036 void operator() (GraphicsLayer* layer) const | 1990 void operator() (GraphicsLayer* layer) const |
| 2037 { | 1991 { |
| 2038 if (layer->drawsContent()) { | 1992 if (layer->drawsContent()) { |
| 2039 IntRect layerDirtyRect = r; | 1993 IntRect layerDirtyRect = r; |
| 2040 layerDirtyRect.move(-layer->offsetFromRenderer()); | 1994 layerDirtyRect.move(-layer->offsetFromRenderer()); |
| 2041 layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason); | 1995 layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason); |
| 2042 } | 1996 } |
| 2043 } | 1997 } |
| 2044 | 1998 |
| 2045 IntRect r; | 1999 IntRect r; |
| 2046 PaintInvalidationReason invalidationReason; | 2000 PaintInvalidationReason invalidationReason; |
| 2047 }; | 2001 }; |
| 2048 | 2002 |
| 2049 // r is in the coordinate space of the layer's render object | 2003 // r is in the coordinate space of the layer's render object |
| 2050 void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P
aintInvalidationReason invalidationReason) | 2004 void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P
aintInvalidationReason invalidationReason) |
| 2051 { | 2005 { |
| 2052 // FIXME: need to split out paint invalidations for the background. | 2006 // FIXME: need to split out paint invalidations for the background. |
| 2053 ASSERT(!paintsIntoCompositedAncestor()); | |
| 2054 | |
| 2055 SetContentsNeedsDisplayInRectFunctor functor = { | 2007 SetContentsNeedsDisplayInRectFunctor functor = { |
| 2056 pixelSnappedIntRect(r.location() + m_owningLayer.subpixelAccumulation(),
r.size()), | 2008 pixelSnappedIntRect(r.location() + m_owningLayer.subpixelAccumulation(),
r.size()), |
| 2057 invalidationReason | 2009 invalidationReason |
| 2058 }; | 2010 }; |
| 2059 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); | 2011 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); |
| 2060 } | 2012 } |
| 2061 | 2013 |
| 2062 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co
nst RenderObject* renderObject, const Vector<GraphicsLayerPaintInfo>& layers, un
signed maxSquashedLayerIndex) | 2014 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co
nst RenderObject* renderObject, const Vector<GraphicsLayerPaintInfo>& layers, un
signed maxSquashedLayerIndex) |
| 2063 { | 2015 { |
| 2064 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { | 2016 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2092 | 2044 |
| 2093 // Convert from ancestor to local coordinates. | 2045 // Convert from ancestor to local coordinates. |
| 2094 IntSize ancestorToLocalOffset = paintInfo.offsetFromRenderer - ancestorPaint
Info->offsetFromRenderer; | 2046 IntSize ancestorToLocalOffset = paintInfo.offsetFromRenderer - ancestorPaint
Info->offsetFromRenderer; |
| 2095 parentClipRect.move(ancestorToLocalOffset); | 2047 parentClipRect.move(ancestorToLocalOffset); |
| 2096 return parentClipRect; | 2048 return parentClipRect; |
| 2097 } | 2049 } |
| 2098 | 2050 |
| 2099 void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo
, const PaintLayerFlags& paintLayerFlags, GraphicsContext* context, | 2051 void CompositedLayerMapping::doPaintTask(const GraphicsLayerPaintInfo& paintInfo
, const PaintLayerFlags& paintLayerFlags, GraphicsContext* context, |
| 2100 const IntRect& clip) // In the coords of rootLayer. | 2052 const IntRect& clip) // In the coords of rootLayer. |
| 2101 { | 2053 { |
| 2102 RELEASE_ASSERT(paintInfo.renderLayer->compositingState() == PaintsIntoGroupe
dBacking || !paintsIntoCompositedAncestor()); | |
| 2103 | |
| 2104 FontCachePurgePreventer fontCachePurgePreventer; | 2054 FontCachePurgePreventer fontCachePurgePreventer; |
| 2105 | 2055 |
| 2106 // Note carefully: in theory it is appropriate to invoke context->save() her
e | 2056 // Note carefully: in theory it is appropriate to invoke context->save() her
e |
| 2107 // and restore the context after painting. For efficiency, we are assuming t
hat | 2057 // and restore the context after painting. For efficiency, we are assuming t
hat |
| 2108 // it is equivalent to manually undo this offset translation, which means we
are | 2058 // it is equivalent to manually undo this offset translation, which means we
are |
| 2109 // assuming that the context's space was not affected by the RenderLayer | 2059 // assuming that the context's space was not affected by the RenderLayer |
| 2110 // painting code. | 2060 // painting code. |
| 2111 | 2061 |
| 2112 IntSize offset = paintInfo.offsetFromRenderer; | 2062 IntSize offset = paintInfo.offsetFromRenderer; |
| 2113 context->translate(-offset.width(), -offset.height()); | 2063 context->translate(-offset.width(), -offset.height()); |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2324 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2375 name = "Scrolling Block Selection Layer"; | 2325 name = "Scrolling Block Selection Layer"; |
| 2376 } else { | 2326 } else { |
| 2377 ASSERT_NOT_REACHED(); | 2327 ASSERT_NOT_REACHED(); |
| 2378 } | 2328 } |
| 2379 | 2329 |
| 2380 return name; | 2330 return name; |
| 2381 } | 2331 } |
| 2382 | 2332 |
| 2383 } // namespace blink | 2333 } // namespace blink |
| OLD | NEW |