OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 namespace WebCore { | 36 namespace WebCore { |
37 | 37 |
38 bool InterpolatedTransformOperation::operator==(const TransformOperation& o) con
st | 38 bool InterpolatedTransformOperation::operator==(const TransformOperation& o) con
st |
39 { | 39 { |
40 if (!isSameType(o)) | 40 if (!isSameType(o)) |
41 return false; | 41 return false; |
42 const InterpolatedTransformOperation* t = static_cast<const InterpolatedTran
sformOperation*>(&o); | 42 const InterpolatedTransformOperation* t = static_cast<const InterpolatedTran
sformOperation*>(&o); |
43 return progress == t->progress && from == t->from && to == t->to; | 43 return progress == t->progress && from == t->from && to == t->to; |
44 } | 44 } |
45 | 45 |
46 bool InterpolatedTransformOperation::apply(TransformationMatrix& transform, cons
t FloatSize& borderBoxSize) const | 46 bool InterpolatedTransformOperation::apply(TransformationMatrix& transform, cons
t FloatSize& borderBoxSize, RenderView* renderView) const |
47 { | 47 { |
48 TransformationMatrix fromTransform; | 48 TransformationMatrix fromTransform; |
49 TransformationMatrix toTransform; | 49 TransformationMatrix toTransform; |
50 from.apply(borderBoxSize, fromTransform); | 50 from.apply(borderBoxSize, fromTransform, renderView); |
51 to.apply(borderBoxSize, toTransform); | 51 to.apply(borderBoxSize, toTransform, renderView); |
52 | 52 |
53 toTransform.blend(fromTransform, progress); | 53 toTransform.blend(fromTransform, progress); |
54 transform.multiply(toTransform); | 54 transform.multiply(toTransform); |
55 return true; | 55 return true; |
56 } | 56 } |
57 | 57 |
58 PassRefPtr<TransformOperation> InterpolatedTransformOperation::blend(const Trans
formOperation* from, double progress, bool blendToIdentity) | 58 PassRefPtr<TransformOperation> InterpolatedTransformOperation::blend(const Trans
formOperation* from, double progress, bool blendToIdentity, RenderView* renderVi
ew) |
59 { | 59 { |
60 if (from && !from->isSameType(*this)) | 60 if (from && !from->isSameType(*this)) |
61 return this; | 61 return this; |
62 | 62 |
63 TransformOperations thisOperations; | 63 TransformOperations thisOperations; |
64 thisOperations.operations().append(this); | 64 thisOperations.operations().append(this); |
65 TransformOperations fromOperations; | 65 TransformOperations fromOperations; |
66 if (blendToIdentity) | 66 if (blendToIdentity) |
67 fromOperations.operations().append(IdentityTransformOperation::create())
; | 67 fromOperations.operations().append(IdentityTransformOperation::create())
; |
68 else | 68 else |
69 fromOperations.operations().append(const_cast<TransformOperation*>(from)
); | 69 fromOperations.operations().append(const_cast<TransformOperation*>(from)
); |
70 return InterpolatedTransformOperation::create(thisOperations, fromOperations
, progress); | 70 return InterpolatedTransformOperation::create(thisOperations, fromOperations
, progress); |
71 } | 71 } |
72 | 72 |
73 } // namespace WebCore | 73 } // namespace WebCore |
74 | 74 |
OLD | NEW |