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

Side by Side Diff: Source/platform/transforms/ScaleTransformOperation.h

Issue 1158603003: CSS Independent Transform Properties (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 /* 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 23 matching lines...) Expand all
34 static PassRefPtr<ScaleTransformOperation> create(double sx, double sy, Oper ationType type) 34 static PassRefPtr<ScaleTransformOperation> create(double sx, double sy, Oper ationType type)
35 { 35 {
36 return adoptRef(new ScaleTransformOperation(sx, sy, 1, type)); 36 return adoptRef(new ScaleTransformOperation(sx, sy, 1, type));
37 } 37 }
38 38
39 static PassRefPtr<ScaleTransformOperation> create(double sx, double sy, doub le sz, OperationType type) 39 static PassRefPtr<ScaleTransformOperation> create(double sx, double sy, doub le sz, OperationType type)
40 { 40 {
41 return adoptRef(new ScaleTransformOperation(sx, sy, sz, type)); 41 return adoptRef(new ScaleTransformOperation(sx, sy, sz, type));
42 } 42 }
43 43
44 static PassRefPtr<ScaleTransformOperation> create(PassRefPtr<ScaleTransformO peration> o)
45 {
46 return adoptRef(new ScaleTransformOperation(*o));
47 }
44 double x() const { return m_x; } 48 double x() const { return m_x; }
45 double y() const { return m_y; } 49 double y() const { return m_y; }
46 double z() const { return m_z; } 50 double z() const { return m_z; }
47 51
48 virtual bool canBlendWith(const TransformOperation& other) const; 52 virtual bool canBlendWith(const TransformOperation& other) const;
53 virtual OperationType type() const override { return m_type; }
49 54
50 private: 55 private:
51 virtual OperationType type() const override { return m_type; }
52 56
53 virtual bool operator==(const TransformOperation& o) const override 57 virtual bool operator==(const TransformOperation& o) const override
54 { 58 {
55 if (!isSameType(o)) 59 if (!isSameType(o))
56 return false; 60 return false;
57 const ScaleTransformOperation* s = static_cast<const ScaleTransformOpera tion*>(&o); 61 const ScaleTransformOperation* s = static_cast<const ScaleTransformOpera tion*>(&o);
58 return m_x == s->m_x && m_y == s->m_y && m_z == s->m_z; 62 return m_x == s->m_x && m_y == s->m_y && m_z == s->m_z;
59 } 63 }
60 64
61 virtual void apply(TransformationMatrix& transform, const FloatSize&) const override 65 virtual void apply(TransformationMatrix& transform, const FloatSize&) const override
62 { 66 {
63 transform.scale3d(m_x, m_y, m_z); 67 transform.scale3d(m_x, m_y, m_z);
64 } 68 }
65 69
66 virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) override; 70 virtual PassRefPtr<TransformOperation> blend(const TransformOperation* from, double progress, bool blendToIdentity = false) override;
67 71
68 ScaleTransformOperation(double sx, double sy, double sz, OperationType type) 72 ScaleTransformOperation(double sx, double sy, double sz, OperationType type)
69 : m_x(sx) 73 : m_x(sx)
70 , m_y(sy) 74 , m_y(sy)
71 , m_z(sz) 75 , m_z(sz)
72 , m_type(type) 76 , m_type(type)
73 { 77 {
74 ASSERT(type == ScaleX || type == ScaleY || type == ScaleZ || type == Sca le || type == Scale3D); 78 ASSERT(type == ScaleX || type == ScaleY || type == ScaleZ || type == Sca le || type == Scale3D);
75 } 79 }
76 80
81 ScaleTransformOperation(const ScaleTransformOperation& o)
82 : m_x(o.m_x)
83 , m_y(o.m_y)
84 , m_z(o.m_z)
85 , m_type(o.m_type)
86 {
87 }
88
77 double m_x; 89 double m_x;
78 double m_y; 90 double m_y;
79 double m_z; 91 double m_z;
80 OperationType m_type; 92 OperationType m_type;
81 }; 93 };
82 94
83 } // namespace blink 95 } // namespace blink
84 96
85 #endif // ScaleTransformOperation_h 97 #endif // ScaleTransformOperation_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698