| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 image_filter = skia::AdoptRef(SkBlurImageFilter::Create( | 199 image_filter = skia::AdoptRef(SkBlurImageFilter::Create( |
| 200 op.amount(), op.amount(), image_filter.get())); | 200 op.amount(), op.amount(), image_filter.get())); |
| 201 break; | 201 break; |
| 202 case FilterOperation::DROP_SHADOW: | 202 case FilterOperation::DROP_SHADOW: |
| 203 image_filter = skia::AdoptRef(SkDropShadowImageFilter::Create( | 203 image_filter = skia::AdoptRef(SkDropShadowImageFilter::Create( |
| 204 SkIntToScalar(op.drop_shadow_offset().x()), | 204 SkIntToScalar(op.drop_shadow_offset().x()), |
| 205 SkIntToScalar(op.drop_shadow_offset().y()), | 205 SkIntToScalar(op.drop_shadow_offset().y()), |
| 206 SkIntToScalar(op.amount()), | 206 SkIntToScalar(op.amount()), |
| 207 SkIntToScalar(op.amount()), | 207 SkIntToScalar(op.amount()), |
| 208 op.drop_shadow_color(), | 208 op.drop_shadow_color(), |
| 209 SkDropShadowImageFilter::kDrawShadowAndForeground_ShadowMode, |
| 209 image_filter.get())); | 210 image_filter.get())); |
| 210 break; | 211 break; |
| 211 case FilterOperation::COLOR_MATRIX: | 212 case FilterOperation::COLOR_MATRIX: |
| 212 image_filter = CreateMatrixImageFilter(op.matrix(), image_filter); | 213 image_filter = CreateMatrixImageFilter(op.matrix(), image_filter); |
| 213 break; | 214 break; |
| 214 case FilterOperation::ZOOM: { | 215 case FilterOperation::ZOOM: { |
| 215 skia::RefPtr<SkImageFilter> zoom_filter = | 216 skia::RefPtr<SkImageFilter> zoom_filter = |
| 216 skia::AdoptRef(SkMagnifierImageFilter::Create( | 217 skia::AdoptRef(SkMagnifierImageFilter::Create( |
| 217 SkRect::MakeXYWH( | 218 SkRect::MakeXYWH( |
| 218 (size.width() - (size.width() / op.amount())) / 2.f, | 219 (size.width() - (size.width() / op.amount())) / 2.f, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 image_filter = alpha_filter; | 270 image_filter = alpha_filter; |
| 270 } | 271 } |
| 271 break; | 272 break; |
| 272 } | 273 } |
| 273 } | 274 } |
| 274 } | 275 } |
| 275 return image_filter; | 276 return image_filter; |
| 276 } | 277 } |
| 277 | 278 |
| 278 } // namespace cc | 279 } // namespace cc |
| OLD | NEW |