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

Side by Side Diff: ui/views/animation/square_ink_drop_ripple.cc

Issue 2640053003: Add logging for |old_ink_drop_state| when ink drop DCHECKs fail. (Closed)
Patch Set: Created 3 years, 11 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/views/animation/square_ink_drop_ripple.h" 5 #include "ui/views/animation/square_ink_drop_ripple.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/compositor/layer.h" 10 #include "ui/compositor/layer.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 273 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
274 gfx::Tween::EASE_IN_OUT, animation_observer); 274 gfx::Tween::EASE_IN_OUT, animation_observer);
275 CalculateCircleTransforms(small_size_, &transforms); 275 CalculateCircleTransforms(small_size_, &transforms);
276 AnimateToTransforms( 276 AnimateToTransforms(
277 transforms, GetAnimationDuration(HIDDEN_TRANSFORM), 277 transforms, GetAnimationDuration(HIDDEN_TRANSFORM),
278 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 278 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
279 gfx::Tween::EASE_IN_OUT, animation_observer); 279 gfx::Tween::EASE_IN_OUT, animation_observer);
280 } 280 }
281 break; 281 break;
282 case InkDropState::ACTION_PENDING: 282 case InkDropState::ACTION_PENDING:
283 DCHECK(old_ink_drop_state == InkDropState::HIDDEN); 283 DCHECK_EQ(InkDropState::HIDDEN, old_ink_drop_state)
284 << " old_ink_drop_state=" << ToString(old_ink_drop_state);
285 ;
284 AnimateToOpacity(visible_opacity_, 286 AnimateToOpacity(visible_opacity_,
285 GetAnimationDuration(ACTION_PENDING_FADE_IN), 287 GetAnimationDuration(ACTION_PENDING_FADE_IN),
286 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 288 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
287 gfx::Tween::EASE_IN, animation_observer); 289 gfx::Tween::EASE_IN, animation_observer);
288 AnimateToOpacity(visible_opacity_, 290 AnimateToOpacity(visible_opacity_,
289 GetAnimationDuration(ACTION_PENDING_TRANSFORM), 291 GetAnimationDuration(ACTION_PENDING_TRANSFORM),
290 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 292 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
291 gfx::Tween::EASE_IN, animation_observer); 293 gfx::Tween::EASE_IN, animation_observer);
292 CalculateCircleTransforms(large_size_, &transforms); 294 CalculateCircleTransforms(large_size_, &transforms);
293 AnimateToTransforms(transforms, 295 AnimateToTransforms(transforms,
294 GetAnimationDuration(ACTION_PENDING_TRANSFORM), 296 GetAnimationDuration(ACTION_PENDING_TRANSFORM),
295 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 297 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
296 gfx::Tween::EASE_IN_OUT, animation_observer); 298 gfx::Tween::EASE_IN_OUT, animation_observer);
297 AnimateCenterPoint(target_center_point_, 299 AnimateCenterPoint(target_center_point_,
298 GetAnimationDuration(ACTION_PENDING_TRANSFORM), 300 GetAnimationDuration(ACTION_PENDING_TRANSFORM),
299 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 301 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
300 gfx::Tween::EASE_IN, animation_observer); 302 gfx::Tween::EASE_IN, animation_observer);
301 break; 303 break;
302 case InkDropState::ACTION_TRIGGERED: { 304 case InkDropState::ACTION_TRIGGERED: {
303 DCHECK(old_ink_drop_state == InkDropState::HIDDEN || 305 DCHECK(old_ink_drop_state == InkDropState::HIDDEN ||
304 old_ink_drop_state == InkDropState::ACTION_PENDING); 306 old_ink_drop_state == InkDropState::ACTION_PENDING)
307 << " old_ink_drop_state=" << ToString(old_ink_drop_state);
305 if (old_ink_drop_state == InkDropState::HIDDEN) { 308 if (old_ink_drop_state == InkDropState::HIDDEN) {
306 AnimateStateChange(old_ink_drop_state, InkDropState::ACTION_PENDING, 309 AnimateStateChange(old_ink_drop_state, InkDropState::ACTION_PENDING,
307 animation_observer); 310 animation_observer);
308 } 311 }
309 AnimateToOpacity(kHiddenOpacity, 312 AnimateToOpacity(kHiddenOpacity,
310 GetAnimationDuration(ACTION_TRIGGERED_FADE_OUT), 313 GetAnimationDuration(ACTION_TRIGGERED_FADE_OUT),
311 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION, 314 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
312 gfx::Tween::EASE_IN_OUT, animation_observer); 315 gfx::Tween::EASE_IN_OUT, animation_observer);
313 gfx::Size s = ScaleToRoundedSize(large_size_, kQuickActionBurstScale); 316 gfx::Size s = ScaleToRoundedSize(large_size_, kQuickActionBurstScale);
314 CalculateCircleTransforms(s, &transforms); 317 CalculateCircleTransforms(s, &transforms);
315 AnimateToTransforms(transforms, 318 AnimateToTransforms(transforms,
316 GetAnimationDuration(ACTION_TRIGGERED_TRANSFORM), 319 GetAnimationDuration(ACTION_TRIGGERED_TRANSFORM),
317 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION, 320 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
318 gfx::Tween::EASE_IN_OUT, animation_observer); 321 gfx::Tween::EASE_IN_OUT, animation_observer);
319 AnimateCenterPoint(target_center_point_, 322 AnimateCenterPoint(target_center_point_,
320 GetAnimationDuration(ACTION_TRIGGERED_TRANSFORM), 323 GetAnimationDuration(ACTION_TRIGGERED_TRANSFORM),
321 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION, 324 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
322 gfx::Tween::EASE_IN, animation_observer); 325 gfx::Tween::EASE_IN, animation_observer);
323 break; 326 break;
324 } 327 }
325 case InkDropState::ALTERNATE_ACTION_PENDING: 328 case InkDropState::ALTERNATE_ACTION_PENDING:
326 DCHECK(old_ink_drop_state == InkDropState::ACTION_PENDING); 329 DCHECK_EQ(InkDropState::ACTION_PENDING, old_ink_drop_state)
330 << " old_ink_drop_state=" << ToString(old_ink_drop_state);
327 AnimateToOpacity(visible_opacity_, 331 AnimateToOpacity(visible_opacity_,
328 GetAnimationDuration(ALTERNATE_ACTION_PENDING), 332 GetAnimationDuration(ALTERNATE_ACTION_PENDING),
329 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 333 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
330 gfx::Tween::EASE_IN, animation_observer); 334 gfx::Tween::EASE_IN, animation_observer);
331 CalculateRectTransforms(small_size_, small_corner_radius_, &transforms); 335 CalculateRectTransforms(small_size_, small_corner_radius_, &transforms);
332 AnimateToTransforms(transforms, 336 AnimateToTransforms(transforms,
333 GetAnimationDuration(ALTERNATE_ACTION_PENDING), 337 GetAnimationDuration(ALTERNATE_ACTION_PENDING),
334 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 338 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
335 gfx::Tween::EASE_IN_OUT, animation_observer); 339 gfx::Tween::EASE_IN_OUT, animation_observer);
336 AnimateCenterPoint(target_center_point_, 340 AnimateCenterPoint(target_center_point_,
337 GetAnimationDuration(ALTERNATE_ACTION_PENDING), 341 GetAnimationDuration(ALTERNATE_ACTION_PENDING),
338 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 342 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
339 gfx::Tween::EASE_IN, animation_observer); 343 gfx::Tween::EASE_IN, animation_observer);
340 break; 344 break;
341 case InkDropState::ALTERNATE_ACTION_TRIGGERED: { 345 case InkDropState::ALTERNATE_ACTION_TRIGGERED: {
342 DCHECK(old_ink_drop_state == InkDropState::ALTERNATE_ACTION_PENDING); 346 DCHECK_EQ(InkDropState::ALTERNATE_ACTION_PENDING, old_ink_drop_state)
347 << " old_ink_drop_state=" << ToString(old_ink_drop_state);
343 base::TimeDelta visible_duration = 348 base::TimeDelta visible_duration =
344 GetAnimationDuration(ALTERNATE_ACTION_TRIGGERED_TRANSFORM) - 349 GetAnimationDuration(ALTERNATE_ACTION_TRIGGERED_TRANSFORM) -
345 GetAnimationDuration(ALTERNATE_ACTION_TRIGGERED_FADE_OUT); 350 GetAnimationDuration(ALTERNATE_ACTION_TRIGGERED_FADE_OUT);
346 AnimateToOpacity(visible_opacity_, visible_duration, 351 AnimateToOpacity(visible_opacity_, visible_duration,
347 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET, 352 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
348 gfx::Tween::EASE_IN_OUT, animation_observer); 353 gfx::Tween::EASE_IN_OUT, animation_observer);
349 AnimateToOpacity(kHiddenOpacity, GetAnimationDuration( 354 AnimateToOpacity(kHiddenOpacity, GetAnimationDuration(
350 ALTERNATE_ACTION_TRIGGERED_FADE_OUT), 355 ALTERNATE_ACTION_TRIGGERED_FADE_OUT),
351 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION, 356 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION,
352 gfx::Tween::EASE_IN_OUT, animation_observer); 357 gfx::Tween::EASE_IN_OUT, animation_observer);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 layer->set_delegate(delegate); 644 layer->set_delegate(delegate);
640 layer->SetVisible(true); 645 layer->SetVisible(true);
641 layer->SetOpacity(1.0); 646 layer->SetOpacity(1.0);
642 layer->SetMasksToBounds(false); 647 layer->SetMasksToBounds(false);
643 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape)); 648 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape));
644 649
645 painted_layers_[painted_shape].reset(layer); 650 painted_layers_[painted_shape].reset(layer);
646 } 651 }
647 652
648 } // namespace views 653 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698