| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
| 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual void apply(TransformationMatrix&, | 76 virtual void apply(TransformationMatrix&, |
| 77 const FloatSize& borderBoxSize) const = 0; | 77 const FloatSize& borderBoxSize) const = 0; |
| 78 | 78 |
| 79 virtual PassRefPtr<TransformOperation> blend( | 79 virtual PassRefPtr<TransformOperation> blend( |
| 80 const TransformOperation* from, | 80 const TransformOperation* from, |
| 81 double progress, | 81 double progress, |
| 82 bool blendToIdentity = false) = 0; | 82 bool blendToIdentity = false) = 0; |
| 83 virtual PassRefPtr<TransformOperation> zoom(double factor) = 0; | 83 virtual PassRefPtr<TransformOperation> zoom(double factor) = 0; |
| 84 | 84 |
| 85 virtual OperationType type() const = 0; | 85 virtual OperationType type() const = 0; |
| 86 |
| 87 // https://drafts.csswg.org/css-transforms/#transform-primitives |
| 88 virtual OperationType primitiveType() const { return type(); } |
| 89 |
| 86 bool isSameType(const TransformOperation& other) const { | 90 bool isSameType(const TransformOperation& other) const { |
| 87 return other.type() == type(); | 91 return other.type() == type(); |
| 88 } | 92 } |
| 89 virtual bool canBlendWith(const TransformOperation& other) const = 0; | 93 virtual bool canBlendWith(const TransformOperation& other) const = 0; |
| 90 | 94 |
| 91 bool is3DOperation() const { | 95 bool is3DOperation() const { |
| 92 OperationType opType = type(); | 96 OperationType opType = type(); |
| 93 return opType == ScaleZ || opType == Scale3D || opType == TranslateZ || | 97 return opType == ScaleZ || opType == Scale3D || opType == TranslateZ || |
| 94 opType == Translate3D || opType == RotateX || opType == RotateY || | 98 opType == Translate3D || opType == RotateX || opType == RotateY || |
| 95 opType == Rotate3D || opType == Matrix3D || opType == Perspective || | 99 opType == Rotate3D || opType == Matrix3D || opType == Perspective || |
| 96 opType == Interpolated; | 100 opType == Interpolated; |
| 97 } | 101 } |
| 98 | 102 |
| 99 virtual bool dependsOnBoxSize() const { return false; } | 103 virtual bool dependsOnBoxSize() const { return false; } |
| 100 }; | 104 }; |
| 101 | 105 |
| 102 #define DEFINE_TRANSFORM_TYPE_CASTS(thisType) \ | 106 #define DEFINE_TRANSFORM_TYPE_CASTS(thisType) \ |
| 103 DEFINE_TYPE_CASTS(thisType, TransformOperation, transform, \ | 107 DEFINE_TYPE_CASTS(thisType, TransformOperation, transform, \ |
| 104 thisType::isMatchingOperationType(transform->type()), \ | 108 thisType::isMatchingOperationType(transform->type()), \ |
| 105 thisType::isMatchingOperationType(transform.type())) | 109 thisType::isMatchingOperationType(transform.type())) |
| 106 | 110 |
| 107 } // namespace blink | 111 } // namespace blink |
| 108 | 112 |
| 109 #endif // TransformOperation_h | 113 #endif // TransformOperation_h |
| OLD | NEW |