[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
commit-queue at webkit.org
commit-queue at webkit.org
Fri Jan 21 15:01:27 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 6b3f0472fb9b7c0c641029bf3ca901fc74b2d51d
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 6 10:49:49 2011 +0000
2011-01-06 Helder Correia <helder at sencha.com>
Reviewed by Kenneth Rohde Christiansen.
[Qt][GTK] Use GraphicsContext::hasShadow() in port-specific code
https://bugs.webkit.org/show_bug.cgi?id=51985
r75139 introduced GraphicsContext::hasShadow(). This can now simplify
and unify some code in the Qt and GTK ports.
No new tests necessary for this refactoring.
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
* platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::drawConvexPolygon):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::fillRoundedRect):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a50579..5dbe72d 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2011-01-06 Helder Correia <helder at sencha.com>
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ [Qt][GTK] Use GraphicsContext::hasShadow() in port-specific code
+ https://bugs.webkit.org/show_bug.cgi?id=51985
+
+ r75139 introduced GraphicsContext::hasShadow(). This can now simplify
+ and unify some code in the Qt and GTK ports.
+
+ No new tests necessary for this refactoring.
+
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+ * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
+ * platform/graphics/qt/GraphicsContextQt.cpp:
+ (WebCore::GraphicsContext::drawConvexPolygon):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ (WebCore::GraphicsContext::fillRect):
+ (WebCore::GraphicsContext::fillRoundedRect):
+
2011-01-05 Darin Adler <darin at apple.com>
Fix Chromium Mac build.
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index a783e2b..cdbfc57 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -563,7 +563,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
if (paintingDisabled())
return;
- if (m_data->hasShadow())
+ if (hasShadow())
m_data->shadow.drawRectShadow(this, enclosingIntRect(rect));
if (color.alpha())
@@ -1091,7 +1091,7 @@ void GraphicsContext::fillRoundedRect(const IntRect& r, const IntSize& topLeft,
if (paintingDisabled())
return;
- if (m_data->hasShadow())
+ if (hasShadow())
m_data->shadow.drawRectShadow(this, r, topLeft, topRight, bottomLeft, bottomRight);
cairo_t* cr = m_data->cr;
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h b/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
index 494b40d..5602b6c 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
+++ b/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h
@@ -99,7 +99,6 @@ public:
ContextShadow shadow;
Vector<ContextShadow> shadowStack;
- bool hasShadow() const { return shadow.m_type != ContextShadow::NoShadow; }
#if PLATFORM(GTK)
GdkEventExpose* expose;
diff --git a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
index 78a14f4..fb28baa 100644
--- a/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
+++ b/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
@@ -202,11 +202,6 @@ public:
ContextShadow shadow;
QStack<ContextShadow> shadowStack;
- bool hasShadow() const
- {
- return shadow.m_type != ContextShadow::NoShadow;
- }
-
QRectF clipBoundingRect() const
{
#if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
@@ -455,7 +450,7 @@ void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points
const bool antiAlias = p->testRenderHint(QPainter::Antialiasing);
p->setRenderHint(QPainter::Antialiasing, shouldAntialias);
- if (m_data->hasShadow()) {
+ if (hasShadow()) {
p->save();
p->translate(m_data->shadow.offset());
if (p->brush().style() != Qt::NoBrush)
@@ -508,7 +503,7 @@ void GraphicsContext::fillPath(const Path& path)
QPainterPath platformPath = path.platformPath();
platformPath.setFillRule(toQtFillRule(fillRule()));
- if (m_data->hasShadow()) {
+ if (hasShadow()) {
ContextShadow* shadow = contextShadow();
if (shadow->mustUseContextShadow(this) || m_state.fillPattern || m_state.fillGradient)
{
@@ -546,7 +541,7 @@ void GraphicsContext::strokePath(const Path& path)
QPainterPath platformPath = path.platformPath();
platformPath.setFillRule(toQtFillRule(fillRule()));
- if (m_data->hasShadow()) {
+ if (hasShadow()) {
ContextShadow* shadow = contextShadow();
if (shadow->mustUseContextShadow(this) || m_state.strokePattern || m_state.strokeGradient)
{
@@ -663,7 +658,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
AffineTransform affine;
QBrush brush(m_state.fillPattern->createPlatformPattern(affine));
QPixmap* image = m_state.fillPattern->tileImage()->nativeImageForCurrentFrame();
- QPainter* shadowPainter = m_data->hasShadow() ? shadow->beginShadowLayer(this, normalizedRect) : 0;
+ QPainter* shadowPainter = hasShadow() ? shadow->beginShadowLayer(this, normalizedRect) : 0;
if (shadowPainter) {
drawRepeatPattern(shadowPainter, image, normalizedRect, m_state.fillPattern->repeatX(), m_state.fillPattern->repeatY());
shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn);
@@ -674,7 +669,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
} else if (m_state.fillGradient) {
QBrush brush(*m_state.fillGradient->platformGradient());
brush.setTransform(m_state.fillGradient->gradientSpaceTransform());
- QPainter* shadowPainter = m_data->hasShadow() ? shadow->beginShadowLayer(this, normalizedRect) : 0;
+ QPainter* shadowPainter = hasShadow() ? shadow->beginShadowLayer(this, normalizedRect) : 0;
if (shadowPainter) {
shadowPainter->fillRect(normalizedRect, brush);
shadowPainter->setCompositionMode(QPainter::CompositionMode_SourceIn);
@@ -683,7 +678,7 @@ void GraphicsContext::fillRect(const FloatRect& rect)
}
p->fillRect(normalizedRect, brush);
} else {
- if (m_data->hasShadow()) {
+ if (hasShadow()) {
if (shadow->mustUseContextShadow(this)) {
QPainter* shadowPainter = shadow->beginShadowLayer(this, normalizedRect);
if (shadowPainter) {
@@ -714,7 +709,7 @@ void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorS
QPainter* p = m_data->p();
QRectF normalizedRect = rect.normalized();
- if (m_data->hasShadow()) {
+ if (hasShadow()) {
ContextShadow* shadow = contextShadow();
if (shadow->mustUseContextShadow(this)) {
QPainter* shadowPainter = shadow->beginShadowLayer(this, normalizedRect);
@@ -738,7 +733,7 @@ void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLef
Path path;
path.addRoundedRect(rect, topLeft, topRight, bottomLeft, bottomRight);
QPainter* p = m_data->p();
- if (m_data->hasShadow()) {
+ if (hasShadow()) {
ContextShadow* shadow = contextShadow();
if (shadow->mustUseContextShadow(this)) {
QPainter* shadowPainter = shadow->beginShadowLayer(this, rect);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list