Index: third_party/WebKit/Source/platform/geometry/TransformState.cpp |
diff --git a/third_party/WebKit/Source/platform/geometry/TransformState.cpp b/third_party/WebKit/Source/platform/geometry/TransformState.cpp |
index 9ec2073661391dd75f49b5aa40f7459213729c7b..9a35f7ebae253d6ab9930d0395596f7ea0b822b3 100644 |
--- a/third_party/WebKit/Source/platform/geometry/TransformState.cpp |
+++ b/third_party/WebKit/Source/platform/geometry/TransformState.cpp |
@@ -39,6 +39,7 @@ TransformState& TransformState::operator=(const TransformState& other) |
if (m_mapQuad) |
m_lastPlanarQuad = other.m_lastPlanarQuad; |
m_accumulatingTransform = other.m_accumulatingTransform; |
+ m_forceAccumulatingTransform = other.m_forceAccumulatingTransform; |
m_direction = other.m_direction; |
m_accumulatedTransform.clear(); |
@@ -68,6 +69,9 @@ void TransformState::translateMappedCoordinates(const LayoutSize& offset) |
void TransformState::move(const LayoutSize& offset, TransformAccumulation accumulate) |
{ |
+ if (m_forceAccumulatingTransform) |
+ accumulate = AccumulateTransform; |
+ |
if (accumulate == FlattenTransform || !m_accumulatedTransform) { |
m_accumulatedOffset += offset; |
} else { |
@@ -108,6 +112,9 @@ void TransformState::applyTransform(const TransformationMatrix& transformFromCon |
if (wasClamped) |
*wasClamped = false; |
+ if (m_forceAccumulatingTransform) |
chrishtr
2016/03/10 16:53:39
I don't think this works in the case of a flatteni
dmazzoni
2016/03/14 20:10:37
Good catch. Fixed this and added a new test.
|
+ accumulate = AccumulateTransform; |
+ |
if (transformFromContainer.isIntegerTranslation()) { |
move(LayoutSize(LayoutUnit(transformFromContainer.e()), LayoutUnit(transformFromContainer.f())), accumulate); |
return; |
@@ -135,6 +142,7 @@ void TransformState::applyTransform(const TransformationMatrix& transformFromCon |
void TransformState::flatten(bool* wasClamped) |
{ |
+ ASSERT(!m_forceAccumulatingTransform); |
if (wasClamped) |
*wasClamped = false; |
@@ -180,6 +188,12 @@ FloatQuad TransformState::mappedQuad(bool* wasClamped) const |
return m_accumulatedTransform->inverse().projectQuad(quad, wasClamped); |
} |
+const TransformationMatrix& TransformState::accumulatedTransform() const |
+{ |
+ ASSERT(m_forceAccumulatingTransform && m_accumulatingTransform); |
+ return *m_accumulatedTransform; |
+} |
+ |
void TransformState::flattenWithTransform(const TransformationMatrix& t, bool* wasClamped) |
{ |
if (m_direction == ApplyTransformDirection) { |