| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 void TransformState::move(const LayoutSize& offset, TransformAccumulation accumu
late) | 69 void TransformState::move(const LayoutSize& offset, TransformAccumulation accumu
late) |
| 70 { | 70 { |
| 71 if (accumulate == FlattenTransform || !m_accumulatedTransform) { | 71 if (accumulate == FlattenTransform || !m_accumulatedTransform) { |
| 72 m_accumulatedOffset += offset; | 72 m_accumulatedOffset += offset; |
| 73 } else { | 73 } else { |
| 74 applyAccumulatedOffset(); | 74 applyAccumulatedOffset(); |
| 75 if (m_accumulatingTransform && m_accumulatedTransform) { | 75 if (m_accumulatingTransform && m_accumulatedTransform) { |
| 76 // If we're accumulating into an existing transform, apply the trans
lation. | 76 // If we're accumulating into an existing transform, apply the trans
lation. |
| 77 translateTransform(offset); | 77 translateTransform(offset); |
| 78 | |
| 79 // Then flatten if necessary. | |
| 80 if (accumulate == FlattenTransform) | |
| 81 flatten(); | |
| 82 } else { | 78 } else { |
| 83 // Just move the point and/or quad. | 79 // Just move the point and/or quad. |
| 84 translateMappedCoordinates(offset); | 80 translateMappedCoordinates(offset); |
| 85 } | 81 } |
| 86 } | 82 } |
| 87 m_accumulatingTransform = accumulate == AccumulateTransform; | 83 m_accumulatingTransform = accumulate == AccumulateTransform; |
| 88 } | 84 } |
| 89 | 85 |
| 90 void TransformState::applyAccumulatedOffset() | 86 void TransformState::applyAccumulatedOffset() |
| 91 { | 87 { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 | 197 |
| 202 // We could throw away m_accumulatedTransform if we wanted to here, but that | 198 // We could throw away m_accumulatedTransform if we wanted to here, but that |
| 203 // would cause thrash when traversing hierarchies with alternating | 199 // would cause thrash when traversing hierarchies with alternating |
| 204 // preserve-3d and flat elements. | 200 // preserve-3d and flat elements. |
| 205 if (m_accumulatedTransform) | 201 if (m_accumulatedTransform) |
| 206 m_accumulatedTransform->makeIdentity(); | 202 m_accumulatedTransform->makeIdentity(); |
| 207 m_accumulatingTransform = false; | 203 m_accumulatingTransform = false; |
| 208 } | 204 } |
| 209 | 205 |
| 210 } // namespace blink | 206 } // namespace blink |
| OLD | NEW |