| 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/ScrollDisplayItem.h" | 5 #include "platform/graphics/paint/ScrollDisplayItem.h" |
| 6 | 6 |
| 7 #include "platform/graphics/GraphicsContext.h" | 7 #include "platform/graphics/GraphicsContext.h" |
| 8 #include "platform/transforms/AffineTransform.h" | 8 #include "platform/transforms/AffineTransform.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 BeginScrollDisplayItem::replay(GraphicsContext& context) const | 13 void BeginScrollDisplayItem::replay(GraphicsContext& context) const |
| 14 { | 14 { |
| 15 context.save(); | 15 context.save(); |
| 16 context.translate(-m_currentOffset.width(), -m_currentOffset.height()); | 16 context.translate(-m_currentOffset.width(), -m_currentOffset.height()); |
| 17 } | 17 } |
| 18 | 18 |
| 19 void BeginScrollDisplayItem::appendToWebDisplayItemList(const IntRect& visualRec
t, WebDisplayItemList* list) const | 19 void BeginScrollDisplayItem::appendToWebDisplayItemList(const IntRect& visualRec
t, WebDisplayItemList* list) const |
| 20 { | 20 { |
| 21 WebDisplayItemList::ScrollContainerId scrollContainerId = &client(); | 21 WebDisplayItemList::ScrollContainerId scrollContainerId = &client(); |
| 22 list->appendScrollItem(visualRect, m_currentOffset, scrollContainerId); | 22 list->appendScrollItem(m_currentOffset, scrollContainerId); |
| 23 } | 23 } |
| 24 | 24 |
| 25 #ifndef NDEBUG | 25 #ifndef NDEBUG |
| 26 void BeginScrollDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& str
ingBuilder) const | 26 void BeginScrollDisplayItem::dumpPropertiesAsDebugString(WTF::StringBuilder& str
ingBuilder) const |
| 27 { | 27 { |
| 28 PairedBeginDisplayItem::dumpPropertiesAsDebugString(stringBuilder); | 28 PairedBeginDisplayItem::dumpPropertiesAsDebugString(stringBuilder); |
| 29 stringBuilder.append(WTF::String::format(", currentOffset: [%d,%d]", m_curre
ntOffset.width(), m_currentOffset.height())); | 29 stringBuilder.append(WTF::String::format(", currentOffset: [%d,%d]", m_curre
ntOffset.width(), m_currentOffset.height())); |
| 30 } | 30 } |
| 31 #endif | 31 #endif |
| 32 | 32 |
| 33 void EndScrollDisplayItem::replay(GraphicsContext& context) const | 33 void EndScrollDisplayItem::replay(GraphicsContext& context) const |
| 34 { | 34 { |
| 35 context.restore(); | 35 context.restore(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void EndScrollDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect,
WebDisplayItemList* list) const | 38 void EndScrollDisplayItem::appendToWebDisplayItemList(const IntRect& visualRect,
WebDisplayItemList* list) const |
| 39 { | 39 { |
| 40 list->appendEndScrollItem(visualRect); | 40 list->appendEndScrollItem(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 } // namespace blink | 43 } // namespace blink |
| OLD | NEW |