summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-05 14:27:46 +0000
committerSteve Block <steveblock@google.com>2010-02-15 10:49:50 +0000
commit5e2bc6953fe6923165b8a5d7679939693a1d58d6 (patch)
tree6ccb8c24bc2bf5e8f413e6cfae250b729b426631 /WebCore/platform/graphics/qt/GraphicsContextQt.cpp
parent4a00f4fccc3cb7e9996749a05631f5d7b9de756e (diff)
downloadexternal_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.zip
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.gz
external_webkit-5e2bc6953fe6923165b8a5d7679939693a1d58d6.tar.bz2
Merge webkit.org at r54340 : Initial merge by git
Change-Id: Ib489d2ff91186ea3652522e1d586e54416a2cf44
Diffstat (limited to 'WebCore/platform/graphics/qt/GraphicsContextQt.cpp')
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index b78a6e8..9046449 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -40,6 +40,7 @@
#include <windows.h>
#endif
+#include "AffineTransform.h"
#include "Color.h"
#include "FloatConversion.h"
#include "Font.h"
@@ -275,6 +276,13 @@ PlatformGraphicsContext* GraphicsContext::platformContext() const
return m_data->p();
}
+AffineTransform GraphicsContext::getAffineCTM() const
+{
+ QTransform matrix(platformContext()->combinedTransform());
+ return AffineTransform(matrix.m11(), matrix.m12(), matrix.m21(),
+ matrix.m22(), matrix.dx(), matrix.dy());
+}
+
TransformationMatrix GraphicsContext::getCTM() const
{
QTransform matrix(platformContext()->combinedTransform());
@@ -1188,6 +1196,24 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect,
p->setRenderHint(QPainter::Antialiasing, antiAlias);
}
+void GraphicsContext::concatCTM(const AffineTransform& transform)
+{
+ if (paintingDisabled())
+ return;
+
+ m_data->p()->setWorldTransform(transform, true);
+
+ // Transformations to the context shouldn't transform the currentPath.
+ // We have to undo every change made to the context from the currentPath
+ // to avoid wrong drawings.
+ if (!m_data->currentPath.isEmpty() && transform.isInvertible()) {
+ QTransform matrix = transform.inverse();
+ m_data->currentPath = m_data->currentPath * matrix;
+ m_common->state.pathTransform.multiply(transform.toTransformationMatrix());
+ }
+}
+
+
void GraphicsContext::concatCTM(const TransformationMatrix& transform)
{
if (paintingDisabled())