summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-08-19 12:44:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-19 14:07:25 +0200
commit44f742938e2224a842ce3de68c4a2e508d0f17f8 (patch)
tree8d44c97f97596712a5e1238a939cdf277e42f8bc
parent60ba8bd5b3575d0c7740571fbb4e681b21a49a82 (diff)
downloadqtwebkit-44f742938e2224a842ce3de68c4a2e508d0f17f8.tar.gz
[Qt] QtWebKit (using the Arora browser) displays the border radii (radius) of a button very ugly
https://bugs.webkit.org/show_bug.cgi?id=28113 Reviewed by Jocelyn Turcotte. StylePainter::init() was called twice making it clobber the previous antialiasing setting. This patch cleans up the construction so we only have one constructor with init inlined. * platform/qt/RenderThemeQStyle.cpp: (WebCore::StylePainterQStyle::StylePainterQStyle): (WebCore::StylePainterQStyle::setupStyleOption): * platform/qt/RenderThemeQStyle.h: * platform/qt/RenderThemeQt.cpp: (WebCore::StylePainter::StylePainter): * platform/qt/RenderThemeQt.h: * platform/qt/RenderThemeQtMobile.cpp: (WebCore::StylePainterMobile::StylePainterMobile): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154270 268f45cc-cd09-0410-ab3c-d52691b4dbfc Task-number: QTWEBKIt-355 Change-Id: I5f9e50ccc3deeb1ac1c1714c010d766f4ea29908 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
-rw-r--r--Source/WebCore/platform/qt/RenderThemeQStyle.cpp13
-rw-r--r--Source/WebCore/platform/qt/RenderThemeQStyle.h2
-rw-r--r--Source/WebCore/platform/qt/RenderThemeQt.cpp18
-rw-r--r--Source/WebCore/platform/qt/RenderThemeQt.h4
-rw-r--r--Source/WebCore/platform/qt/RenderThemeQtMobile.cpp2
5 files changed, 11 insertions, 28 deletions
diff --git a/Source/WebCore/platform/qt/RenderThemeQStyle.cpp b/Source/WebCore/platform/qt/RenderThemeQStyle.cpp
index e55c75c6e..b2fa5d7da 100644
--- a/Source/WebCore/platform/qt/RenderThemeQStyle.cpp
+++ b/Source/WebCore/platform/qt/RenderThemeQStyle.cpp
@@ -68,33 +68,30 @@ QSharedPointer<StylePainter> RenderThemeQStyle::getStylePainter(const PaintInfo&
}
StylePainterQStyle::StylePainterQStyle(RenderThemeQStyle* theme, const PaintInfo& paintInfo, RenderObject* renderObject)
- : StylePainter(theme, paintInfo)
+ : StylePainter(paintInfo.context)
, qStyle(theme->qStyle())
, appearance(NoControlPart)
{
- init(paintInfo.context ? paintInfo.context : 0);
+ setupStyleOption();
if (renderObject)
appearance = theme->initializeCommonQStyleOptions(styleOption, renderObject);
}
StylePainterQStyle::StylePainterQStyle(ScrollbarThemeQStyle* theme, GraphicsContext* context)
- : StylePainter()
+ : StylePainter(context)
, qStyle(theme->qStyle())
, appearance(NoControlPart)
{
- init(context);
+ setupStyleOption();
}
-void StylePainterQStyle::init(GraphicsContext* context)
+void StylePainterQStyle::setupStyleOption()
{
- painter = static_cast<QPainter*>(context->platformContext());
if (QObject* widget = qStyle->widgetForPainter(painter)) {
styleOption.palette = widget->property("palette").value<QPalette>();
styleOption.rect = widget->property("rect").value<QRect>();
styleOption.direction = static_cast<Qt::LayoutDirection>(widget->property("layoutDirection").toInt());
}
-
- StylePainter::init(context);
}
PassRefPtr<RenderTheme> RenderThemeQStyle::create(Page* page)
diff --git a/Source/WebCore/platform/qt/RenderThemeQStyle.h b/Source/WebCore/platform/qt/RenderThemeQStyle.h
index 08c18b971..6027f16e5 100644
--- a/Source/WebCore/platform/qt/RenderThemeQStyle.h
+++ b/Source/WebCore/platform/qt/RenderThemeQStyle.h
@@ -148,7 +148,7 @@ public:
{ qStyle->paintScrollBar(painter, styleOption); }
private:
- void init(GraphicsContext*);
+ void setupStyleOption();
Q_DISABLE_COPY(StylePainterQStyle)
};
diff --git a/Source/WebCore/platform/qt/RenderThemeQt.cpp b/Source/WebCore/platform/qt/RenderThemeQt.cpp
index e09b50dbe..4f3f3ad10 100644
--- a/Source/WebCore/platform/qt/RenderThemeQt.cpp
+++ b/Source/WebCore/platform/qt/RenderThemeQt.cpp
@@ -873,22 +873,10 @@ String RenderThemeQt::fileListNameForWidth(const FileList* fileList, const Font&
return string;
}
-StylePainter::StylePainter(RenderThemeQt* theme, const PaintInfo& paintInfo)
- : painter(0)
+StylePainter::StylePainter(GraphicsContext* context)
+ : painter(context->platformContext())
{
- Q_UNUSED(theme);
- ASSERT(paintInfo.context);
- init(paintInfo.context);
-}
-
-StylePainter::StylePainter()
- : painter(0)
-{
-}
-
-void StylePainter::init(GraphicsContext* context)
-{
- painter = static_cast<QPainter*>(context->platformContext());
+ ASSERT(context);
if (painter) {
// the styles often assume being called with a pristine painter where no brush is set,
diff --git a/Source/WebCore/platform/qt/RenderThemeQt.h b/Source/WebCore/platform/qt/RenderThemeQt.h
index f16b50f33..cac006942 100644
--- a/Source/WebCore/platform/qt/RenderThemeQt.h
+++ b/Source/WebCore/platform/qt/RenderThemeQt.h
@@ -190,9 +190,7 @@ public:
QPainter* painter;
protected:
- StylePainter(RenderThemeQt*, const PaintInfo&);
- StylePainter();
- void init(GraphicsContext*);
+ StylePainter(GraphicsContext*);
private:
QBrush m_previousBrush;
diff --git a/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp b/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp
index 702eda4cd..1eee832cd 100644
--- a/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp
+++ b/Source/WebCore/platform/qt/RenderThemeQtMobile.cpp
@@ -209,7 +209,7 @@ QPalette RenderThemeQtMobile::colorPalette() const
}
StylePainterMobile::StylePainterMobile(RenderThemeQtMobile* theme, const PaintInfo& paintInfo)
- : StylePainter(theme, paintInfo)
+ : StylePainter(paintInfo.context)
{
m_previousSmoothPixmapTransform = painter->testRenderHint(QPainter::SmoothPixmapTransform);
if (!m_previousSmoothPixmapTransform)