| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #ifndef TransformState_h | 26 #ifndef TransformState_h |
| 27 #define TransformState_h | 27 #define TransformState_h |
| 28 | 28 |
| 29 #include "platform/geometry/FloatPoint.h" | 29 #include "platform/geometry/FloatPoint.h" |
| 30 #include "platform/geometry/FloatQuad.h" | 30 #include "platform/geometry/FloatQuad.h" |
| 31 #include "platform/geometry/IntSize.h" | 31 #include "platform/geometry/IntSize.h" |
| 32 #include "platform/geometry/LayoutSize.h" | 32 #include "platform/geometry/LayoutSize.h" |
| 33 #include "platform/transforms/AffineTransform.h" | 33 #include "platform/transforms/AffineTransform.h" |
| 34 #include "platform/transforms/TransformationMatrix.h" | 34 #include "platform/transforms/TransformationMatrix.h" |
| 35 #include "wtf/Allocator.h" | 35 #include "wtf/Allocator.h" |
| 36 #include <memory> | 36 #include "wtf/OwnPtr.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class PLATFORM_EXPORT TransformState { | 40 class PLATFORM_EXPORT TransformState { |
| 41 STACK_ALLOCATED(); | 41 STACK_ALLOCATED(); |
| 42 public: | 42 public: |
| 43 enum TransformDirection { ApplyTransformDirection, UnapplyInverseTransformDi
rection }; | 43 enum TransformDirection { ApplyTransformDirection, UnapplyInverseTransformDi
rection }; |
| 44 enum TransformAccumulation { FlattenTransform, AccumulateTransform }; | 44 enum TransformAccumulation { FlattenTransform, AccumulateTransform }; |
| 45 | 45 |
| 46 TransformState(TransformDirection mappingDirection, const FloatPoint& p, con
st FloatQuad& quad) | 46 TransformState(TransformDirection mappingDirection, const FloatPoint& p, con
st FloatQuad& quad) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 private: | 126 private: |
| 127 void translateTransform(const LayoutSize&); | 127 void translateTransform(const LayoutSize&); |
| 128 void translateMappedCoordinates(const LayoutSize&); | 128 void translateMappedCoordinates(const LayoutSize&); |
| 129 void flattenWithTransform(const TransformationMatrix&, bool* wasClamped); | 129 void flattenWithTransform(const TransformationMatrix&, bool* wasClamped); |
| 130 void applyAccumulatedOffset(); | 130 void applyAccumulatedOffset(); |
| 131 | 131 |
| 132 FloatPoint m_lastPlanarPoint; | 132 FloatPoint m_lastPlanarPoint; |
| 133 FloatQuad m_lastPlanarQuad; | 133 FloatQuad m_lastPlanarQuad; |
| 134 | 134 |
| 135 // We only allocate the transform if we need to | 135 // We only allocate the transform if we need to |
| 136 std::unique_ptr<TransformationMatrix> m_accumulatedTransform; | 136 OwnPtr<TransformationMatrix> m_accumulatedTransform; |
| 137 LayoutSize m_accumulatedOffset; | 137 LayoutSize m_accumulatedOffset; |
| 138 bool m_accumulatingTransform; | 138 bool m_accumulatingTransform; |
| 139 bool m_forceAccumulatingTransform; | 139 bool m_forceAccumulatingTransform; |
| 140 bool m_mapPoint, m_mapQuad; | 140 bool m_mapPoint, m_mapQuad; |
| 141 TransformDirection m_direction; | 141 TransformDirection m_direction; |
| 142 }; | 142 }; |
| 143 | 143 |
| 144 } // namespace blink | 144 } // namespace blink |
| 145 | 145 |
| 146 #endif // TransformState_h | 146 #endif // TransformState_h |
| OLD | NEW |