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

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

Issue 1829093002: Use sk_sp-based APIs for SkColorFilter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bad rebase Created 4 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } else { 156 } else {
157 display_item_list_->RasterIntoCanvas(cc::EndTransformDisplayItem()); 157 display_item_list_->RasterIntoCanvas(cc::EndTransformDisplayItem());
158 } 158 }
159 } 159 }
160 160
161 void WebDisplayItemListImpl::appendCompositingItem( 161 void WebDisplayItemListImpl::appendCompositingItem(
162 const blink::WebRect& visual_rect, 162 const blink::WebRect& visual_rect,
163 float opacity, 163 float opacity,
164 SkXfermode::Mode xfermode, 164 SkXfermode::Mode xfermode,
165 SkRect* bounds, 165 SkRect* bounds,
166 SkColorFilter* color_filter) { 166 SkColorFilter* color_filter) {
danakj 2016/03/26 00:49:51 can you make this take sk_sp instead?
tomhudson 2016/03/28 13:11:17 This inherits from blink::WebDisplayItemList, and
167 DCHECK_GE(opacity, 0.f); 167 DCHECK_GE(opacity, 0.f);
168 DCHECK_LE(opacity, 1.f); 168 DCHECK_LE(opacity, 1.f);
169 // TODO(ajuma): This should really be rounding instead of flooring the alpha 169 // TODO(ajuma): This should really be rounding instead of flooring the alpha
170 // value, but that breaks slimming paint reftests. 170 // value, but that breaks slimming paint reftests.
171 171
172 const bool kLcdTextRequiresOpaqueLayer = true; 172 const bool kLcdTextRequiresOpaqueLayer = true;
173 if (display_item_list_->RetainsIndividualDisplayItems()) { 173 if (display_item_list_->RetainsIndividualDisplayItems()) {
174 display_item_list_->CreateAndAppendItem<cc::CompositingDisplayItem>( 174 display_item_list_->CreateAndAppendItem<cc::CompositingDisplayItem>(
175 visual_rect, static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), 175 visual_rect, static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)),
176 xfermode, bounds, skia::SharePtr(color_filter), 176 xfermode, bounds, sk_ref_sp(color_filter), kLcdTextRequiresOpaqueLayer);
177 kLcdTextRequiresOpaqueLayer);
178 } else { 177 } else {
179 cc::CompositingDisplayItem item( 178 cc::CompositingDisplayItem item(
180 static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), xfermode, 179 static_cast<uint8_t>(gfx::ToFlooredInt(255 * opacity)), xfermode,
181 bounds, skia::SharePtr(color_filter), kLcdTextRequiresOpaqueLayer); 180 bounds, sk_ref_sp(color_filter), kLcdTextRequiresOpaqueLayer);
182 display_item_list_->RasterIntoCanvas(item); 181 display_item_list_->RasterIntoCanvas(item);
183 } 182 }
184 } 183 }
185 184
186 void WebDisplayItemListImpl::appendEndCompositingItem( 185 void WebDisplayItemListImpl::appendEndCompositingItem(
187 const blink::WebRect& visual_rect) { 186 const blink::WebRect& visual_rect) {
188 if (display_item_list_->RetainsIndividualDisplayItems()) { 187 if (display_item_list_->RetainsIndividualDisplayItems()) {
189 display_item_list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>( 188 display_item_list_->CreateAndAppendItem<cc::EndCompositingDisplayItem>(
190 visual_rect); 189 visual_rect);
191 } else { 190 } else {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 227
229 void WebDisplayItemListImpl::appendEndScrollItem( 228 void WebDisplayItemListImpl::appendEndScrollItem(
230 const blink::WebRect& visual_rect) { 229 const blink::WebRect& visual_rect) {
231 appendEndTransformItem(visual_rect); 230 appendEndTransformItem(visual_rect);
232 } 231 }
233 232
234 WebDisplayItemListImpl::~WebDisplayItemListImpl() { 233 WebDisplayItemListImpl::~WebDisplayItemListImpl() {
235 } 234 }
236 235
237 } // namespace cc_blink 236 } // namespace cc_blink
OLDNEW
« no previous file with comments | « no previous file | cc/layers/heads_up_display_layer_impl.cc » ('j') | cc/output/gl_renderer_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698