diff options
author | Kristian Monsen <kristianm@google.com> | 2010-09-30 15:42:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-10-07 10:59:29 +0100 |
commit | bec39347bb3bb5bf1187ccaf471d26247f28b585 (patch) | |
tree | 56bdc4c2978fbfd3d79d0d36d5d6c640ecc09cc8 /WebCore/platform/graphics/qt/FontQt.cpp | |
parent | 90b7966e7815b262cd19ac25f03aaad9b21fdc06 (diff) | |
download | external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.zip external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.gz external_webkit-bec39347bb3bb5bf1187ccaf471d26247f28b585.tar.bz2 |
Merge WebKit at r68651 : Initial merge by git.
Change-Id: I3d6bff59f17eedd6722723354f386fec9be8ad12
Diffstat (limited to 'WebCore/platform/graphics/qt/FontQt.cpp')
-rw-r--r-- | WebCore/platform/graphics/qt/FontQt.cpp | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/WebCore/platform/graphics/qt/FontQt.cpp b/WebCore/platform/graphics/qt/FontQt.cpp index 2b246de..e7566eb 100644 --- a/WebCore/platform/graphics/qt/FontQt.cpp +++ b/WebCore/platform/graphics/qt/FontQt.cpp @@ -125,37 +125,38 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float ContextShadow* ctxShadow = ctx->contextShadow(); - if (ctxShadow->type != ContextShadow::NoShadow) { + if (ctxShadow->m_type != ContextShadow::NoShadow) { qreal dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0; - if (ctxShadow->offset.x() > 0) - dx2 = ctxShadow->offset.x(); + if (ctxShadow->offset().x() > 0) + dx2 = ctxShadow->offset().x(); else - dx1 = -ctxShadow->offset.x(); - if (ctxShadow->offset.y() > 0) - dy2 = ctxShadow->offset.y(); + dx1 = -ctxShadow->offset().x(); + if (ctxShadow->offset().y() > 0) + dy2 = ctxShadow->offset().y(); else - dy1 = -ctxShadow->offset.y(); + dy1 = -ctxShadow->offset().y(); // expand the clip rect to include the text shadow as well clip.adjust(dx1, dx2, dy1, dy2); - clip.adjust(-ctxShadow->blurRadius, -ctxShadow->blurRadius, ctxShadow->blurRadius, ctxShadow->blurRadius); + clip.adjust(-ctxShadow->m_blurRadius, -ctxShadow->m_blurRadius, ctxShadow->m_blurRadius, ctxShadow->m_blurRadius); } p->save(); p->setClipRect(clip.toRect(), Qt::IntersectClip); pt.setY(pt.y() - ascent); - if (ctxShadow->type != ContextShadow::NoShadow) { + if (ctxShadow->m_type != ContextShadow::NoShadow) { ContextShadow* ctxShadow = ctx->contextShadow(); - if (ctxShadow->type != ContextShadow::BlurShadow) { + if (ctxShadow->m_type != ContextShadow::BlurShadow) { p->save(); - p->setPen(ctxShadow->color); - p->translate(ctxShadow->offset); + p->setPen(ctxShadow->m_color); + p->translate(ctxShadow->offset()); line.draw(p, pt); p->restore(); } else { QPainter* shadowPainter = ctxShadow->beginShadowLayer(p, boundingRect); if (shadowPainter) { // Since it will be blurred anyway, we don't care about render hints. - shadowPainter->setPen(ctxShadow->color); + shadowPainter->setFont(p->font()); + shadowPainter->setPen(ctxShadow->m_color); line.draw(shadowPainter, pt); ctxShadow->endShadowLayer(p); } @@ -181,12 +182,12 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float if (!isComplexText && !(ctx->textDrawingMode() & cTextStroke)) flags |= Qt::TextBypassShaping; #endif - if (ctx->contextShadow()->type != ContextShadow::NoShadow) { + if (ctx->contextShadow()->m_type != ContextShadow::NoShadow) { ContextShadow* ctxShadow = ctx->contextShadow(); - if (ctxShadow->type != ContextShadow::BlurShadow) { + if (ctxShadow->m_type != ContextShadow::BlurShadow) { p->save(); - p->setPen(ctxShadow->color); - p->translate(ctxShadow->offset); + p->setPen(ctxShadow->m_color); + p->translate(ctxShadow->offset()); p->drawText(pt, string, flags, run.padding()); p->restore(); } else { @@ -196,7 +197,7 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float if (shadowPainter) { // Since it will be blurred anyway, we don't care about render hints. shadowPainter->setFont(p->font()); - shadowPainter->setPen(ctxShadow->color); + shadowPainter->setPen(ctxShadow->m_color); shadowPainter->drawText(pt, string, flags, run.padding()); ctxShadow->endShadowLayer(p); } @@ -205,12 +206,13 @@ static void drawTextCommon(GraphicsContext* ctx, const TextRun& run, const Float if (ctx->textDrawingMode() & cTextStroke) { QPainterPath path; path.addText(pt, font, string); - p->setPen(textStrokePen); - p->strokePath(path, p->pen()); + p->strokePath(path, textStrokePen); } if (ctx->textDrawingMode() & cTextFill) { + QPen previousPen = p->pen(); p->setPen(textFillPen); p->drawText(pt, string, flags, run.padding()); + p->setPen(previousPen); } } |