Commit a024281b authored by ariya@webkit.org's avatar ariya@webkit.org

WebCore:

2009-04-29  Ariya Hidayat  <ariya.hidayat@nokia.com>

        Reviewed by Simon Fraser.

        [Qt] Initialize GraphicsContext's and ImageBuffer's QPainter to match
        the default values of canvas attributes.

        * platform/graphics/qt/ImageBufferQt.cpp:
        (WebCore::ImageBufferData::ImageBufferData):

LayoutTests:

2009-04-29  Ariya Hidayat  <ariya.hidayat@nokia.com>

        Reviewed by Simon Fraser.

        Updated expected results after Qt's GraphicsContext fixes.

        * platform/qt/fast/canvas/set-colors-expected.txt:

git-svn-id: svn://svn.chromium.org/blink/trunk@42996 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b7297d10
2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com>
Reviewed by Simon Fraser.
Updated expected results after Qt's GraphicsContext fixes.
* platform/qt/fast/canvas/set-colors-expected.txt:
2009-04-28 Alexey Proskuryakov <ap@webkit.org> 2009-04-28 Alexey Proskuryakov <ap@webkit.org>
Fix the test for <https://bugs.webkit.org/show_bug.cgi?id=25420> - I broke it when Fix the test for <https://bugs.webkit.org/show_bug.cgi?id=25420> - I broke it when
...@@ -62,8 +62,8 @@ PASS testSetStrokeColor('1') is white ...@@ -62,8 +62,8 @@ PASS testSetStrokeColor('1') is white
PASS testSetStrokeColor('1, 0.8') is translucentWhite PASS testSetStrokeColor('1, 0.8') is translucentWhite
PASS testSetStrokeColor('0, 1, 0, 1') is green PASS testSetStrokeColor('0, 1, 0, 1') is green
PASS testSetStrokeColor('0, 1, 0, 0.8') is translucentGreen PASS testSetStrokeColor('0, 1, 0, 0.8') is translucentGreen
FAIL testSetStrokeColor('0, 0, 0, 1, 1') should be #1a1a1a. Was rgba(0, 0, 0, 0.12549019607843137). FAIL testSetStrokeColor('0, 0, 0, 1, 1') should be #1a1a1a. Was #000000.
FAIL testSetStrokeColor('0, 0, 0, 1, 0.8') should be rgba(25, 25, 25, 0.8). Was rgba(0, 0, 0, 0.10196078431372549). FAIL testSetStrokeColor('0, 0, 0, 1, 0.8') should be rgba(25, 25, 25, 0.8). Was rgba(0, 0, 0, 0.8).
PASS testSetStrokeColor('0, 0, 0, 1, 0') is transparent PASS testSetStrokeColor('0, 0, 0, 1, 0') is transparent
PASS successfullyParsed is true PASS successfullyParsed is true
......
2009-04-29 Ariya Hidayat <ariya.hidayat@nokia.com>
Reviewed by Simon Fraser.
[Qt] Initialize GraphicsContext's and ImageBuffer's QPainter to match
the default values of canvas attributes.
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::ImageBufferData::ImageBufferData):
2009-04-28 Simon Hausmann <simon.hausmann@nokia.com> 2009-04-28 Simon Hausmann <simon.hausmann@nokia.com>
Fix the Qt build. Fix the Qt build.
...@@ -47,7 +47,24 @@ ImageBufferData::ImageBufferData(const IntSize& size) ...@@ -47,7 +47,24 @@ ImageBufferData::ImageBufferData(const IntSize& size)
: m_pixmap(size) : m_pixmap(size)
{ {
m_pixmap.fill(QColor(Qt::transparent)); m_pixmap.fill(QColor(Qt::transparent));
m_painter.set(new QPainter(&m_pixmap));
QPainter* painter = new QPainter(&m_pixmap);
m_painter.set(painter);
// Since ImageBuffer is used mainly for Canvas, explicitly initialize
// its painter's pen and brush with the corresponding canvas defaults
// NOTE: keep in sync with CanvasRenderingContext2D::State
QPen pen = painter->pen();
pen.setColor(Qt::black);
pen.setWidth(1);
pen.setCapStyle(Qt::FlatCap);
pen.setJoinStyle(Qt::MiterJoin);
pen.setMiterLimit(10);
painter->setPen(pen);
QBrush brush = painter->brush();
brush.setColor(Qt::black);
painter->setBrush(brush);
painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
} }
ImageBuffer::ImageBuffer(const IntSize& size, bool grayScale, bool& success) ImageBuffer::ImageBuffer(const IntSize& size, bool grayScale, bool& success)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment