OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/trace_event/trace_event_argument.h" | 9 #include "base/trace_event/trace_event_argument.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 to_op.drop_shadow_offset().x()), | 240 to_op.drop_shadow_offset().x()), |
241 gfx::Tween::LinearIntValueBetween(progress, | 241 gfx::Tween::LinearIntValueBetween(progress, |
242 from_op.drop_shadow_offset().y(), | 242 from_op.drop_shadow_offset().y(), |
243 to_op.drop_shadow_offset().y())); | 243 to_op.drop_shadow_offset().y())); |
244 blended_filter.set_drop_shadow_offset(blended_offset); | 244 blended_filter.set_drop_shadow_offset(blended_offset); |
245 blended_filter.set_drop_shadow_color(gfx::Tween::ColorValueBetween( | 245 blended_filter.set_drop_shadow_color(gfx::Tween::ColorValueBetween( |
246 progress, from_op.drop_shadow_color(), to_op.drop_shadow_color())); | 246 progress, from_op.drop_shadow_color(), to_op.drop_shadow_color())); |
247 } else if (to_op.type() == FilterOperation::ZOOM) { | 247 } else if (to_op.type() == FilterOperation::ZOOM) { |
248 blended_filter.set_zoom_inset( | 248 blended_filter.set_zoom_inset( |
249 std::max(gfx::Tween::LinearIntValueBetween( | 249 std::max(gfx::Tween::LinearIntValueBetween( |
250 from_op.zoom_inset(), to_op.zoom_inset(), progress), | 250 progress, from_op.zoom_inset(), to_op.zoom_inset()), |
251 0)); | 251 0)); |
252 } else if (to_op.type() == FilterOperation::ALPHA_THRESHOLD) { | 252 } else if (to_op.type() == FilterOperation::ALPHA_THRESHOLD) { |
253 blended_filter.set_outer_threshold(ClampAmountForFilterType( | 253 blended_filter.set_outer_threshold(ClampAmountForFilterType( |
254 gfx::Tween::FloatValueBetween(progress, | 254 gfx::Tween::FloatValueBetween(progress, |
255 from_op.outer_threshold(), | 255 from_op.outer_threshold(), |
256 to_op.outer_threshold()), | 256 to_op.outer_threshold()), |
257 to_op.type())); | 257 to_op.type())); |
258 blended_filter.set_region(to_op.region()); | 258 blended_filter.set_region(to_op.region()); |
259 } | 259 } |
260 | 260 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 SkImageFilter::kForward_MapDirection); | 376 SkImageFilter::kForward_MapDirection); |
377 } | 377 } |
378 | 378 |
379 gfx::Rect FilterOperation::MapRectReverse(const gfx::Rect& rect, | 379 gfx::Rect FilterOperation::MapRectReverse(const gfx::Rect& rect, |
380 const SkMatrix& matrix) const { | 380 const SkMatrix& matrix) const { |
381 return MapRectInternal(*this, rect, matrix, | 381 return MapRectInternal(*this, rect, matrix, |
382 SkImageFilter::kReverse_MapDirection); | 382 SkImageFilter::kReverse_MapDirection); |
383 } | 383 } |
384 | 384 |
385 } // namespace cc | 385 } // namespace cc |
OLD | NEW |