summaryrefslogtreecommitdiff
path: root/Source/WebCore/rendering/HitTestingTransformState.cpp
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2016-04-10 09:28:39 +0000
commit32761a6cee1d0dee366b885b7b9c777e67885688 (patch)
treed6bec92bebfb216f4126356e55518842c2f476a1 /Source/WebCore/rendering/HitTestingTransformState.cpp
parenta4e969f4965059196ca948db781e52f7cfebf19e (diff)
downloadWebKitGtk-tarball-32761a6cee1d0dee366b885b7b9c777e67885688.tar.gz
webkitgtk-2.4.11webkitgtk-2.4.11
Diffstat (limited to 'Source/WebCore/rendering/HitTestingTransformState.cpp')
-rw-r--r--Source/WebCore/rendering/HitTestingTransformState.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/Source/WebCore/rendering/HitTestingTransformState.cpp b/Source/WebCore/rendering/HitTestingTransformState.cpp
index ff90450b8..cb3fc84b6 100644
--- a/Source/WebCore/rendering/HitTestingTransformState.cpp
+++ b/Source/WebCore/rendering/HitTestingTransformState.cpp
@@ -10,10 +10,10 @@
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
@@ -27,6 +27,7 @@
#include "HitTestingTransformState.h"
#include "LayoutRect.h"
+#include <wtf/PassOwnPtr.h>
namespace WebCore {
@@ -55,11 +56,10 @@ void HitTestingTransformState::flatten()
void HitTestingTransformState::flattenWithTransform(const TransformationMatrix& t)
{
- if (Optional<TransformationMatrix> inverse = t.inverse()) {
- m_lastPlanarPoint = inverse.value().projectPoint(m_lastPlanarPoint);
- m_lastPlanarQuad = inverse.value().projectQuad(m_lastPlanarQuad);
- m_lastPlanarArea = inverse.value().projectQuad(m_lastPlanarArea);
- }
+ TransformationMatrix inverseTransform = t.inverse();
+ m_lastPlanarPoint = inverseTransform.projectPoint(m_lastPlanarPoint);
+ m_lastPlanarQuad = inverseTransform.projectQuad(m_lastPlanarQuad);
+ m_lastPlanarArea = inverseTransform.projectQuad(m_lastPlanarArea);
m_accumulatedTransform.makeIdentity();
m_accumulatingTransform = false;
@@ -67,31 +67,22 @@ void HitTestingTransformState::flattenWithTransform(const TransformationMatrix&
FloatPoint HitTestingTransformState::mappedPoint() const
{
- if (auto inverse = m_accumulatedTransform.inverse())
- return inverse.value().projectPoint(m_lastPlanarPoint);
- return m_lastPlanarPoint;
+ return m_accumulatedTransform.inverse().projectPoint(m_lastPlanarPoint);
}
FloatQuad HitTestingTransformState::mappedQuad() const
{
- if (auto inverse = m_accumulatedTransform.inverse())
- return inverse.value().projectQuad(m_lastPlanarQuad);
- return m_lastPlanarQuad;
+ return m_accumulatedTransform.inverse().projectQuad(m_lastPlanarQuad);
}
FloatQuad HitTestingTransformState::mappedArea() const
{
- if (auto inverse = m_accumulatedTransform.inverse())
- return inverse.value().projectQuad(m_lastPlanarArea);
- return m_lastPlanarArea;
+ return m_accumulatedTransform.inverse().projectQuad(m_lastPlanarArea);
}
LayoutRect HitTestingTransformState::boundsOfMappedArea() const
{
- if (auto inverse = m_accumulatedTransform.inverse())
- return inverse.value().clampedBoundsOfProjectedQuad(m_lastPlanarArea);
- TransformationMatrix identity;
- return identity.clampedBoundsOfProjectedQuad(m_lastPlanarArea);
+ return m_accumulatedTransform.inverse().clampedBoundsOfProjectedQuad(m_lastPlanarArea);
}
} // namespace WebCore