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 context.Save(); | 14 context.Save(); |
15 context.Translate(-current_offset_.Width(), -current_offset_.Height()); | 15 context.Translate(-current_offset_.Width(), -current_offset_.Height()); |
16 } | 16 } |
17 | 17 |
18 void BeginScrollDisplayItem::AppendToWebDisplayItemList( | 18 void BeginScrollDisplayItem::AppendToWebDisplayItemList( |
19 const IntRect& visual_rect, | 19 const LayoutSize&, |
20 WebDisplayItemList* list) const { | 20 WebDisplayItemList* list) const { |
21 WebDisplayItemList::ScrollContainerId scroll_container_id = &Client(); | 21 WebDisplayItemList::ScrollContainerId scroll_container_id = &Client(); |
22 list->AppendScrollItem(current_offset_, scroll_container_id); | 22 list->AppendScrollItem(current_offset_, scroll_container_id); |
23 } | 23 } |
24 | 24 |
25 #ifndef NDEBUG | 25 #ifndef NDEBUG |
26 void BeginScrollDisplayItem::DumpPropertiesAsDebugString( | 26 void BeginScrollDisplayItem::DumpPropertiesAsDebugString( |
27 WTF::StringBuilder& string_builder) const { | 27 WTF::StringBuilder& string_builder) const { |
28 PairedBeginDisplayItem::DumpPropertiesAsDebugString(string_builder); | 28 PairedBeginDisplayItem::DumpPropertiesAsDebugString(string_builder); |
29 string_builder.Append(WTF::String::Format(", currentOffset: [%d,%d]", | 29 string_builder.Append(WTF::String::Format(", currentOffset: [%d,%d]", |
30 current_offset_.Width(), | 30 current_offset_.Width(), |
31 current_offset_.Height())); | 31 current_offset_.Height())); |
32 } | 32 } |
33 #endif | 33 #endif |
34 | 34 |
35 void EndScrollDisplayItem::Replay(GraphicsContext& context) const { | 35 void EndScrollDisplayItem::Replay(GraphicsContext& context) const { |
36 context.Restore(); | 36 context.Restore(); |
37 } | 37 } |
38 | 38 |
39 void EndScrollDisplayItem::AppendToWebDisplayItemList( | 39 void EndScrollDisplayItem::AppendToWebDisplayItemList( |
40 const IntRect& visual_rect, | 40 const LayoutSize&, |
41 WebDisplayItemList* list) const { | 41 WebDisplayItemList* list) const { |
42 list->AppendEndScrollItem(); | 42 list->AppendEndScrollItem(); |
43 } | 43 } |
44 | 44 |
45 } // namespace blink | 45 } // namespace blink |
OLD | NEW |