| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/DisplayItemList.h" | 5 #include "platform/graphics/paint/DisplayItemList.h" |
| 6 | 6 |
| 7 #include "platform/graphics/paint/DrawingDisplayItem.h" | 7 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 8 #include "platform/graphics/paint/PaintChunk.h" | 8 #include "platform/graphics/paint/PaintChunk.h" |
| 9 #include "third_party/skia/include/core/SkPictureAnalyzer.h" | 9 #include "third_party/skia/include/core/SkPictureAnalyzer.h" |
| 10 | 10 |
| 11 #ifndef NDEBUG | 11 #ifndef NDEBUG |
| 12 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 DisplayItem& DisplayItemList::appendByMoving(DisplayItem& item, const IntRect& v
isualRect, SkPictureGpuAnalyzer& gpuAnalyzer) | 17 DisplayItem& DisplayItemList::appendByMoving(DisplayItem& item, const IntRect& v
isualRect, SkPictureGpuAnalyzer& gpuAnalyzer) |
| 18 { | 18 { |
| 19 // No reason to continue the analysis once we have a veto. | 19 // No reason to continue the analysis once we have a veto. |
| 20 if (gpuAnalyzer.suitableForGpuRasterization()) | 20 if (gpuAnalyzer.suitableForGpuRasterization()) |
| 21 item.analyzeForGpuRasterization(gpuAnalyzer); | 21 item.analyzeForGpuRasterization(gpuAnalyzer); |
| 22 | 22 |
| 23 #ifndef NDEBUG | 23 #ifndef NDEBUG |
| 24 String originalDebugString = item.asDebugString(); | 24 String originalDebugString = item.asDebugString(); |
| 25 #endif | 25 #endif |
| 26 ASSERT(item.hasValidClient()); | 26 ASSERT(item.hasValidClient()); |
| 27 DisplayItem& result = ContiguousContainer::appendByMoving(item, item.derived
Size()); | 27 DisplayItem& result = ContiguousContainer::appendByMoving(item, item.derived
Size(), item.derivedLog2Alignment()); |
| 28 // ContiguousContainer::appendByMoving() calls an in-place constructor | 28 // ContiguousContainer::appendByMoving() calls an in-place constructor |
| 29 // on item which replaces it with a tombstone/"dead display item" that | 29 // on item which replaces it with a tombstone/"dead display item" that |
| 30 // can be safely destructed but should never be used. | 30 // can be safely destructed but should never be used. |
| 31 ASSERT(!item.hasValidClient()); | 31 ASSERT(!item.hasValidClient()); |
| 32 #ifndef NDEBUG | 32 #ifndef NDEBUG |
| 33 // Save original debug string in the old item to help debugging. | 33 // Save original debug string in the old item to help debugging. |
| 34 item.setClientDebugString(originalDebugString); | 34 item.setClientDebugString(originalDebugString); |
| 35 #endif | 35 #endif |
| 36 appendVisualRect(visualRect); | 36 appendVisualRect(visualRect); |
| 37 return result; | 37 return result; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 return Range<iterator>(begin() + paintChunk.beginIndex, begin() + paintChunk
.endIndex); | 77 return Range<iterator>(begin() + paintChunk.beginIndex, begin() + paintChunk
.endIndex); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DisplayItemList::Range<DisplayItemList::const_iterator> | 80 DisplayItemList::Range<DisplayItemList::const_iterator> |
| 81 DisplayItemList::itemsInPaintChunk(const PaintChunk& paintChunk) const | 81 DisplayItemList::itemsInPaintChunk(const PaintChunk& paintChunk) const |
| 82 { | 82 { |
| 83 return Range<const_iterator>(begin() + paintChunk.beginIndex, begin() + pain
tChunk.endIndex); | 83 return Range<const_iterator>(begin() + paintChunk.beginIndex, begin() + pain
tChunk.endIndex); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace blink | 86 } // namespace blink |
| OLD | NEW |