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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 1588543004: Remove paintInvalidationRect from display item client invalidation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
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 2101 matching lines...) Expand 10 before | Expand all | Expand 10 after
2112 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready. 2112 // TODO(wangxianzhu): Enable the following assert after paint invalidation f or spv2 is ready.
2113 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled()); 2113 // ASSERT(!RuntimeEnabledFeatures::slimmingPaintV2Enabled());
2114 2114
2115 SetContentsNeedsDisplayInRectFunctor functor = { 2115 SetContentsNeedsDisplayInRectFunctor functor = {
2116 enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumul ation(), r.size())), 2116 enclosingIntRect(LayoutRect(r.location() + m_owningLayer.subpixelAccumul ation(), r.size())),
2117 invalidationReason 2117 invalidationReason
2118 }; 2118 };
2119 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); 2119 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
2120 } 2120 }
2121 2121
2122 struct InvalidateDisplayItemClientFunctor { 2122 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient & displayItemClient, PaintInvalidationReason paintInvalidationReason)
2123 void operator() (GraphicsLayer* layer) const
2124 {
2125 IntRect visualRectOnLayer;
2126 if (visualRect) {
2127 visualRectOnLayer = enclosingIntRect(LayoutRect(visualRect->location () + subpixelAccumulation, visualRect->size()));
2128 visualRectOnLayer.move(-layer->offsetFromLayoutObject());
2129 }
2130 layer->invalidateDisplayItemClient(displayItemClient, invalidationReason , visualRect ? &visualRectOnLayer : nullptr);
2131 }
2132
2133 const DisplayItemClient& displayItemClient;
2134 PaintInvalidationReason invalidationReason;
2135 const LayoutRect* visualRect;
2136 LayoutSize subpixelAccumulation;
2137 };
2138
2139 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient & displayItemClient, PaintInvalidationReason paintInvalidationReason, const Layo utRect* visualRect)
2140 { 2123 {
2141 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval idationReason, visualRect, m_owningLayer.subpixelAccumulation() }; 2124 ApplyToGraphicsLayers(this, [&displayItemClient, paintInvalidationReason](Gr aphicsLayer* layer) {
2142 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); 2125 layer->invalidateDisplayItemClient(displayItemClient, paintInvalidationR eason);
2126 }, ApplyToContentLayers);
2143 } 2127 }
2144 2128
2145 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co nst LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, un signed maxSquashedLayerIndex) 2129 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co nst LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, un signed maxSquashedLayerIndex)
2146 { 2130 {
2147 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { 2131 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) {
2148 if (layoutObject->isDescendantOf(layers[i].paintLayer->layoutObject())) 2132 if (layoutObject->isDescendantOf(layers[i].paintLayer->layoutObject()))
2149 return &layers[i]; 2133 return &layers[i];
2150 } 2134 }
2151 return nullptr; 2135 return nullptr;
2152 } 2136 }
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
2598 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2582 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2599 name = "Scrolling Block Selection Layer"; 2583 name = "Scrolling Block Selection Layer";
2600 } else { 2584 } else {
2601 ASSERT_NOT_REACHED(); 2585 ASSERT_NOT_REACHED();
2602 } 2586 }
2603 2587
2604 return name; 2588 return name;
2605 } 2589 }
2606 2590
2607 } // namespace blink 2591 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698