Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(976)

Side by Side Diff: cc/blink/web_display_item_list_impl.cc

Issue 942403002: Add a compositing display item which replaces transparency display item (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward decls and imports oh my Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/blink/web_display_item_list_impl.h ('k') | cc/cc.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/resources/transparency_display_item.h"
18 #include "skia/ext/refptr.h" 19 #include "skia/ext/refptr.h"
19 #include "third_party/WebKit/public/platform/WebFloatRect.h" 20 #include "third_party/WebKit/public/platform/WebFloatRect.h"
20 #include "third_party/WebKit/public/platform/WebRect.h" 21 #include "third_party/WebKit/public/platform/WebRect.h"
22 #include "third_party/skia/include/core/SkColorFilter.h"
21 #include "third_party/skia/include/core/SkImageFilter.h" 23 #include "third_party/skia/include/core/SkImageFilter.h"
22 #include "third_party/skia/include/core/SkPicture.h" 24 #include "third_party/skia/include/core/SkPicture.h"
23 #include "third_party/skia/include/utils/SkMatrix44.h" 25 #include "third_party/skia/include/utils/SkMatrix44.h"
24 #include "ui/gfx/transform.h" 26 #include "ui/gfx/transform.h"
25 27
26 namespace cc_blink { 28 namespace cc_blink {
27 29
28 WebDisplayItemListImpl::WebDisplayItemListImpl() 30 WebDisplayItemListImpl::WebDisplayItemListImpl()
29 : display_item_list_(cc::DisplayItemList::Create()) { 31 : display_item_list_(cc::DisplayItemList::Create()) {
30 } 32 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void WebDisplayItemListImpl::appendEndFloatClipItem() { 74 void WebDisplayItemListImpl::appendEndFloatClipItem() {
73 display_item_list_->AppendItem(cc::EndFloatClipDisplayItem::Create()); 75 display_item_list_->AppendItem(cc::EndFloatClipDisplayItem::Create());
74 } 76 }
75 77
76 void WebDisplayItemListImpl::appendTransformItem(const SkMatrix44& matrix) { 78 void WebDisplayItemListImpl::appendTransformItem(const SkMatrix44& matrix) {
77 gfx::Transform transform; 79 gfx::Transform transform;
78 transform.matrix() = matrix; 80 transform.matrix() = matrix;
79 display_item_list_->AppendItem(cc::TransformDisplayItem::Create(transform)); 81 display_item_list_->AppendItem(cc::TransformDisplayItem::Create(transform));
80 } 82 }
81 83
84 void WebDisplayItemListImpl::appendEndTransformItem() {
85 display_item_list_->AppendItem(cc::EndTransformDisplayItem::Create());
86 }
87
88 // TODO(pdr): Remove once there are no more callers.
82 void WebDisplayItemListImpl::appendTransparencyItem( 89 void WebDisplayItemListImpl::appendTransparencyItem(
83 float opacity, 90 float opacity,
84 blink::WebBlendMode blend_mode) { 91 blink::WebBlendMode blend_mode) {
85 display_item_list_->AppendItem(cc::TransparencyDisplayItem::Create( 92 display_item_list_->AppendItem(cc::TransparencyDisplayItem::Create(
86 opacity, BlendModeToSkia(blend_mode))); 93 opacity, BlendModeToSkia(blend_mode)));
87 } 94 }
88 95
89 void WebDisplayItemListImpl::appendEndTransformItem() { 96 // TODO(pdr): Remove once there are no more callers.
90 display_item_list_->AppendItem(cc::EndTransformDisplayItem::Create()); 97 void WebDisplayItemListImpl::appendEndTransparencyItem() {
98 display_item_list_->AppendItem(cc::EndTransparencyDisplayItem::Create());
91 } 99 }
92 100
93 void WebDisplayItemListImpl::appendEndTransparencyItem() { 101 void WebDisplayItemListImpl::appendCompositingItem(
94 display_item_list_->AppendItem(cc::EndTransparencyDisplayItem::Create()); 102 float opacity,
103 SkXfermode::Mode xfermode,
104 SkColorFilter* color_filter) {
105 display_item_list_->AppendItem(cc::CompositingDisplayItem::Create(
106 opacity, xfermode, skia::SharePtr(color_filter)));
107 }
108
109 void WebDisplayItemListImpl::appendEndCompositingItem() {
110 display_item_list_->AppendItem(cc::EndCompositingDisplayItem::Create());
95 } 111 }
96 112
97 void WebDisplayItemListImpl::appendFilterItem( 113 void WebDisplayItemListImpl::appendFilterItem(
98 const blink::WebFilterOperations& filters, 114 const blink::WebFilterOperations& filters,
99 const blink::WebFloatRect& bounds) { 115 const blink::WebFloatRect& bounds) {
100 const WebFilterOperationsImpl& filters_impl = 116 const WebFilterOperationsImpl& filters_impl =
101 static_cast<const WebFilterOperationsImpl&>(filters); 117 static_cast<const WebFilterOperationsImpl&>(filters);
102 display_item_list_->AppendItem( 118 display_item_list_->AppendItem(
103 cc::FilterDisplayItem::Create(filters_impl.AsFilterOperations(), bounds)); 119 cc::FilterDisplayItem::Create(filters_impl.AsFilterOperations(), bounds));
104 } 120 }
(...skipping 11 matching lines...) Expand all
116 } 132 }
117 133
118 void WebDisplayItemListImpl::appendEndScrollItem() { 134 void WebDisplayItemListImpl::appendEndScrollItem() {
119 appendEndTransformItem(); 135 appendEndTransformItem();
120 } 136 }
121 137
122 WebDisplayItemListImpl::~WebDisplayItemListImpl() { 138 WebDisplayItemListImpl::~WebDisplayItemListImpl() {
123 } 139 }
124 140
125 } // namespace cc_blink 141 } // namespace cc_blink
OLDNEW
« no previous file with comments | « cc/blink/web_display_item_list_impl.h ('k') | cc/cc.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698