| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/paint/PaintArtifact.h" | 6 #include "platform/graphics/paint/PaintArtifact.h" |
| 7 | 7 |
| 8 #include "platform/TraceEvent.h" | 8 #include "platform/TraceEvent.h" |
| 9 #include "platform/geometry/IntRect.h" | 9 #include "platform/geometry/IntRect.h" |
| 10 | 10 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 + m_paintChunks.capacity() * sizeof(m_paintChunks[0]); | 31 + m_paintChunks.capacity() * sizeof(m_paintChunks[0]); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void PaintArtifact::replay(GraphicsContext& graphicsContext) const | 34 void PaintArtifact::replay(GraphicsContext& graphicsContext) const |
| 35 { | 35 { |
| 36 TRACE_EVENT0("blink,benchmark", "PaintArtifact::replay"); | 36 TRACE_EVENT0("blink,benchmark", "PaintArtifact::replay"); |
| 37 for (const DisplayItem& displayItem : m_displayItemList) | 37 for (const DisplayItem& displayItem : m_displayItemList) |
| 38 displayItem.replay(graphicsContext); | 38 displayItem.replay(graphicsContext); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void PaintArtifact::appendToWebDisplayItemList(WebDisplayItemList* list) const | 41 void PaintArtifact::appendToWebDisplayItemList(const DisplayItemRectMap& itemRec
ts, WebDisplayItemList* list) const |
| 42 { | 42 { |
| 43 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList")
; | 43 TRACE_EVENT0("blink,benchmark", "PaintArtifact::appendToWebDisplayItemList")
; |
| 44 for (const DisplayItem& displayItem : m_displayItemList) { | 44 for (const auto& displayItem : m_displayItemList) { |
| 45 // TODO(wkorman): Pass the actual visual rect for the display item. | 45 if (itemRects.contains(displayItem.client())) { |
| 46 displayItem.appendToWebDisplayItemList(IntRect(), list); | 46 IntRect visualRect = itemRects.get(displayItem.client()); |
| 47 // fprintf(stderr, "Got visual rect [rect=(%d, %d, %d, %d), item=%s]
.\n", |
| 48 // visualRect.x(), visualRect.y(), visualRect.width(), visualRec
t.height(), |
| 49 // displayItem.asDebugString().ascii().data()); |
| 50 displayItem.appendToWebDisplayItemList(visualRect, list); |
| 51 } else { |
| 52 // fprintf(stderr, "Missing visual rect [item=%s].\n", displayItem.a
sDebugString().ascii().data()); |
| 53 displayItem.appendToWebDisplayItemList(IntRect(), list); |
| 54 } |
| 47 } | 55 } |
| 48 } | 56 } |
| 49 | 57 |
| 50 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |