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

Side by Side Diff: Source/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 1218943002: Compositor animations for Independent CSS Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add cancelling tests Created 5 years, 5 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
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "core/animation/animatable/AnimatableTransform.h" 52 #include "core/animation/animatable/AnimatableTransform.h"
53 #include "core/animation/animatable/AnimatableUnknown.h" 53 #include "core/animation/animatable/AnimatableUnknown.h"
54 #include "core/animation/animatable/AnimatableVisibility.h" 54 #include "core/animation/animatable/AnimatableVisibility.h"
55 #include "core/css/CSSCalculationValue.h" 55 #include "core/css/CSSCalculationValue.h"
56 #include "core/css/CSSPrimitiveValue.h" 56 #include "core/css/CSSPrimitiveValue.h"
57 #include "core/css/CSSPrimitiveValueMappings.h" 57 #include "core/css/CSSPrimitiveValueMappings.h"
58 #include "core/css/CSSPropertyMetadata.h" 58 #include "core/css/CSSPropertyMetadata.h"
59 #include "core/style/ComputedStyle.h" 59 #include "core/style/ComputedStyle.h"
60 #include "platform/Length.h" 60 #include "platform/Length.h"
61 #include "platform/LengthBox.h" 61 #include "platform/LengthBox.h"
62 #include "wtf/StdLibExtras.h"
62 63
63 namespace blink { 64 namespace blink {
64 65
65 static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthWithZoom(const Le ngth& length, float zoom) 66 static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthWithZoom(const Le ngth& length, float zoom)
66 { 67 {
67 switch (length.type()) { 68 switch (length.type()) {
68 case Fixed: 69 case Fixed:
69 case Percent: 70 case Percent:
70 case Calculated: 71 case Calculated:
71 return AnimatableLength::create(length, zoom); 72 return AnimatableLength::create(length, zoom);
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 case CSSPropertyShapeOutside: 524 case CSSPropertyShapeOutside:
524 return createFromShapeValue(style.shapeOutside()); 525 return createFromShapeValue(style.shapeOutside());
525 case CSSPropertyShapeMargin: 526 case CSSPropertyShapeMargin:
526 return createFromLength(style.shapeMargin(), style); 527 return createFromLength(style.shapeMargin(), style);
527 case CSSPropertyShapeImageThreshold: 528 case CSSPropertyShapeImageThreshold:
528 return createFromDouble(style.shapeImageThreshold()); 529 return createFromDouble(style.shapeImageThreshold());
529 case CSSPropertyWebkitTextStrokeColor: 530 case CSSPropertyWebkitTextStrokeColor:
530 return createFromColor(property, style); 531 return createFromColor(property, style);
531 case CSSPropertyTransform: 532 case CSSPropertyTransform:
532 return AnimatableTransform::create(style.transform()); 533 return AnimatableTransform::create(style.transform());
533 case CSSPropertyTranslate: 534 case CSSPropertyTranslate:
Eric Willigers 2015/07/05 23:03:29 CSSPropertyTranslate: { with closing brace before
soonm 2015/07/05 23:40:45 These changes should not have been in this patch.
534 return createFromTransformProperties(style.translate(), style.initialTra nslate()); 535 DEFINE_STATIC_REF(TranslateTransformOperation, initialTranslate, Transla teTransformOperation::create(Length(0, Fixed), Length(0, Fixed), 0, TransformOpe ration::Translate3D));
536 return createFromTransformProperties(style.translate(), initialTranslate );
535 case CSSPropertyRotate: 537 case CSSPropertyRotate:
536 return createFromTransformProperties(style.rotate(), style.initialRotate ()); 538 DEFINE_STATIC_REF(RotateTransformOperation, initialRotate, RotateTransfo rmOperation::create(0, 0, 1, 0, TransformOperation::Rotate3D));
539 return createFromTransformProperties(style.rotate(), initialRotate);
537 case CSSPropertyScale: 540 case CSSPropertyScale:
538 return createFromTransformProperties(style.scale(), style.initialScale() ); 541 DEFINE_STATIC_REF(ScaleTransformOperation, initialScale, ScaleTransformO peration::create(1, 1, 1, TransformOperation::Scale3D));
542 return createFromTransformProperties(style.scale(), initialScale);
539 case CSSPropertyTransformOrigin: 543 case CSSPropertyTransformOrigin:
540 return createFromTransformOrigin(style.transformOrigin(), style); 544 return createFromTransformOrigin(style.transformOrigin(), style);
541 case CSSPropertyMotionOffset: 545 case CSSPropertyMotionOffset:
542 return createFromLength(style.motionOffset(), style); 546 return createFromLength(style.motionOffset(), style);
543 case CSSPropertyMotionRotation: 547 case CSSPropertyMotionRotation:
544 return createFromDoubleAndBool(style.motionRotation(), style.motionRotat ionType() == MotionRotationAuto, style); 548 return createFromDoubleAndBool(style.motionRotation(), style.motionRotat ionType() == MotionRotationAuto, style);
545 case CSSPropertyWebkitPerspectiveOriginX: 549 case CSSPropertyWebkitPerspectiveOriginX:
546 return createFromLength(style.perspectiveOriginX(), style); 550 return createFromLength(style.perspectiveOriginX(), style);
547 case CSSPropertyWebkitPerspectiveOriginY: 551 case CSSPropertyWebkitPerspectiveOriginY:
548 return createFromLength(style.perspectiveOriginY(), style); 552 return createFromLength(style.perspectiveOriginY(), style);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (style.hasAutoZIndex()) 586 if (style.hasAutoZIndex())
583 return AnimatableUnknown::create(CSSValueAuto); 587 return AnimatableUnknown::create(CSSValueAuto);
584 return createFromDouble(style.zIndex()); 588 return createFromDouble(style.zIndex());
585 default: 589 default:
586 ASSERT_NOT_REACHED(); 590 ASSERT_NOT_REACHED();
587 return nullptr; 591 return nullptr;
588 } 592 }
589 } 593 }
590 594
591 } // namespace blink 595 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/animation/KeyframeEffectModel.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698