Chromium Code Reviews| 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 <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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |