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

Side by Side Diff: cc/output/render_surface_filters.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/output/render_surface_filters.h" 5 #include "cc/output/render_surface_filters.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 matrix[12] = 0.131f + 0.869f * amount; 141 matrix[12] = 0.131f + 0.869f * amount;
142 matrix[13] = matrix[14] = 0.f; 142 matrix[13] = matrix[14] = 0.f;
143 143
144 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0.f; 144 matrix[15] = matrix[16] = matrix[17] = matrix[19] = 0.f;
145 matrix[18] = 1.f; 145 matrix[18] = 1.f;
146 } 146 }
147 147
148 skia::RefPtr<SkImageFilter> CreateMatrixImageFilter( 148 skia::RefPtr<SkImageFilter> CreateMatrixImageFilter(
149 const SkScalar matrix[20], 149 const SkScalar matrix[20],
150 const skia::RefPtr<SkImageFilter>& input) { 150 const skia::RefPtr<SkImageFilter>& input) {
151 skia::RefPtr<SkColorFilter> color_filter = 151 return skia::AdoptRef(SkColorFilterImageFilter::Create(
152 skia::AdoptRef(SkColorMatrixFilter::Create(matrix)); 152 SkColorFilter::MakeMatrixFilterRowMajor255(matrix).release(),
f(malita) 2016/03/26 14:16:49 Ditto.
153 return skia::AdoptRef( 153 input.get()));
154 SkColorFilterImageFilter::Create(color_filter.get(), input.get()));
155 } 154 }
156 155
157 } // namespace 156 } // namespace
158 157
159 skia::RefPtr<SkImageFilter> RenderSurfaceFilters::BuildImageFilter( 158 skia::RefPtr<SkImageFilter> RenderSurfaceFilters::BuildImageFilter(
160 const FilterOperations& filters, 159 const FilterOperations& filters,
161 const gfx::SizeF& size) { 160 const gfx::SizeF& size) {
162 skia::RefPtr<SkImageFilter> image_filter; 161 skia::RefPtr<SkImageFilter> image_filter;
163 SkScalar matrix[20]; 162 SkScalar matrix[20];
164 for (size_t i = 0; i < filters.size(); ++i) { 163 for (size_t i = 0; i < filters.size(); ++i) {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 image_filter = alpha_filter; 270 image_filter = alpha_filter;
272 } 271 }
273 break; 272 break;
274 } 273 }
275 } 274 }
276 } 275 }
277 return image_filter; 276 return image_filter;
278 } 277 }
279 278
280 } // namespace cc 279 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698