| 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)), | 38 skia::SharePtr(const_cast<SkPicture*>(picture)))); |
| 39 gfx::PointF(picture->cullRect().x(), picture->cullRect().y()))); | |
| 40 } | |
| 41 | |
| 42 void WebDisplayItemListImpl::appendDrawingItem( | |
| 43 SkPicture* picture, | |
| 44 const blink::WebFloatPoint& location) { | |
| 45 display_item_list_->AppendItem( | |
| 46 cc::DrawingDisplayItem::Create(skia::SharePtr(picture), location)); | |
| 47 } | 39 } |
| 48 | 40 |
| 49 void WebDisplayItemListImpl::appendClipItem( | 41 void WebDisplayItemListImpl::appendClipItem( |
| 50 const blink::WebRect& clip_rect, | 42 const blink::WebRect& clip_rect, |
| 51 const blink::WebVector<SkRRect>& rounded_clip_rects) { | 43 const blink::WebVector<SkRRect>& rounded_clip_rects) { |
| 52 std::vector<SkRRect> rounded_rects; | 44 std::vector<SkRRect> rounded_rects; |
| 53 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { | 45 for (size_t i = 0; i < rounded_clip_rects.size(); ++i) { |
| 54 rounded_rects.push_back(rounded_clip_rects[i]); | 46 rounded_rects.push_back(rounded_clip_rects[i]); |
| 55 } | 47 } |
| 56 display_item_list_->AppendItem( | 48 display_item_list_->AppendItem( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 cc::FilterOperation::CreateReferenceFilter(skia::SharePtr(filter))); | 112 cc::FilterOperation::CreateReferenceFilter(skia::SharePtr(filter))); |
| 121 display_item_list_->AppendItem( | 113 display_item_list_->AppendItem( |
| 122 cc::FilterDisplayItem::Create(filter_operations, bounds)); | 114 cc::FilterDisplayItem::Create(filter_operations, bounds)); |
| 123 } | 115 } |
| 124 #endif | 116 #endif |
| 125 | 117 |
| 126 void WebDisplayItemListImpl::appendEndFilterItem() { | 118 void WebDisplayItemListImpl::appendEndFilterItem() { |
| 127 display_item_list_->AppendItem(cc::EndFilterDisplayItem::Create()); | 119 display_item_list_->AppendItem(cc::EndFilterDisplayItem::Create()); |
| 128 } | 120 } |
| 129 | 121 |
| 122 void WebDisplayItemListImpl::appendScrollItem( |
| 123 const blink::WebSize& scrollOffset, |
| 124 ScrollContainerId) { |
| 125 SkMatrix44 matrix; |
| 126 matrix.setTranslate(-scrollOffset.width, -scrollOffset.height, 0); |
| 127 appendTransformItem(matrix); |
| 128 } |
| 129 |
| 130 void WebDisplayItemListImpl::appendEndScrollItem() { |
| 131 appendEndTransformItem(); |
| 132 } |
| 133 |
| 130 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 134 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
| 131 } | 135 } |
| 132 | 136 |
| 133 } // namespace cc_blink | 137 } // namespace cc_blink |
| OLD | NEW |