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

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

Issue 1497873002: Make DisplayItemClient an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 5 years 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 2078 matching lines...) Expand 10 before | Expand all | Expand 10 after
2089 void operator() (GraphicsLayer* layer) const 2089 void operator() (GraphicsLayer* layer) const
2090 { 2090 {
2091 IntRect visualRectOnLayer; 2091 IntRect visualRectOnLayer;
2092 if (visualRect) { 2092 if (visualRect) {
2093 visualRectOnLayer = enclosingIntRect(LayoutRect(visualRect->location () + subpixelAccumulation, visualRect->size())); 2093 visualRectOnLayer = enclosingIntRect(LayoutRect(visualRect->location () + subpixelAccumulation, visualRect->size()));
2094 visualRectOnLayer.move(-layer->offsetFromLayoutObject()); 2094 visualRectOnLayer.move(-layer->offsetFromLayoutObject());
2095 } 2095 }
2096 layer->invalidateDisplayItemClient(displayItemClient, invalidationReason , visualRect ? &visualRectOnLayer : nullptr); 2096 layer->invalidateDisplayItemClient(displayItemClient, invalidationReason , visualRect ? &visualRectOnLayer : nullptr);
2097 } 2097 }
2098 2098
2099 const DisplayItemClientWrapper& displayItemClient; 2099 const DisplayItemClient& displayItemClient;
2100 PaintInvalidationReason invalidationReason; 2100 PaintInvalidationReason invalidationReason;
2101 const LayoutRect* visualRect; 2101 const LayoutRect* visualRect;
2102 LayoutSize subpixelAccumulation; 2102 LayoutSize subpixelAccumulation;
2103 }; 2103 };
2104 2104
2105 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient Wrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, con st LayoutRect* visualRect) 2105 void CompositedLayerMapping::invalidateDisplayItemClient(const DisplayItemClient & displayItemClient, PaintInvalidationReason paintInvalidationReason, const Layo utRect* visualRect)
2106 { 2106 {
2107 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval idationReason, visualRect, m_owningLayer.subpixelAccumulation() }; 2107 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval idationReason, visualRect, m_owningLayer.subpixelAccumulation() };
2108 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers); 2108 ApplyToGraphicsLayers(this, functor, ApplyToContentLayers);
2109 } 2109 }
2110 2110
2111 void CompositedLayerMapping::invalidateDisplayItemClientOnScrollingContentsLayer (const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason pain tInvalidationReason, const LayoutRect* visualRect) 2111 void CompositedLayerMapping::invalidateDisplayItemClientOnScrollingContentsLayer (const DisplayItemClient& displayItemClient, PaintInvalidationReason paintInvali dationReason, const LayoutRect* visualRect)
2112 { 2112 {
2113 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval idationReason, visualRect, m_owningLayer.subpixelAccumulation() }; 2113 InvalidateDisplayItemClientFunctor functor = { displayItemClient, paintInval idationReason, visualRect, m_owningLayer.subpixelAccumulation() };
2114 ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentsLayer); 2114 ApplyToGraphicsLayers(this, functor, ApplyToScrollingContentsLayer);
2115 } 2115 }
2116 2116
2117 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co nst LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, un signed maxSquashedLayerIndex) 2117 const GraphicsLayerPaintInfo* CompositedLayerMapping::containingSquashedLayer(co nst LayoutObject* layoutObject, const Vector<GraphicsLayerPaintInfo>& layers, un signed maxSquashedLayerIndex)
2118 { 2118 {
2119 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) { 2119 for (size_t i = 0; i < layers.size() && i < maxSquashedLayerIndex; ++i) {
2120 if (layoutObject->isDescendantOf(layers[i].paintLayer->layoutObject())) 2120 if (layoutObject->isDescendantOf(layers[i].paintLayer->layoutObject()))
2121 return &layers[i]; 2121 return &layers[i];
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
2565 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2565 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2566 name = "Scrolling Block Selection Layer"; 2566 name = "Scrolling Block Selection Layer";
2567 } else { 2567 } else {
2568 ASSERT_NOT_REACHED(); 2568 ASSERT_NOT_REACHED();
2569 } 2569 }
2570 2570
2571 return name; 2571 return name;
2572 } 2572 }
2573 2573
2574 } // namespace blink 2574 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698