summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/platform/graphics/qt/GraphicsContextQt.cpp
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/platform/graphics/qt/GraphicsContextQt.cpp')
-rw-r--r--WebCore/platform/graphics/qt/GraphicsContextQt.cpp30
1 files changed, 14 insertions, 16 deletions
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index ed7ac47..e259a4e 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -95,7 +95,8 @@ static inline QPainter::CompositionMode toQtCompositionMode(CompositeOperator op
case CompositeXOR:
return QPainter::CompositionMode_Xor;
case CompositePlusDarker:
- return QPainter::CompositionMode_SourceOver;
+ // there is no exact match, but this is the closest
+ return QPainter::CompositionMode_Darken;
case CompositeHighlight:
return QPainter::CompositionMode_SourceOver;
case CompositePlusLighter:
@@ -155,7 +156,7 @@ static Qt::PenStyle toQPenStyle(StrokeStyle style)
static inline Qt::FillRule toQtFillRule(WindRule rule)
{
- switch(rule) {
+ switch (rule) {
case RULE_EVENODD:
return Qt::OddEvenFill;
case RULE_NONZERO:
@@ -165,8 +166,7 @@ static inline Qt::FillRule toQtFillRule(WindRule rule)
return Qt::OddEvenFill;
}
-struct TransparencyLayer
-{
+struct TransparencyLayer {
TransparencyLayer(const QPainter* p, const QRect &rect)
: pixmap(rect.width(), rect.height())
{
@@ -198,8 +198,7 @@ private:
TransparencyLayer & operator=(const TransparencyLayer &) { return *this; }
};
-class GraphicsContextPlatformPrivate
-{
+class GraphicsContextPlatformPrivate {
public:
GraphicsContextPlatformPrivate(QPainter* painter);
~GraphicsContextPlatformPrivate();
@@ -217,7 +216,7 @@ public:
bool antiAliasingForRectsAndLines;
- QStack<TransparencyLayer *> layers;
+ QStack<TransparencyLayer*> layers;
QPainter* redirect;
QBrush solidColor;
@@ -242,9 +241,8 @@ GraphicsContextPlatformPrivate::GraphicsContextPlatformPrivate(QPainter* p)
antiAliasingForRectsAndLines = painter->testRenderHint(QPainter::Antialiasing);
// FIXME: Maybe only enable in SVG mode?
painter->setRenderHint(QPainter::Antialiasing, true);
- } else {
+ } else
antiAliasingForRectsAndLines = false;
- }
}
GraphicsContextPlatformPrivate::~GraphicsContextPlatformPrivate()
@@ -265,7 +263,7 @@ GraphicsContext::GraphicsContext(PlatformGraphicsContext* context)
GraphicsContext::~GraphicsContext()
{
- while(!m_data->layers.isEmpty())
+ while (!m_data->layers.isEmpty())
endTransparencyLayer();
destroyGraphicsContextPrivate(m_common);
@@ -280,7 +278,7 @@ PlatformGraphicsContext* GraphicsContext::platformContext() const
TransformationMatrix GraphicsContext::getCTM() const
{
QTransform matrix(platformContext()->combinedTransform());
- return TransformationMatrix(matrix.m11(), matrix.m12(), 0, matrix.m13(),
+ return TransformationMatrix(matrix.m11(), matrix.m12(), 0, matrix.m13(),
matrix.m21(), matrix.m22(), 0, matrix.m23(),
0, 0, 1, 0,
matrix.m31(), matrix.m32(), 0, matrix.m33());
@@ -763,7 +761,6 @@ void GraphicsContext::clipPath(WindRule clipRule)
* RenderTheme handles drawing focus on widgets which
* need it.
*/
-Color focusRingColor() { return Color(0, 0, 0); }
void GraphicsContext::drawFocusRing(const Color& color)
{
if (paintingDisabled())
@@ -1127,8 +1124,9 @@ void GraphicsContext::concatCTM(const TransformationMatrix& transform)
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.
+ // 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;
@@ -1211,7 +1209,7 @@ HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlpha
bitmapInfo.bmiHeader.biClrImportant = 0;
void* pixels = 0;
- HBITMAP bitmap = ::CreateDIBSection(NULL, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0);
+ HBITMAP bitmap = ::CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0);
if (!bitmap)
return 0;
@@ -1229,7 +1227,7 @@ HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlpha
memset(bmpInfo.bmBits, 0, bufferSize);
}
-#if !PLATFORM(WIN_CE)
+#if !PLATFORM(WINCE)
// Make sure we can do world transforms.
SetGraphicsMode(bitmapDC, GM_ADVANCED);