| 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 "config.h" | 5 #include "config.h" |
| 6 #include "platform/graphics/paint/DrawingDisplayItem.h" | 6 #include "platform/graphics/paint/DrawingDisplayItem.h" |
| 7 | 7 |
| 8 #include "platform/graphics/GraphicsContext.h" | 8 #include "platform/graphics/GraphicsContext.h" |
| 9 #include "public/platform/WebDisplayItemList.h" | 9 #include "public/platform/WebDisplayItemList.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 void DrawingDisplayItem::replay(GraphicsContext* context) | 13 void DrawingDisplayItem::replay(GraphicsContext* context) |
| 14 { | 14 { |
| 15 context->drawPicture(m_picture.get()); | 15 context->drawPicture(m_picture.get()); |
| 16 } | 16 } |
| 17 | 17 |
| 18 void DrawingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) co
nst | 18 void DrawingDisplayItem::appendToWebDisplayItemList(WebDisplayItemList* list) co
nst |
| 19 { | 19 { |
| 20 list->appendDrawingItem(m_picture.get()); | 20 list->appendDrawingItem(m_picture.get()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 bool DrawingDisplayItem::drawsContent() const |
| 24 { |
| 25 return m_picture->approximateOpCount() > 0; |
| 26 } |
| 27 |
| 23 #ifndef NDEBUG | 28 #ifndef NDEBUG |
| 24 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB
uilder) const | 29 void DrawingDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& stringB
uilder) const |
| 25 { | 30 { |
| 26 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 31 DisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
| 27 stringBuilder.append(WTF::String::format(", rect: [%f,%f,%f,%f]", | 32 stringBuilder.append(WTF::String::format(", rect: [%f,%f,%f,%f]", |
| 28 m_picture->cullRect().x(), m_picture->cullRect().y(), | 33 m_picture->cullRect().x(), m_picture->cullRect().y(), |
| 29 m_picture->cullRect().width(), m_picture->cullRect().height())); | 34 m_picture->cullRect().width(), m_picture->cullRect().height())); |
| 30 } | 35 } |
| 31 #endif | 36 #endif |
| 32 | 37 |
| 33 } | 38 } |
| OLD | NEW |