| 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" |
| 11 #include "cc/resources/clip_display_item.h" | 11 #include "cc/resources/clip_display_item.h" |
| 12 #include "cc/resources/clip_path_display_item.h" | 12 #include "cc/resources/clip_path_display_item.h" |
| 13 #include "cc/resources/compositing_display_item.h" |
| 13 #include "cc/resources/drawing_display_item.h" | 14 #include "cc/resources/drawing_display_item.h" |
| 14 #include "cc/resources/filter_display_item.h" | 15 #include "cc/resources/filter_display_item.h" |
| 15 #include "cc/resources/float_clip_display_item.h" | 16 #include "cc/resources/float_clip_display_item.h" |
| 16 #include "cc/resources/transform_display_item.h" | 17 #include "cc/resources/transform_display_item.h" |
| 17 #include "cc/resources/transparency_display_item.h" | |
| 18 #include "skia/ext/refptr.h" | 18 #include "skia/ext/refptr.h" |
| 19 #include "third_party/WebKit/public/platform/WebFloatRect.h" | 19 #include "third_party/WebKit/public/platform/WebFloatRect.h" |
| 20 #include "third_party/WebKit/public/platform/WebRect.h" | 20 #include "third_party/WebKit/public/platform/WebRect.h" |
| 21 #include "third_party/skia/include/core/SkColorFilter.h" |
| 21 #include "third_party/skia/include/core/SkImageFilter.h" | 22 #include "third_party/skia/include/core/SkImageFilter.h" |
| 22 #include "third_party/skia/include/core/SkPicture.h" | 23 #include "third_party/skia/include/core/SkPicture.h" |
| 23 #include "third_party/skia/include/utils/SkMatrix44.h" | 24 #include "third_party/skia/include/utils/SkMatrix44.h" |
| 24 #include "ui/gfx/transform.h" | 25 #include "ui/gfx/transform.h" |
| 25 | 26 |
| 26 namespace cc_blink { | 27 namespace cc_blink { |
| 27 | 28 |
| 28 WebDisplayItemListImpl::WebDisplayItemListImpl() | 29 WebDisplayItemListImpl::WebDisplayItemListImpl() |
| 29 : display_item_list_(cc::DisplayItemList::Create()) { | 30 : display_item_list_(cc::DisplayItemList::Create()) { |
| 30 } | 31 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void WebDisplayItemListImpl::appendEndFloatClipItem() { | 73 void WebDisplayItemListImpl::appendEndFloatClipItem() { |
| 73 display_item_list_->AppendItem(cc::EndFloatClipDisplayItem::Create()); | 74 display_item_list_->AppendItem(cc::EndFloatClipDisplayItem::Create()); |
| 74 } | 75 } |
| 75 | 76 |
| 76 void WebDisplayItemListImpl::appendTransformItem(const SkMatrix44& matrix) { | 77 void WebDisplayItemListImpl::appendTransformItem(const SkMatrix44& matrix) { |
| 77 gfx::Transform transform; | 78 gfx::Transform transform; |
| 78 transform.matrix() = matrix; | 79 transform.matrix() = matrix; |
| 79 display_item_list_->AppendItem(cc::TransformDisplayItem::Create(transform)); | 80 display_item_list_->AppendItem(cc::TransformDisplayItem::Create(transform)); |
| 80 } | 81 } |
| 81 | 82 |
| 82 void WebDisplayItemListImpl::appendTransparencyItem( | |
| 83 float opacity, | |
| 84 blink::WebBlendMode blend_mode) { | |
| 85 display_item_list_->AppendItem(cc::TransparencyDisplayItem::Create( | |
| 86 opacity, BlendModeToSkia(blend_mode))); | |
| 87 } | |
| 88 | |
| 89 void WebDisplayItemListImpl::appendEndTransformItem() { | 83 void WebDisplayItemListImpl::appendEndTransformItem() { |
| 90 display_item_list_->AppendItem(cc::EndTransformDisplayItem::Create()); | 84 display_item_list_->AppendItem(cc::EndTransformDisplayItem::Create()); |
| 91 } | 85 } |
| 92 | 86 |
| 93 void WebDisplayItemListImpl::appendEndTransparencyItem() { | 87 // TODO(pdr): Remove this once the blink-side callers have been removed. |
| 94 display_item_list_->AppendItem(cc::EndTransparencyDisplayItem::Create()); | 88 void WebDisplayItemListImpl::appendCompositingItem( |
| 89 float opacity, |
| 90 SkXfermode::Mode xfermode, |
| 91 SkColorFilter* color_filter) { |
| 92 appendCompositingItem(opacity, xfermode, nullptr, color_filter); |
| 93 } |
| 94 |
| 95 void WebDisplayItemListImpl::appendCompositingItem( |
| 96 float opacity, |
| 97 SkXfermode::Mode xfermode, |
| 98 SkRect* bounds, |
| 99 SkColorFilter* color_filter) { |
| 100 display_item_list_->AppendItem(cc::CompositingDisplayItem::Create( |
| 101 opacity, xfermode, bounds, skia::SharePtr(color_filter))); |
| 102 } |
| 103 |
| 104 void WebDisplayItemListImpl::appendEndCompositingItem() { |
| 105 display_item_list_->AppendItem(cc::EndCompositingDisplayItem::Create()); |
| 95 } | 106 } |
| 96 | 107 |
| 97 void WebDisplayItemListImpl::appendFilterItem( | 108 void WebDisplayItemListImpl::appendFilterItem( |
| 98 const blink::WebFilterOperations& filters, | 109 const blink::WebFilterOperations& filters, |
| 99 const blink::WebFloatRect& bounds) { | 110 const blink::WebFloatRect& bounds) { |
| 100 const WebFilterOperationsImpl& filters_impl = | 111 const WebFilterOperationsImpl& filters_impl = |
| 101 static_cast<const WebFilterOperationsImpl&>(filters); | 112 static_cast<const WebFilterOperationsImpl&>(filters); |
| 102 display_item_list_->AppendItem( | 113 display_item_list_->AppendItem( |
| 103 cc::FilterDisplayItem::Create(filters_impl.AsFilterOperations(), bounds)); | 114 cc::FilterDisplayItem::Create(filters_impl.AsFilterOperations(), bounds)); |
| 104 } | 115 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 116 } | 127 } |
| 117 | 128 |
| 118 void WebDisplayItemListImpl::appendEndScrollItem() { | 129 void WebDisplayItemListImpl::appendEndScrollItem() { |
| 119 appendEndTransformItem(); | 130 appendEndTransformItem(); |
| 120 } | 131 } |
| 121 | 132 |
| 122 WebDisplayItemListImpl::~WebDisplayItemListImpl() { | 133 WebDisplayItemListImpl::~WebDisplayItemListImpl() { |
| 123 } | 134 } |
| 124 | 135 |
| 125 } // namespace cc_blink | 136 } // namespace cc_blink |
| OLD | NEW |