| 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 2035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 // FIXME: need to split out paint invalidations for the background. | 2046 // FIXME: need to split out paint invalidations for the background. |
| 2047 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToContent
Layers); | 2047 ApplyToGraphicsLayers(this, SetContentsNeedsDisplayFunctor(), ApplyToContent
Layers); |
| 2048 } | 2048 } |
| 2049 | 2049 |
| 2050 struct SetContentsNeedsDisplayInRectFunctor { | 2050 struct SetContentsNeedsDisplayInRectFunctor { |
| 2051 void operator() (GraphicsLayer* layer) const | 2051 void operator() (GraphicsLayer* layer) const |
| 2052 { | 2052 { |
| 2053 if (layer->drawsContent()) { | 2053 if (layer->drawsContent()) { |
| 2054 IntRect layerDirtyRect = r; | 2054 IntRect layerDirtyRect = r; |
| 2055 layerDirtyRect.move(-layer->offsetFromLayoutObject()); | 2055 layerDirtyRect.move(-layer->offsetFromLayoutObject()); |
| 2056 layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason); | 2056 layer->setNeedsDisplayInRect(layerDirtyRect, invalidationReason, cli
ent); |
| 2057 } | 2057 } |
| 2058 } | 2058 } |
| 2059 | 2059 |
| 2060 IntRect r; | 2060 IntRect r; |
| 2061 PaintInvalidationReason invalidationReason; | 2061 PaintInvalidationReason invalidationReason; |
| 2062 const DisplayItemClient& client; |
| 2062 }; | 2063 }; |
| 2063 | 2064 |
| 2064 // r is in the coordinate space of the layer's layout object | 2065 // r is in the coordinate space of the layer's layout object |
| 2065 void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P
aintInvalidationReason invalidationReason) | 2066 void CompositedLayerMapping::setContentsNeedDisplayInRect(const LayoutRect& r, P
aintInvalidationReason invalidationReason, const DisplayItemClient& client) |
| 2066 { | 2067 { |
| 2067 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. | 2068 // TODO(wangxianzhu): Enable the following assert after paint invalidation f
or spv2 is ready. |
| 2068 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); | 2069 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); |
| 2069 | 2070 |
| 2070 SetContentsNeedsDisplayInRectFunctor functor = { | 2071 SetContentsNeedsDisplayInRectFunctor functor = { |
| 2071 enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumul
ation(), r.size())), | 2072 enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumul
ation(), r.size())), |
| 2072 invalidationReason | 2073 invalidationReason, |
| 2074 client |
| 2073 }; | 2075 }; |
| 2074 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); | 2076 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); |
| 2075 } | 2077 } |
| 2076 | 2078 |
| 2077 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient
& displayItemClient, PaintInvalidationReason paintInvalidationReason) | 2079 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient
& displayItemClient, PaintInvalidationReason paintInvalidationReason) |
| 2078 { | 2080 { |
| 2079 ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason](Gr
aphicsLayer* layer) { | 2081 ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason](Gr
aphicsLayer* layer) { |
| 2080 layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationR
eason); | 2082 layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationR
eason); |
| 2081 }, ApplyToContentLayers); | 2083 }, ApplyToContentLayers); |
| 2082 } | 2084 } |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2570 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2572 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2571 name = "Scrolling Contents Layer"; | 2573 name = "Scrolling Contents Layer"; |
| 2572 } else { | 2574 } else { |
| 2573 ASSERT_NOT_REACHED(); | 2575 ASSERT_NOT_REACHED(); |
| 2574 } | 2576 } |
| 2575 | 2577 |
| 2576 return name; | 2578 return name; |
| 2577 } | 2579 } |
| 2578 | 2580 |
| 2579 } // namespace blink | 2581 } // namespace blink |
| OLD | NEW |