[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
alex at webkit.org
alex at webkit.org
Wed Dec 22 12:37:37 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit a5fd9baa9746d5e7cc48b4fbcfa6ec6474e1540e
Author: alex at webkit.org <alex at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Aug 26 07:23:34 2010 +0000
2010-08-26 Alejandro G. Castro <alex at igalia.com>
Reviewed by Dan Bernstein.
shadowSize parameter is used to pass shadow offset in the
GraphicsContext::setShadow and getShadow functions
https://bugs.webkit.org/show_bug.cgi?id=44603
Change the shadowSize parameter ot the functions getShadow and
setShadow in GraphicsContext to shadowOffset which is the current
use of that parameter in the code.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::setShadow):
(WebCore::GraphicsContext::clearShadow):
(WebCore::GraphicsContext::getShadow):
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsContextPrivate.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::Font::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::calculateShadowBufferDimensions):
(WebCore::drawPathShadow):
(WebCore::drawBorderlessRectShadow):
(WebCore::GraphicsContext::setPlatformShadow):
* platform/graphics/cairo/ImageCairo.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/chromium/FontChromiumWin.cpp:
(WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
(WebCore::Font::drawComplexText):
* platform/graphics/gtk/FontGtk.cpp:
(WebCore::Font::drawComplexText):
* platform/graphics/mac/FontMac.mm:
(WebCore::Font::drawGlyphs):
* platform/graphics/qt/ImageQt.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/qt/StillImageQt.cpp:
(WebCore::StillImage::draw):
* platform/graphics/qt/GraphicsContextQt:
(WebCore::GraphicsContext::setPlatformShadow):
* platform/graphics/skia/SkiaFontWin.cpp:
(WebCore::windowsCanHandleDrawTextShadow):
* platform/graphics/win/FontCGWin.cpp:
(WebCore::drawGDIGlyphs):
(WebCore::Font::drawGlyphs):
* platform/graphics/wince/GraphicsContextWince.cpp:
(WebCore::GraphicsContext::fillRoundedRect):
(WebCore::GraphicsContext::drawText):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66082 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 90f722c..046694d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,52 @@
+2010-08-26 Alejandro G. Castro <alex at igalia.com>
+
+ Reviewed by Dan Bernstein.
+
+ shadowSize parameter is used to pass shadow offset in the
+ GraphicsContext::setShadow and getShadow functions
+ https://bugs.webkit.org/show_bug.cgi?id=44603
+
+ Change the shadowSize parameter ot the functions getShadow and
+ setShadow in GraphicsContext to shadowOffset which is the current
+ use of that parameter in the code.
+
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::setShadow):
+ (WebCore::GraphicsContext::clearShadow):
+ (WebCore::GraphicsContext::getShadow):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/GraphicsContextPrivate.h:
+ * platform/graphics/cairo/FontCairo.cpp:
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::calculateShadowBufferDimensions):
+ (WebCore::drawPathShadow):
+ (WebCore::drawBorderlessRectShadow):
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/cairo/ImageCairo.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/chromium/FontChromiumWin.cpp:
+ (WebCore::TransparencyAwareFontPainter::TransparencyAwareGlyphPainter::drawGlyphs):
+ (WebCore::Font::drawComplexText):
+ * platform/graphics/gtk/FontGtk.cpp:
+ (WebCore::Font::drawComplexText):
+ * platform/graphics/mac/FontMac.mm:
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/qt/ImageQt.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/qt/StillImageQt.cpp:
+ (WebCore::StillImage::draw):
+ * platform/graphics/qt/GraphicsContextQt:
+ (WebCore::GraphicsContext::setPlatformShadow):
+ * platform/graphics/skia/SkiaFontWin.cpp:
+ (WebCore::windowsCanHandleDrawTextShadow):
+ * platform/graphics/win/FontCGWin.cpp:
+ (WebCore::drawGDIGlyphs):
+ (WebCore::Font::drawGlyphs):
+ * platform/graphics/wince/GraphicsContextWince.cpp:
+ (WebCore::GraphicsContext::fillRoundedRect):
+ (WebCore::GraphicsContext::drawText):
+
2010-08-25 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r66074.
diff --git a/WebCore/platform/graphics/GraphicsContext.cpp b/WebCore/platform/graphics/GraphicsContext.cpp
index b51141a..47384b9 100644
--- a/WebCore/platform/graphics/GraphicsContext.cpp
+++ b/WebCore/platform/graphics/GraphicsContext.cpp
@@ -130,29 +130,29 @@ void GraphicsContext::setStrokeColor(const Color& color, ColorSpace colorSpace)
setPlatformStrokeColor(color, colorSpace);
}
-void GraphicsContext::setShadow(const FloatSize& size, float blur, const Color& color, ColorSpace colorSpace)
+void GraphicsContext::setShadow(const FloatSize& offset, float blur, const Color& color, ColorSpace colorSpace)
{
- m_common->state.shadowSize = size;
+ m_common->state.shadowOffset = offset;
m_common->state.shadowBlur = blur;
m_common->state.shadowColor = color;
- setPlatformShadow(size, blur, color, colorSpace);
+ setPlatformShadow(offset, blur, color, colorSpace);
}
void GraphicsContext::clearShadow()
{
- m_common->state.shadowSize = IntSize();
+ m_common->state.shadowOffset = FloatSize();
m_common->state.shadowBlur = 0;
m_common->state.shadowColor = Color();
clearPlatformShadow();
}
-bool GraphicsContext::getShadow(FloatSize& size, float& blur, Color& color) const
+bool GraphicsContext::getShadow(FloatSize& offset, float& blur, Color& color) const
{
- size = m_common->state.shadowSize;
+ offset = m_common->state.shadowOffset;
blur = m_common->state.shadowBlur;
color = m_common->state.shadowColor;
- return color.isValid() && color.alpha() && (blur || size.width() || size.height());
+ return color.isValid() && color.alpha() && (blur || offset.width() || offset.height());
}
float GraphicsContext::strokeThickness() const
diff --git a/WebCore/platform/graphics/GraphicsContext.h b/WebCore/platform/graphics/GraphicsContext.h
index ead2ca5..93ef890 100644
--- a/WebCore/platform/graphics/GraphicsContext.h
+++ b/WebCore/platform/graphics/GraphicsContext.h
@@ -298,7 +298,7 @@ namespace WebCore {
#if PLATFORM(CAIRO)
float getAlpha();
void createPlatformShadow(PassOwnPtr<ImageBuffer> buffer, const Color& shadowColor, const FloatRect& shadowRect, float radius);
- static void calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur);
+ static void calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowOffset, float shadowBlur);
#endif
void setCompositeOperation(CompositeOperator);
diff --git a/WebCore/platform/graphics/GraphicsContextPrivate.h b/WebCore/platform/graphics/GraphicsContextPrivate.h
index 6bf465b..903c7e3 100644
--- a/WebCore/platform/graphics/GraphicsContextPrivate.h
+++ b/WebCore/platform/graphics/GraphicsContextPrivate.h
@@ -72,7 +72,7 @@ namespace WebCore {
bool paintingDisabled;
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
diff --git a/WebCore/platform/graphics/cairo/FontCairo.cpp b/WebCore/platform/graphics/cairo/FontCairo.cpp
index f6d8f3d..5bfa3fb 100644
--- a/WebCore/platform/graphics/cairo/FontCairo.cpp
+++ b/WebCore/platform/graphics/cairo/FontCairo.cpp
@@ -70,11 +70,11 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
}
// Text shadow, inspired by FontMac
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur = 0;
Color shadowColor;
bool hasShadow = context->textDrawingMode() & cTextFill
- && context->getShadow(shadowSize, shadowBlur, shadowColor);
+ && context->getShadow(shadowOffset, shadowBlur, shadowColor);
// TODO: Blur support
if (hasShadow) {
@@ -95,7 +95,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
IntSize shadowBufferSize;
FloatRect shadowRect;
float radius = 0;
- context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowSize, shadowBlur);
+ context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur);
// Draw shadow into a new ImageBuffer
OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
@@ -115,7 +115,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
cairo_translate(cr, 0.0, -extents.height);
context->createPlatformShadow(shadowBuffer.release(), shadowColor, shadowRect, radius);
#else
- cairo_translate(cr, shadowSize.width(), shadowSize.height());
+ cairo_translate(cr, shadowOffset.width(), shadowOffset.height());
cairo_show_glyphs(cr, glyphs, numGlyphs);
if (font->syntheticBoldOffset()) {
cairo_save(cr);
@@ -195,7 +195,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
// Re-enable the platform shadow we disabled earlier
if (hasShadow)
- context->setShadow(shadowSize, shadowBlur, shadowColor, DeviceColorSpace);
+ context->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace);
cairo_restore(cr);
}
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 3a667ac..683c144 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -175,7 +175,7 @@ static void addConvexPolygonToContext(cairo_t* context, size_t numPoints, const
cairo_close_path(context);
}
-void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowSize, float shadowBlur)
+void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize, FloatRect& shadowRect, float& radius, const FloatRect& sourceRect, const FloatSize& shadowOffset, float shadowBlur)
{
#if ENABLE(FILTERS)
// limit radius to 128
@@ -185,17 +185,17 @@ void GraphicsContext::calculateShadowBufferDimensions(IntSize& shadowBufferSize,
// determine dimensions of shadow rect
shadowRect = FloatRect(sourceRect.location(), shadowBufferSize);
- shadowRect.move(shadowSize.width() - radius, shadowSize.height() - radius);
+ shadowRect.move(shadowOffset.width() - radius, shadowOffset.height() - radius);
#endif
}
static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPrivate* gcp, bool fillShadow, bool strokeShadow)
{
#if ENABLE(FILTERS)
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (!context->getShadow(shadowSize, shadowBlur, shadowColor))
+ if (!context->getShadow(shadowOffset, shadowBlur, shadowColor))
return;
// Calculate filter values to create appropriate shadow.
@@ -211,7 +211,7 @@ static inline void drawPathShadow(GraphicsContext* context, GraphicsContextPriva
IntSize shadowBufferSize;
FloatRect shadowRect;
float radius = 0;
- GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowSize, shadowBlur);
+ GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur);
// Create suitably-sized ImageBuffer to hold the shadow.
OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
@@ -623,17 +623,17 @@ void GraphicsContext::fillRect(const FloatRect& rect)
static void drawBorderlessRectShadow(GraphicsContext* context, const FloatRect& rect, const Color& rectColor)
{
#if ENABLE(FILTERS)
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (!context->getShadow(shadowSize, shadowBlur, shadowColor))
+ if (!context->getShadow(shadowOffset, shadowBlur, shadowColor))
return;
IntSize shadowBufferSize;
FloatRect shadowRect;
float radius = 0;
- GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowSize, shadowBlur);
+ GraphicsContext::calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, rect, shadowOffset, shadowBlur);
// Draw shadow into a new ImageBuffer
OwnPtr<ImageBuffer> shadowBuffer = ImageBuffer::create(shadowBufferSize);
@@ -917,7 +917,7 @@ void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color cons
if (m_common->state.shadowsIgnoreTransforms) {
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
- m_common->state.shadowSize = FloatSize(size.width(), -size.height());
+ m_common->state.shadowOffset = FloatSize(size.width(), -size.height());
}
}
diff --git a/WebCore/platform/graphics/cairo/ImageCairo.cpp b/WebCore/platform/graphics/cairo/ImageCairo.cpp
index d9eb5e6..3b02ad8 100644
--- a/WebCore/platform/graphics/cairo/ImageCairo.cpp
+++ b/WebCore/platform/graphics/cairo/ImageCairo.cpp
@@ -135,14 +135,14 @@ void BitmapImage::draw(GraphicsContext* context, const FloatRect& dst, const Flo
// Draw the shadow
#if ENABLE(FILTERS)
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (context->getShadow(shadowSize, shadowBlur, shadowColor)) {
+ if (context->getShadow(shadowOffset, shadowBlur, shadowColor)) {
IntSize shadowBufferSize;
FloatRect shadowRect;
float radius = 0;
- context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, dstRect, shadowSize, shadowBlur);
+ context->calculateShadowBufferDimensions(shadowBufferSize, shadowRect, radius, dstRect, shadowOffset, shadowBlur);
shadowColor = colorWithOverrideAlpha(shadowColor.rgb(), (shadowColor.alpha() * context->getAlpha()) / 255.f);
//draw shadow into a new ImageBuffer
diff --git a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
index 5b8bad3..78b7517 100644
--- a/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
+++ b/WebCore/platform/graphics/chromium/FontChromiumWin.cpp
@@ -273,10 +273,10 @@ bool TransparencyAwareGlyphPainter::drawGlyphs(int numGlyphs,
// If there is a non-blur shadow and both the fill color and shadow color
// are opaque, handle without skia.
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (m_graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor)) {
+ if (m_graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor)) {
// If there is a shadow and this code is reached, windowsCanHandleDrawTextShadow()
// will have already returned true during the ctor initiatization of m_useGDI
ASSERT(shadowColor.alpha() == 255);
@@ -285,7 +285,7 @@ bool TransparencyAwareGlyphPainter::drawGlyphs(int numGlyphs,
COLORREF textColor = skia::SkColorToCOLORREF(SkColorSetARGB(255, shadowColor.red(), shadowColor.green(), shadowColor.blue()));
COLORREF savedTextColor = GetTextColor(m_hdc);
SetTextColor(m_hdc, textColor);
- ExtTextOut(m_hdc, x + shadowSize.width(), y + shadowSize.height(), ETO_GLYPH_INDEX, 0, reinterpret_cast<const wchar_t*>(&glyphs[0]), numGlyphs, &advances[0]);
+ ExtTextOut(m_hdc, x + shadowOffset.width(), y + shadowOffset.height(), ETO_GLYPH_INDEX, 0, reinterpret_cast<const wchar_t*>(&glyphs[0]), numGlyphs, &advances[0]);
SetTextColor(m_hdc, savedTextColor);
}
@@ -483,15 +483,15 @@ void Font::drawComplexText(GraphicsContext* graphicsContext,
// If there is a non-blur shadow and both the fill color and shadow color
// are opaque, handle without skia.
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor) && windowsCanHandleDrawTextShadow(graphicsContext)) {
+ if (graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor) && windowsCanHandleDrawTextShadow(graphicsContext)) {
COLORREF textColor = skia::SkColorToCOLORREF(SkColorSetARGB(255, shadowColor.red(), shadowColor.green(), shadowColor.blue()));
COLORREF savedTextColor = GetTextColor(hdc);
SetTextColor(hdc, textColor);
- state.draw(graphicsContext, hdc, static_cast<int>(point.x()) + shadowSize.width(),
- static_cast<int>(point.y() - ascent()) + shadowSize.height(), from, to);
+ state.draw(graphicsContext, hdc, static_cast<int>(point.x()) + shadowOffset.width(),
+ static_cast<int>(point.y() - ascent()) + shadowOffset.height(), from, to);
SetTextColor(hdc, savedTextColor);
}
diff --git a/WebCore/platform/graphics/gtk/FontGtk.cpp b/WebCore/platform/graphics/gtk/FontGtk.cpp
index 92f8816..489bad7 100644
--- a/WebCore/platform/graphics/gtk/FontGtk.cpp
+++ b/WebCore/platform/graphics/gtk/FontGtk.cpp
@@ -241,11 +241,11 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
float red, green, blue, alpha;
// Text shadow, inspired by FontMac
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur = 0;
Color shadowColor;
bool hasShadow = context->textDrawingMode() == cTextFill &&
- context->getShadow(shadowSize, shadowBlur, shadowColor);
+ context->getShadow(shadowOffset, shadowBlur, shadowColor);
// TODO: Blur support
if (hasShadow) {
@@ -257,7 +257,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
shadowFillColor.getRGBA(red, green, blue, alpha);
cairo_set_source_rgba(cr, red, green, blue, alpha);
- cairo_translate(cr, shadowSize.width(), shadowSize.height());
+ cairo_translate(cr, shadowOffset.width(), shadowOffset.height());
if (partialRegion) {
gdk_cairo_region(cr, partialRegion);
@@ -290,7 +290,7 @@ void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const F
// Re-enable the platform shadow we disabled earlier
if (hasShadow)
- context->setShadow(shadowSize, shadowBlur, shadowColor, DeviceColorSpace);
+ context->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace);
// Pango sometimes leaves behind paths we don't want
cairo_new_path(cr);
diff --git a/WebCore/platform/graphics/mac/FontMac.mm b/WebCore/platform/graphics/mac/FontMac.mm
index db77402..33a930b 100644
--- a/WebCore/platform/graphics/mac/FontMac.mm
+++ b/WebCore/platform/graphics/mac/FontMac.mm
@@ -135,11 +135,11 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
CGContextSetFontSize(cgContext, platformData.m_size);
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
ColorSpace fillColorSpace = context->fillColorSpace();
- context->getShadow(shadowSize, shadowBlur, shadowColor);
+ context->getShadow(shadowOffset, shadowBlur, shadowColor);
bool hasSimpleShadow = context->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur && !platformData.isColorBitmapFont();
if (hasSimpleShadow) {
@@ -148,10 +148,10 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
Color fillColor = context->fillColor();
Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
context->setFillColor(shadowFillColor, fillColorSpace);
- CGContextSetTextPosition(cgContext, point.x() + shadowSize.width(), point.y() + shadowSize.height());
+ CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width(), point.y() + shadowOffset.height());
showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset()) {
- CGContextSetTextPosition(cgContext, point.x() + shadowSize.width() + font->syntheticBoldOffset(), point.y() + shadowSize.height());
+ CGContextSetTextPosition(cgContext, point.x() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + shadowOffset.height());
showGlyphsWithAdvances(platformData, cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
}
context->setFillColor(fillColor, fillColorSpace);
@@ -165,7 +165,7 @@ void Font::drawGlyphs(GraphicsContext* context, const SimpleFontData* font, cons
}
if (hasSimpleShadow)
- context->setShadow(shadowSize, shadowBlur, shadowColor, fillColorSpace);
+ context->setShadow(shadowOffset, shadowBlur, shadowColor, fillColorSpace);
if (originalShouldUseFontSmoothing != newShouldUseFontSmoothing)
CGContextSetShouldSmoothFonts(cgContext, originalShouldUseFontSmoothing);
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 41c9759..73dd997 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -889,7 +889,7 @@ void GraphicsContext::setPlatformShadow(const FloatSize& size, float blur, const
if (m_common->state.shadowsIgnoreTransforms) {
// Meaning that this graphics context is associated with a CanvasRenderingContext
// We flip the height since CG and HTML5 Canvas have opposite Y axis
- m_common->state.shadowSize = FloatSize(size.width(), -size.height());
+ m_common->state.shadowOffset = FloatSize(size.width(), -size.height());
m_data->shadow = ContextShadow(color, blur, size.width(), -size.height());
} else {
m_data->shadow = ContextShadow(color, blur, size.width(), size.height());
diff --git a/WebCore/platform/graphics/qt/ImageQt.cpp b/WebCore/platform/graphics/qt/ImageQt.cpp
index e0ac574..c0cfae4 100644
--- a/WebCore/platform/graphics/qt/ImageQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageQt.cpp
@@ -190,12 +190,12 @@ void BitmapImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
QPainter::CompositionMode lastCompositionMode = painter->compositionMode();
painter->setCompositionMode(compositionMode);
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) {
+ if (ctxt->getShadow(shadowOffset, shadowBlur, shadowColor)) {
FloatRect shadowImageRect(normalizedDst);
- shadowImageRect.move(shadowSize.width(), shadowSize.height());
+ shadowImageRect.move(shadowOffset.width(), shadowOffset.height());
QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied);
QPainter p(&shadowImage);
diff --git a/WebCore/platform/graphics/qt/StillImageQt.cpp b/WebCore/platform/graphics/qt/StillImageQt.cpp
index 9c6acab..3038356 100644
--- a/WebCore/platform/graphics/qt/StillImageQt.cpp
+++ b/WebCore/platform/graphics/qt/StillImageQt.cpp
@@ -76,12 +76,12 @@ void StillImage::draw(GraphicsContext* ctxt, const FloatRect& dst,
ctxt->setCompositeOperation(op);
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- if (ctxt->getShadow(shadowSize, shadowBlur, shadowColor)) {
+ if (ctxt->getShadow(shadowOffset, shadowBlur, shadowColor)) {
FloatRect shadowImageRect(normalizedDst);
- shadowImageRect.move(shadowSize.width(), shadowSize.height());
+ shadowImageRect.move(shadowOffset.width(), shadowOffset.height());
QImage shadowImage(QSize(static_cast<int>(normalizedSrc.width()), static_cast<int>(normalizedSrc.height())), QImage::Format_ARGB32_Premultiplied);
QPainter p(&shadowImage);
diff --git a/WebCore/platform/graphics/skia/SkiaFontWin.cpp b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
index 44003bb..9edb775 100644
--- a/WebCore/platform/graphics/skia/SkiaFontWin.cpp
+++ b/WebCore/platform/graphics/skia/SkiaFontWin.cpp
@@ -222,11 +222,11 @@ void SkiaWinOutlineCache::removePathsForFont(HFONT hfont)
bool windowsCanHandleDrawTextShadow(GraphicsContext *context)
{
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- bool hasShadow = context->getShadow(shadowSize, shadowBlur, shadowColor);
+ bool hasShadow = context->getShadow(shadowOffset, shadowBlur, shadowColor);
return (hasShadow && (shadowBlur == 0) && (shadowColor.alpha() == 255) && (context->fillColor().alpha() == 255));
}
diff --git a/WebCore/platform/graphics/win/FontCGWin.cpp b/WebCore/platform/graphics/win/FontCGWin.cpp
index 34f9b07..9d81838 100644
--- a/WebCore/platform/graphics/win/FontCGWin.cpp
+++ b/WebCore/platform/graphics/win/FontCGWin.cpp
@@ -140,11 +140,11 @@ static void drawGDIGlyphs(GraphicsContext* graphicsContext, const SimpleFontData
drawIntoBitmap = fillColor.alpha() != 255 || graphicsContext->inTransparencyLayer();
if (!drawIntoBitmap) {
- FloatSize size;
+ FloatSize offset;
float blur;
Color color;
- graphicsContext->getShadow(size, blur, color);
- drawIntoBitmap = !size.isEmpty() || blur;
+ graphicsContext->getShadow(offset, blur, color);
+ drawIntoBitmap = !offset.isEmpty() || blur;
}
}
@@ -349,10 +349,10 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
CGContextSetFontSize(cgContext, platformData.size());
wkSetCGContextFontRenderingStyle(cgContext, font->isSystemFont(), false, font->platformData().useGDI());
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur;
Color shadowColor;
- graphicsContext->getShadow(shadowSize, shadowBlur, shadowColor);
+ graphicsContext->getShadow(shadowOffset, shadowBlur, shadowColor);
bool hasSimpleShadow = graphicsContext->textDrawingMode() == cTextFill && shadowColor.isValid() && !shadowBlur;
if (hasSimpleShadow) {
@@ -361,10 +361,10 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
Color fillColor = graphicsContext->fillColor();
Color shadowFillColor(shadowColor.red(), shadowColor.green(), shadowColor.blue(), shadowColor.alpha() * fillColor.alpha() / 255);
graphicsContext->setFillColor(shadowFillColor, DeviceColorSpace);
- CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowSize.width(), point.y() + translation.height() + shadowSize.height());
+ CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width(), point.y() + translation.height() + shadowOffset.height());
CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
if (font->syntheticBoldOffset()) {
- CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowSize.width() + font->syntheticBoldOffset(), point.y() + translation.height() + shadowSize.height());
+ CGContextSetTextPosition(cgContext, point.x() + translation.width() + shadowOffset.width() + font->syntheticBoldOffset(), point.y() + translation.height() + shadowOffset.height());
CGContextShowGlyphsWithAdvances(cgContext, glyphBuffer.glyphs(from), glyphBuffer.advances(from), numGlyphs);
}
graphicsContext->setFillColor(fillColor, DeviceColorSpace);
@@ -378,7 +378,7 @@ void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fo
}
if (hasSimpleShadow)
- graphicsContext->setShadow(shadowSize, shadowBlur, shadowColor, DeviceColorSpace);
+ graphicsContext->setShadow(shadowOffset, shadowBlur, shadowColor, DeviceColorSpace);
wkRestoreFontSmoothingStyle(cgContext, oldFontSmoothingStyle);
}
diff --git a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
index e4466c8..162512a 100644
--- a/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
+++ b/WebCore/platform/graphics/wince/GraphicsContextWince.cpp
@@ -1260,15 +1260,15 @@ void GraphicsContext::fillRoundedRect(const IntRect& fillRect, const IntSize& to
if (!m_data->m_dc)
return;
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur = 0;
Color shadowColor;
- getShadow(shadowSize, shadowBlur, shadowColor);
+ getShadow(shadowOffset, shadowBlur, shadowColor);
IntRect dstRect = fillRect;
- dstRect.move(stableRound(shadowSize.width()), stableRound(shadowSize.height()));
+ dstRect.move(stableRound(shadowOffset.width()), stableRound(shadowOffset.height()));
dstRect.inflate(stableRound(shadowBlur));
dstRect = m_data->mapRect(dstRect);
@@ -1687,17 +1687,17 @@ void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer
return;
}
- FloatSize shadowSize;
+ FloatSize shadowOffset;
float shadowBlur = 0;
Color shadowColor;
bool hasShadow = textDrawingMode() == cTextFill
- && getShadow(shadowSize, shadowBlur, shadowColor)
+ && getShadow(shadowOffset, shadowBlur, shadowColor)
&& shadowColor.alpha();
COLORREF shadowRGBColor;
FloatPoint trShadowPoint;
if (hasShadow) {
shadowRGBColor = RGB(shadowColor.red(), shadowColor.green(), shadowColor.blue());
- trShadowPoint = m_data->mapPoint(startPoint + shadowSize);
+ trShadowPoint = m_data->mapPoint(startPoint + shadowOffset);
}
HGDIOBJ hOldFont = SelectObject(m_data->m_dc, hFont);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list