OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "cc/output/filter_operation.h" | 9 #include "cc/output/filter_operation.h" |
10 #include "cc/output/filter_operations.h" | 10 #include "cc/output/filter_operations.h" |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 GetSaturatingBrightnessMatrix(op.amount(), matrix); | 235 GetSaturatingBrightnessMatrix(op.amount(), matrix); |
236 image_filter = CreateMatrixImageFilter(matrix, image_filter); | 236 image_filter = CreateMatrixImageFilter(matrix, image_filter); |
237 break; | 237 break; |
238 case FilterOperation::REFERENCE: { | 238 case FilterOperation::REFERENCE: { |
239 if (!op.image_filter()) | 239 if (!op.image_filter()) |
240 break; | 240 break; |
241 | 241 |
242 skia::RefPtr<SkColorFilter> cf; | 242 skia::RefPtr<SkColorFilter> cf; |
243 | 243 |
244 { | 244 { |
245 SkColorFilter* colorfilter_rawptr = NULL; | 245 SkColorFilter* colorfilter_rawptr = nullptr; |
246 op.image_filter()->asColorFilter(&colorfilter_rawptr); | 246 op.image_filter()->asColorFilter(&colorfilter_rawptr); |
247 cf = skia::AdoptRef(colorfilter_rawptr); | 247 cf = skia::AdoptRef(colorfilter_rawptr); |
248 } | 248 } |
249 | 249 |
250 if (cf && cf->asColorMatrix(matrix) && | 250 if (cf && cf->asColorMatrix(matrix) && |
251 !op.image_filter()->getInput(0)) { | 251 !op.image_filter()->getInput(0)) { |
252 image_filter = CreateMatrixImageFilter(matrix, image_filter); | 252 image_filter = CreateMatrixImageFilter(matrix, image_filter); |
253 } else if (image_filter) { | 253 } else if (image_filter) { |
254 image_filter = skia::AdoptRef(SkComposeImageFilter::Create( | 254 image_filter = skia::AdoptRef(SkComposeImageFilter::Create( |
255 op.image_filter().get(), image_filter.get())); | 255 op.image_filter().get(), image_filter.get())); |
(...skipping 13 matching lines...) Expand all Loading... |
269 image_filter = alpha_filter; | 269 image_filter = alpha_filter; |
270 } | 270 } |
271 break; | 271 break; |
272 } | 272 } |
273 } | 273 } |
274 } | 274 } |
275 return image_filter; | 275 return image_filter; |
276 } | 276 } |
277 | 277 |
278 } // namespace cc | 278 } // namespace cc |
OLD | NEW |