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 if (item.isDrawing()) | 19 // No reason to continue the analysis once we have a veto. |
20 gpuAnalyzer.analyze(static_cast<const DrawingDisplayItem&>(item).picture
()); | 20 if (gpuAnalyzer.suitableForGpuRasterization()) |
| 21 item.analyzeForGpuRasterization(gpuAnalyzer); |
21 | 22 |
22 #ifndef NDEBUG | 23 #ifndef NDEBUG |
23 String originalDebugString = item.asDebugString(); | 24 String originalDebugString = item.asDebugString(); |
24 #endif | 25 #endif |
25 ASSERT(item.hasValidClient()); | 26 ASSERT(item.hasValidClient()); |
26 DisplayItem& result = ContiguousContainer::appendByMoving(item, item.derived
Size()); | 27 DisplayItem& result = ContiguousContainer::appendByMoving(item, item.derived
Size()); |
27 // ContiguousContainer::appendByMoving() calls an in-place constructor | 28 // ContiguousContainer::appendByMoving() calls an in-place constructor |
28 // 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 |
29 // can be safely destructed but should never be used. | 30 // can be safely destructed but should never be used. |
30 ASSERT(!item.hasValidClient()); | 31 ASSERT(!item.hasValidClient()); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 return Range<iterator>(begin() + paintChunk.beginIndex, begin() + paintChunk
.endIndex); | 77 return Range<iterator>(begin() + paintChunk.beginIndex, begin() + paintChunk
.endIndex); |
77 } | 78 } |
78 | 79 |
79 DisplayItemList::Range<DisplayItemList::const_iterator> | 80 DisplayItemList::Range<DisplayItemList::const_iterator> |
80 DisplayItemList::itemsInPaintChunk(const PaintChunk& paintChunk) const | 81 DisplayItemList::itemsInPaintChunk(const PaintChunk& paintChunk) const |
81 { | 82 { |
82 return Range<const_iterator>(begin() + paintChunk.beginIndex, begin() + pain
tChunk.endIndex); | 83 return Range<const_iterator>(begin() + paintChunk.beginIndex, begin() + pain
tChunk.endIndex); |
83 } | 84 } |
84 | 85 |
85 } // namespace blink | 86 } // namespace blink |
OLD | NEW |