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

Unified Diff: third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h

Issue 2478233002: Make 'transform' a presentation attribute on SVG elements (Closed)
Patch Set: Rebase Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
diff --git a/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h b/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
index c92f6ae71661a481c7acfb843faf3be1ed615cfc..e1f0cc434ac338518a001acfdcb592d95e9c3b36 100644
--- a/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
+++ b/third_party/WebKit/Source/platform/transforms/RotateTransformOperation.h
@@ -31,8 +31,7 @@
namespace blink {
-class PLATFORM_EXPORT RotateTransformOperation final
- : public TransformOperation {
+class PLATFORM_EXPORT RotateTransformOperation : public TransformOperation {
public:
static PassRefPtr<RotateTransformOperation> create(double angle,
OperationType type) {
@@ -49,6 +48,7 @@ class PLATFORM_EXPORT RotateTransformOperation final
static PassRefPtr<RotateTransformOperation> create(const Rotation& rotation,
OperationType type) {
+ DCHECK(isMatchingOperationType(type));
return adoptRef(new RotateTransformOperation(rotation, type));
}
@@ -77,17 +77,16 @@ class PLATFORM_EXPORT RotateTransformOperation final
type == RotateZ || type == Rotate3D;
}
- private:
+ protected:
bool operator==(const TransformOperation&) const override;
PassRefPtr<TransformOperation> blend(const TransformOperation* from,
double progress,
bool blendToIdentity = false) override;
- PassRefPtr<TransformOperation> zoom(double factor) final { return this; }
+ PassRefPtr<TransformOperation> zoom(double factor) override { return this; }
RotateTransformOperation(const Rotation& rotation, OperationType type)
: m_rotation(rotation), m_type(type) {
- ASSERT(isMatchingOperationType(type));
}
const Rotation m_rotation;
@@ -96,6 +95,39 @@ class PLATFORM_EXPORT RotateTransformOperation final
DEFINE_TRANSFORM_TYPE_CASTS(RotateTransformOperation);
+class PLATFORM_EXPORT RotateAroundOriginTransformOperation final
+ : public RotateTransformOperation {
+ public:
+ static PassRefPtr<RotateAroundOriginTransformOperation>
+ create(double angle, double originX, double originY) {
+ return adoptRef(
+ new RotateAroundOriginTransformOperation(angle, originX, originY));
+ }
+
+ void apply(TransformationMatrix&, const FloatSize&) const override;
+
+ static bool isMatchingOperationType(OperationType type) {
+ return type == RotateAroundOrigin;
+ }
+
+ private:
+ RotateAroundOriginTransformOperation(double angle,
+ double originX,
+ double originY);
+
+ bool operator==(const TransformOperation&) const override;
+
+ PassRefPtr<TransformOperation> blend(const TransformOperation* from,
+ double progress,
+ bool blendToIdentity = false) override;
+ PassRefPtr<TransformOperation> zoom(double factor) override;
+
+ double m_originX;
+ double m_originY;
+};
+
+DEFINE_TRANSFORM_TYPE_CASTS(RotateAroundOriginTransformOperation);
+
} // namespace blink
#endif // RotateTransformOperation_h

Powered by Google App Engine
This is Rietveld 408576698