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 "cc/blink/web_display_item_list_impl.h" | 5 #include "cc/blink/web_display_item_list_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "cc/blink/web_blend_mode.h" | 9 #include "cc/blink/web_blend_mode.h" |
10 #include "cc/blink/web_filter_operations_impl.h" | 10 #include "cc/blink/web_filter_operations_impl.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 WebDisplayItemListImpl::WebDisplayItemListImpl() | 28 WebDisplayItemListImpl::WebDisplayItemListImpl() |
29 : display_item_list_(cc::DisplayItemList::Create()) { | 29 : display_item_list_(cc::DisplayItemList::Create()) { |
30 } | 30 } |
31 | 31 |
32 scoped_refptr<cc::DisplayItemList> WebDisplayItemListImpl::ToDisplayItemList() { | 32 scoped_refptr<cc::DisplayItemList> WebDisplayItemListImpl::ToDisplayItemList() { |
33 return display_item_list_; | 33 return display_item_list_; |
34 } | 34 } |
35 | 35 |
36 void WebDisplayItemListImpl::appendDrawingItem(const SkPicture* picture) { | 36 void WebDisplayItemListImpl::appendDrawingItem(const SkPicture* picture) { |
37 display_item_list_->AppendItem(cc::DrawingDisplayItem::Create( | 37 display_item_list_->AppendItem(cc::DrawingDisplayItem::Create( |
38 skia::SharePtr(const_cast<SkPicture*>(picture)), gfx::PointF(0, 0))); | 38 skia::SharePtr(const_cast<SkPicture*>(picture)))); |
39 } | |
40 | |
41 void WebDisplayItemListImpl::appendDrawingItem( | |
42 SkPicture* picture, | |
43 const blink::WebFloatPoint& location) { | |
44 display_item_list_->AppendItem( | |
45 cc::DrawingDisplayItem::Create(skia::SharePtr(picture), location)); | |
46 } | 39 } |
47 | 40 |
48 void WebDisplayItemListImpl::appendClipItem( | 41 void WebDisplayItemListImpl::appendClipItem( |
49 const blink::WebRect& clip_rect, | 42 const blink::WebRect& clip_rect, |
50 const blink::WebVector<SkRRect>& rounded_clip_rects) { | 43 const blink::WebVector<SkRRect>& rounded_clip_rects) { |
51 std::vector<SkRRect> rounded_rects; | 44 std::vector<SkRRect> rounded_rects; |
52 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { | 45 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { |
53 rounded_rects.push_back(rounded_clip_rects[i]); | 46 rounded_rects.push_back(rounded_clip_rects[i]); |
54 } | 47 } |
55 display_item_list_->AppendItem( | 48 display_item_list_->AppendItem( |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const WebFilterOperationsImpl& filters_impl = | 100 const WebFilterOperationsImpl& filters_impl = |
108 static_cast<const WebFilterOperationsImpl&>(filters); | 101 static_cast<const WebFilterOperationsImpl&>(filters); |
109 display_item_list_->AppendItem( | 102 display_item_list_->AppendItem( |
110 cc::FilterDisplayItem::Create(filters_impl.AsFilterOperations(), bounds)); | 103 cc::FilterDisplayItem::Create(filters_impl.AsFilterOperations(), bounds)); |
111 } | 104 } |
112 | 105 |
113 void WebDisplayItemListImpl::appendEndFilterItem() { | 106 void WebDisplayItemListImpl::appendEndFilterItem() { |
114 display_item_list_->AppendItem(cc::EndFilterDisplayItem::Create()); | 107 display_item_list_->AppendItem(cc::EndFilterDisplayItem::Create()); |
115 } | 108 } |
116 | 109 |
| 110 void WebDisplayItemListImpl::appendScrollItem( |
| 111 const blink::WebSize& scrollOffset, |
| 112 ScrollContainerId) { |
| 113 SkMatrix44 matrix; |
| 114 matrix.setTranslate(-scrollOffset.width, -scrollOffset.height, 0); |
| 115 appendTransformItem(matrix); |
| 116 } |
| 117 |
| 118 void WebDisplayItemListImpl::appendEndScrollItem() { |
| 119 appendEndTransformItem(); |
| 120 } |
| 121 |
117 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 122 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
118 } | 123 } |
119 | 124 |
120 } // namespace cc_blink | 125 } // namespace cc_blink |
OLD | NEW |