OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "platform/graphics/paint/PaintController.h" | 5 #include "platform/graphics/paint/PaintController.h" |
6 | 6 |
7 #include "platform/TraceEvent.h" | 7 #include "platform/TraceEvent.h" |
8 #include "platform/graphics/GraphicsLayer.h" | 8 #include "platform/graphics/GraphicsLayer.h" |
9 #include "platform/graphics/paint/DrawingDisplayItem.h" | 9 #include "platform/graphics/paint/DrawingDisplayItem.h" |
10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" | 10 #include "third_party/skia/include/core/SkPictureAnalyzer.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
225 } | 225 } |
226 | 226 |
227 void PaintController::copyCachedSubsequence(const DisplayItemList& currentList, DisplayItemList::iterator& currentIt, DisplayItemList& updatedList, SkPictureGpu Analyzer& gpuAnalyzer) | 227 void PaintController::copyCachedSubsequence(const DisplayItemList& currentList, DisplayItemList::iterator& currentIt, DisplayItemList& updatedList, SkPictureGpu Analyzer& gpuAnalyzer) |
228 { | 228 { |
229 DCHECK(currentIt->getType() == DisplayItem::Subsequence); | 229 DCHECK(currentIt->getType() == DisplayItem::Subsequence); |
230 DisplayItem::Id endSubsequenceId(currentIt->client(), DisplayItem::EndSubseq uence); | 230 DisplayItem::Id endSubsequenceId(currentIt->client(), DisplayItem::EndSubseq uence); |
231 do { | 231 do { |
232 // We should always find the EndSubsequence display item. | 232 // We should always find the EndSubsequence display item. |
233 DCHECK(currentIt != m_currentPaintArtifact.getDisplayItemList().end()); | 233 DCHECK(currentIt != m_currentPaintArtifact.getDisplayItemList().end()); |
234 DCHECK(currentIt->hasValidClient()); | 234 DCHECK(currentIt->hasValidClient()); |
235 #if CHECK_DISPLAY_ITEM_CLIENT_ALIVENESS | 235 CHECK(clientCacheIsValid(currentIt->client()) || !currentIt->isCacheable ()); |
chrishtr
2016/06/18 22:13:54
DCHECK instead?
Xianzhu
2016/06/18 23:51:25
Used CHECK because I want this for DisplayItemClie
| |
236 CHECK(currentIt->client().isAlive()); | |
237 #endif | |
238 updatedList.appendByMoving(*currentIt, currentList.visualRect(currentIt - m_currentPaintArtifact.getDisplayItemList().begin()), gpuAnalyzer); | 236 updatedList.appendByMoving(*currentIt, currentList.visualRect(currentIt - m_currentPaintArtifact.getDisplayItemList().begin()), gpuAnalyzer); |
239 ++currentIt; | 237 ++currentIt; |
240 } while (!endSubsequenceId.matches(updatedList.last())); | 238 } while (!endSubsequenceId.matches(updatedList.last())); |
241 } | 239 } |
242 | 240 |
243 static IntRect visualRectForDisplayItem(const DisplayItem& displayItem, const La youtSize& offsetFromLayoutObject) | 241 static IntRect visualRectForDisplayItem(const DisplayItem& displayItem, const La youtSize& offsetFromLayoutObject) |
244 { | 242 { |
245 LayoutRect visualRect = displayItem.client().visualRect(); | 243 LayoutRect visualRect = displayItem.client().visualRect(); |
246 visualRect.move(-offsetFromLayoutObject); | 244 visualRect.move(-offsetFromLayoutObject); |
247 return enclosingIntRect(visualRect); | 245 return enclosingIntRect(visualRect); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
306 DisplayItemList::iterator currentIt = m_currentPaintArtifact.getDisplayItemL ist().begin(); | 304 DisplayItemList::iterator currentIt = m_currentPaintArtifact.getDisplayItemL ist().begin(); |
307 DisplayItemList::iterator currentEnd = m_currentPaintArtifact.getDisplayItem List().end(); | 305 DisplayItemList::iterator currentEnd = m_currentPaintArtifact.getDisplayItem List().end(); |
308 for (DisplayItemList::iterator newIt = m_newDisplayItemList.begin(); newIt ! = m_newDisplayItemList.end(); ++newIt) { | 306 for (DisplayItemList::iterator newIt = m_newDisplayItemList.begin(); newIt ! = m_newDisplayItemList.end(); ++newIt) { |
309 const DisplayItem& newDisplayItem = *newIt; | 307 const DisplayItem& newDisplayItem = *newIt; |
310 const DisplayItem::Id newDisplayItemId = newDisplayItem.nonCachedId(); | 308 const DisplayItem::Id newDisplayItemId = newDisplayItem.nonCachedId(); |
311 bool newDisplayItemHasCachedType = newDisplayItem.getType() != newDispla yItemId.type; | 309 bool newDisplayItemHasCachedType = newDisplayItem.getType() != newDispla yItemId.type; |
312 | 310 |
313 bool isSynchronized = currentIt != currentEnd && newDisplayItemId.matche s(*currentIt); | 311 bool isSynchronized = currentIt != currentEnd && newDisplayItemId.matche s(*currentIt); |
314 | 312 |
315 if (newDisplayItemHasCachedType) { | 313 if (newDisplayItemHasCachedType) { |
316 #if DCHECK_IS_ON() | |
317 DCHECK(newDisplayItem.isCached()); | 314 DCHECK(newDisplayItem.isCached()); |
318 DCHECK(clientCacheIsValid(newDisplayItem.client()) || (RuntimeEnable dFeatures::slimmingPaintInvalidationEnabled() && !paintOffsetWasInvalidated(newD isplayItem.client()))); | 315 CHECK(clientCacheIsValid(newDisplayItem.client())); |
chrishtr
2016/06/18 22:13:54
Why is this now irrelevant?
Xianzhu
2016/06/18 23:51:25
The removed code is for paint offset caching code
|
chrishtr
2016/06/18 22:13:54
DCHECK?
Xianzhu
2016/06/18 23:51:25
Ditto.
|
319 #endif | |
320 if (!isSynchronized) { | 316 if (!isSynchronized) { |
321 currentIt = findOutOfOrderCachedItem(newDisplayItemId, outOfOrde rIndexContext); | 317 currentIt = findOutOfOrderCachedItem(newDisplayItemId, outOfOrde rIndexContext); |
322 | 318 |
323 if (currentIt == currentEnd) { | 319 if (currentIt == currentEnd) { |
324 #ifndef NDEBUG | 320 #ifndef NDEBUG |
325 showDebugData(); | 321 showDebugData(); |
326 WTFLogAlways("%s not found in m_currentDisplayItemList\n", n ewDisplayItem.asDebugString().utf8().data()); | 322 WTFLogAlways("%s not found in m_currentDisplayItemList\n", n ewDisplayItem.asDebugString().utf8().data()); |
327 #endif | 323 #endif |
328 NOTREACHED(); | 324 NOTREACHED(); |
329 // We did not find the cached display item. This should be i mpossible, but may occur if there is a bug | 325 // We did not find the cached display item. This should be i mpossible, but may occur if there is a bug |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 | 527 |
532 void PaintController::showDebugData() const | 528 void PaintController::showDebugData() const |
533 { | 529 { |
534 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); | 530 WTFLogAlways("current display item list: [%s]\n", displayItemListAsDebugStri ng(m_currentPaintArtifact.getDisplayItemList()).utf8().data()); |
535 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); | 531 WTFLogAlways("new display item list: [%s]\n", displayItemListAsDebugString(m _newDisplayItemList).utf8().data()); |
536 } | 532 } |
537 | 533 |
538 #endif // ifndef NDEBUG | 534 #endif // ifndef NDEBUG |
539 | 535 |
540 } // namespace blink | 536 } // namespace blink |
OLD | NEW |