Chromium Code Reviews| 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 2238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2249 if (newInterestRect.y() == 0 && previousInterestRect.y() != 0) | 2249 if (newInterestRect.y() == 0 && previousInterestRect.y() != 0) |
| 2250 return true; | 2250 return true; |
| 2251 if (newInterestRect.maxX() == layerSize.width() && previousInterestRect.maxX () != layerSize.width()) | 2251 if (newInterestRect.maxX() == layerSize.width() && previousInterestRect.maxX () != layerSize.width()) |
| 2252 return true; | 2252 return true; |
| 2253 if (newInterestRect.maxY() == layerSize.height() && previousInterestRect.max Y() != layerSize.height()) | 2253 if (newInterestRect.maxY() == layerSize.height() && previousInterestRect.max Y() != layerSize.height()) |
| 2254 return true; | 2254 return true; |
| 2255 | 2255 |
| 2256 return false; | 2256 return false; |
| 2257 } | 2257 } |
| 2258 | 2258 |
| 2259 void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G raphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhase, const IntRect* interestRect) const | 2259 IntRect CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer , GraphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintingPhas e, const IntRect* interestRect) const |
| 2260 { | 2260 { |
| 2261 IntRect defaultInterestRect; | 2261 IntRect defaultInterestRect; |
| 2262 IntRect previousInterestRect = graphicsLayer->previousInterestRect(); | |
| 2262 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { | 2263 if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) { |
| 2263 if (!interestRect) { | 2264 if (!interestRect) { |
| 2264 if (graphicsLayer == m_graphicsLayer || graphicsLayer == m_squashing Layer) | 2265 if (graphicsLayer == m_graphicsLayer || graphicsLayer == m_squashing Layer) |
| 2265 defaultInterestRect = computeInterestRect(graphicsLayer, m_ownin gLayer.layoutObject()); | 2266 defaultInterestRect = computeInterestRect(graphicsLayer, m_ownin gLayer.layoutObject()); |
| 2266 else | 2267 else |
| 2267 defaultInterestRect = enclosingIntRect(FloatRect(FloatPoint(), g raphicsLayer->size())); | 2268 defaultInterestRect = enclosingIntRect(FloatRect(FloatPoint(), g raphicsLayer->size())); |
| 2268 interestRect = &defaultInterestRect; | 2269 |
| 2270 if (interestRectChangedEnoughToRepaint(previousInterestRect, default InterestRect, expandedIntSize(graphicsLayer->size()))) | |
| 2271 interestRect = &defaultInterestRect; | |
| 2272 else | |
| 2273 interestRect = &previousInterestRect; | |
| 2274 } else if (*interestRect != previousInterestRect) { | |
| 2275 WTFLogAlways("Requested interest rect (%d,%d,%d,%d) is different fro m previous painted interest rect (%d,%d,%d,%d).", | |
| 2276 interestRect->x(), interestRect->y(), interestRect->width(), int erestRect->height(), | |
| 2277 previousInterestRect.x(), previousInterestRect.y(), previousInte restRect.width(), previousInterestRect.height()); | |
|
Xianzhu
2015/11/14 00:36:17
The message indicates that there is performance pe
| |
| 2269 } | 2278 } |
| 2270 | 2279 |
| 2271 if (!m_owningLayer.needsRepaint() | 2280 if (!m_owningLayer.needsRepaint() |
| 2272 && !context.paintController().cacheIsEmpty() | 2281 && !context.paintController().cacheIsEmpty() |
| 2273 && !interestRectChangedEnoughToRepaint(m_previousPaintInterestRect, *interestRect, expandedIntSize(graphicsLayer->size()))) { | 2282 && previousInterestRect == *interestRect) { |
| 2274 context.paintController().createAndAppend<CachedDisplayItem>(*this, DisplayItem::CachedDisplayItemList); | 2283 context.paintController().createAndAppend<CachedDisplayItem>(*this, DisplayItem::CachedDisplayItemList); |
| 2275 return; | 2284 return previousInterestRect; |
| 2276 } | 2285 } |
| 2277 | |
| 2278 m_previousPaintInterestRect = *interestRect; | |
| 2279 } | 2286 } |
| 2280 | 2287 |
| 2281 ASSERT(interestRect); | 2288 ASSERT(interestRect); |
| 2282 paintContentsInternal(graphicsLayer, context, graphicsLayerPaintingPhase, *i nterestRect); | 2289 paintContentsInternal(graphicsLayer, context, graphicsLayerPaintingPhase, *i nterestRect); |
| 2290 | |
| 2291 return *interestRect; | |
| 2283 } | 2292 } |
| 2284 | 2293 |
| 2285 void CompositedLayerMapping::paintContentsInternal(const GraphicsLayer* graphics Layer, GraphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintin gPhase, const IntRect& interestRect) const | 2294 void CompositedLayerMapping::paintContentsInternal(const GraphicsLayer* graphics Layer, GraphicsContext& context, GraphicsLayerPaintingPhase graphicsLayerPaintin gPhase, const IntRect& interestRect) const |
| 2286 { | 2295 { |
| 2287 // https://code.google.com/p/chromium/issues/detail?id=343772 | 2296 // https://code.google.com/p/chromium/issues/detail?id=343772 |
| 2288 DisableCompositingQueryAsserts disabler; | 2297 DisableCompositingQueryAsserts disabler; |
| 2289 #if ENABLE(ASSERT) | 2298 #if ENABLE(ASSERT) |
| 2290 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead. | 2299 // FIXME: once the state machine is ready, this can be removed and we can re fer to that instead. |
| 2291 if (Page* page = layoutObject()->frame()->page()) | 2300 if (Page* page = layoutObject()->frame()->page()) |
| 2292 page->setIsPainting(true); | 2301 page->setIsPainting(true); |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2521 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2530 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
| 2522 name = "Scrolling Block Selection Layer"; | 2531 name = "Scrolling Block Selection Layer"; |
| 2523 } else { | 2532 } else { |
| 2524 ASSERT_NOT_REACHED(); | 2533 ASSERT_NOT_REACHED(); |
| 2525 } | 2534 } |
| 2526 | 2535 |
| 2527 return name; | 2536 return name; |
| 2528 } | 2537 } |
| 2529 | 2538 |
| 2530 } // namespace blink | 2539 } // namespace blink |
| OLD | NEW |