[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
mrobinson at webkit.org
mrobinson at webkit.org
Wed Dec 22 11:39:07 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c45ce439d19a33db010c91f920179e4dd3819ade
Author: mrobinson at webkit.org <mrobinson at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Aug 2 21:01:25 2010 +0000
2010-08-02 Martin Robinson <mrobinson at igalia.com>
Reviewed by Xan Lopez.
[GTK] Style cleanup for CairoPath.h
https://bugs.webkit.org/show_bug.cgi?id=43133
Turn CairoPath into a class, as it has a constructor and destructor.
Change raw member access to use the new accessor.
No new tests as functionality has not changed.
* platform/graphics/cairo/CairoPath.h: Cleanup and indentation fix.
(WebCore::CairoPath::CairoPath):
(WebCore::CairoPath::~CairoPath):
(WebCore::CairoPath::context):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::addPath): Convert raw member access to accessor access.
(WebCore::GraphicsContext::clip): Ditto.
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::Path): Ditto.
(WebCore::Path::operator=): Ditto.
(WebCore::Path::clear): Ditto.
(WebCore::Path::isEmpty): Ditto.
(WebCore::Path::currentPoint): Ditto.
(WebCore::Path::translate): Ditto.
(WebCore::Path::moveTo): Ditto.
(WebCore::Path::addLineTo): Ditto.
(WebCore::Path::addRect): Ditto.
(WebCore::Path::addQuadCurveTo): Ditto.
(WebCore::Path::addBezierCurveTo): Ditto.
(WebCore::Path::addArc): Ditto.
(WebCore::Path::addArcTo): Ditto.
(WebCore::Path::addEllipse): Ditto.
(WebCore::Path::closeSubpath): Ditto.
(WebCore::Path::boundingRect): Ditto.
(WebCore::Path::strokeBoundingRect): Ditto.
(WebCore::Path::contains): Ditto.
(WebCore::Path::strokeContains): Ditto.
(WebCore::Path::apply): Ditto.
(WebCore::Path::transform): Ditto.
(WebCore::Path::debugString): Ditto.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 54a2768..2e00072 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,46 @@
+2010-08-02 Martin Robinson <mrobinson at igalia.com>
+
+ Reviewed by Xan Lopez.
+
+ [GTK] Style cleanup for CairoPath.h
+ https://bugs.webkit.org/show_bug.cgi?id=43133
+
+ Turn CairoPath into a class, as it has a constructor and destructor.
+ Change raw member access to use the new accessor.
+
+ No new tests as functionality has not changed.
+
+ * platform/graphics/cairo/CairoPath.h: Cleanup and indentation fix.
+ (WebCore::CairoPath::CairoPath):
+ (WebCore::CairoPath::~CairoPath):
+ (WebCore::CairoPath::context):
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ (WebCore::GraphicsContext::addPath): Convert raw member access to accessor access.
+ (WebCore::GraphicsContext::clip): Ditto.
+ * platform/graphics/cairo/PathCairo.cpp:
+ (WebCore::Path::Path): Ditto.
+ (WebCore::Path::operator=): Ditto.
+ (WebCore::Path::clear): Ditto.
+ (WebCore::Path::isEmpty): Ditto.
+ (WebCore::Path::currentPoint): Ditto.
+ (WebCore::Path::translate): Ditto.
+ (WebCore::Path::moveTo): Ditto.
+ (WebCore::Path::addLineTo): Ditto.
+ (WebCore::Path::addRect): Ditto.
+ (WebCore::Path::addQuadCurveTo): Ditto.
+ (WebCore::Path::addBezierCurveTo): Ditto.
+ (WebCore::Path::addArc): Ditto.
+ (WebCore::Path::addArcTo): Ditto.
+ (WebCore::Path::addEllipse): Ditto.
+ (WebCore::Path::closeSubpath): Ditto.
+ (WebCore::Path::boundingRect): Ditto.
+ (WebCore::Path::strokeBoundingRect): Ditto.
+ (WebCore::Path::contains): Ditto.
+ (WebCore::Path::strokeContains): Ditto.
+ (WebCore::Path::apply): Ditto.
+ (WebCore::Path::transform): Ditto.
+ (WebCore::Path::debugString): Ditto.
+
2010-07-20 Ojan Vafai <ojan at chromium.org>
Reviewed by Eric Seidel.
diff --git a/WebCore/platform/graphics/cairo/CairoPath.h b/WebCore/platform/graphics/cairo/CairoPath.h
index b761ce6..da7affb 100644
--- a/WebCore/platform/graphics/cairo/CairoPath.h
+++ b/WebCore/platform/graphics/cairo/CairoPath.h
@@ -1,5 +1,6 @@
/*
Copyright (C) 2007 Alp Toker <alp.toker at collabora.co.uk>
+ Copyright (C) 2010 Igalia S.L.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
@@ -24,21 +25,25 @@
namespace WebCore {
- // This is necessary since cairo_path_fixed_t isn't exposed in Cairo's public API.
- struct CairoPath {
- cairo_t* m_cr;
-
- CairoPath()
- {
- static cairo_surface_t* pathSurface = cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1);
- m_cr = cairo_create(pathSurface);
- }
-
- ~CairoPath()
- {
- cairo_destroy(m_cr);
- }
- };
+// This is necessary since cairo_path_fixed_t isn't exposed in Cairo's public API.
+class CairoPath {
+public:
+ CairoPath()
+ {
+ static cairo_surface_t* pathSurface = cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1);
+ m_cr = cairo_create(pathSurface);
+ }
+
+ ~CairoPath()
+ {
+ cairo_destroy(m_cr);
+ }
+
+ cairo_t* context() { return m_cr; }
+
+private:
+ cairo_t* m_cr;
+};
} // namespace WebCore
diff --git a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
index 93daee3..f3fc943 100644
--- a/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
+++ b/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp
@@ -162,7 +162,7 @@ static void setPathOnCairoContext(cairo_t* to, cairo_t* from)
static void appendWebCorePathToCairoContext(cairo_t* context, const Path& path)
{
- appendPathToCairoContext(context, path.platformPath()->m_cr);
+ appendPathToCairoContext(context, path.platformPath()->context());
}
static void addConvexPolygonToContext(cairo_t* context, size_t numPoints, const FloatPoint* points)
@@ -576,7 +576,7 @@ void GraphicsContext::fillPath()
cairo_t* cr = m_data->cr;
- setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
+ setPathOnCairoContext(cr, m_data->m_pendingPath.context());
fillCurrentCairoPath(this, m_common, cr);
}
@@ -586,7 +586,7 @@ void GraphicsContext::strokePath()
return;
cairo_t* cr = m_data->cr;
- setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
+ setPathOnCairoContext(cr, m_data->m_pendingPath.context());
strokeCurrentCairoPath(this, m_common, cr);
}
@@ -597,7 +597,7 @@ void GraphicsContext::drawPath()
cairo_t* cr = m_data->cr;
- setPathOnCairoContext(cr, m_data->m_pendingPath.m_cr);
+ setPathOnCairoContext(cr, m_data->m_pendingPath.context());
cairo_set_fill_rule(cr, fillRule() == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
drawPathShadow(this, m_common, true, true);
@@ -1129,7 +1129,7 @@ void GraphicsContext::beginPath()
if (paintingDisabled())
return;
- cairo_new_path(m_data->m_pendingPath.m_cr);
+ cairo_new_path(m_data->m_pendingPath.context());
}
void GraphicsContext::addPath(const Path& path)
@@ -1139,8 +1139,8 @@ void GraphicsContext::addPath(const Path& path)
cairo_matrix_t currentMatrix;
cairo_get_matrix(m_data->cr, ¤tMatrix);
- cairo_set_matrix(m_data->m_pendingPath.m_cr, ¤tMatrix);
- appendWebCorePathToCairoContext(m_data->m_pendingPath.m_cr, path);
+ cairo_set_matrix(m_data->m_pendingPath.context(), ¤tMatrix);
+ appendWebCorePathToCairoContext(m_data->m_pendingPath.context(), path);
}
void GraphicsContext::clip(const Path& path)
@@ -1149,7 +1149,7 @@ void GraphicsContext::clip(const Path& path)
return;
cairo_t* cr = m_data->cr;
- cairo_path_t* p = cairo_copy_path(path.platformPath()->m_cr);
+ cairo_path_t* p = cairo_copy_path(path.platformPath()->context());
cairo_append_path(cr, p);
cairo_path_destroy(p);
cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
diff --git a/WebCore/platform/graphics/cairo/PathCairo.cpp b/WebCore/platform/graphics/cairo/PathCairo.cpp
index d880626..05c6952 100644
--- a/WebCore/platform/graphics/cairo/PathCairo.cpp
+++ b/WebCore/platform/graphics/cairo/PathCairo.cpp
@@ -51,8 +51,8 @@ Path::~Path()
Path::Path(const Path& other)
: m_path(new CairoPath())
{
- cairo_t* cr = platformPath()->m_cr;
- cairo_path_t* p = cairo_copy_path(other.platformPath()->m_cr);
+ cairo_t* cr = platformPath()->context();
+ cairo_path_t* p = cairo_copy_path(other.platformPath()->context());
cairo_append_path(cr, p);
cairo_path_destroy(p);
}
@@ -63,8 +63,8 @@ Path& Path::operator=(const Path& other)
return *this;
clear();
- cairo_t* cr = platformPath()->m_cr;
- cairo_path_t* p = cairo_copy_path(other.platformPath()->m_cr);
+ cairo_t* cr = platformPath()->context();
+ cairo_path_t* p = cairo_copy_path(other.platformPath()->context());
cairo_append_path(cr, p);
cairo_path_destroy(p);
return *this;
@@ -72,13 +72,13 @@ Path& Path::operator=(const Path& other)
void Path::clear()
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_new_path(cr);
}
bool Path::isEmpty() const
{
- return !cairo_has_current_point(platformPath()->m_cr);
+ return !cairo_has_current_point(platformPath()->context());
}
bool Path::hasCurrentPoint() const
@@ -91,31 +91,31 @@ FloatPoint Path::currentPoint() const
// FIXME: Is this the correct way?
double x;
double y;
- cairo_get_current_point(platformPath()->m_cr, &x, &y);
+ cairo_get_current_point(platformPath()->context(), &x, &y);
return FloatPoint(x, y);
}
void Path::translate(const FloatSize& p)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_translate(cr, -p.width(), -p.height());
}
void Path::moveTo(const FloatPoint& p)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_move_to(cr, p.x(), p.y());
}
void Path::addLineTo(const FloatPoint& p)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_line_to(cr, p.x(), p.y());
}
void Path::addRect(const FloatRect& rect)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height());
}
@@ -124,7 +124,7 @@ void Path::addRect(const FloatRect& rect)
*/
void Path::addQuadCurveTo(const FloatPoint& controlPoint, const FloatPoint& point)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
double x, y;
double x1 = controlPoint.x();
double y1 = controlPoint.y();
@@ -139,7 +139,7 @@ void Path::addQuadCurveTo(const FloatPoint& controlPoint, const FloatPoint& poin
void Path::addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& controlPoint3)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_curve_to(cr, controlPoint1.x(), controlPoint1.y(),
controlPoint2.x(), controlPoint2.y(),
controlPoint3.x(), controlPoint3.y());
@@ -152,7 +152,7 @@ void Path::addArc(const FloatPoint& p, float r, float sa, float ea, bool anticlo
if (!isfinite(r) || !isfinite(sa) || !isfinite(ea))
return;
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
if (anticlockwise)
cairo_arc_negative(cr, p.x(), p.y(), r, sa, ea);
else
@@ -164,7 +164,7 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
if (isEmpty())
return;
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
double x0, y0;
cairo_get_current_point(cr, &x0, &y0);
@@ -237,7 +237,7 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius)
void Path::addEllipse(const FloatRect& rect)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_save(cr);
float yRadius = .5 * rect.height();
float xRadius = .5 * rect.width();
@@ -249,13 +249,13 @@ void Path::addEllipse(const FloatRect& rect)
void Path::closeSubpath()
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_close_path(cr);
}
FloatRect Path::boundingRect() const
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
double x0, x1, y0, y1;
cairo_path_extents(cr, &x0, &y0, &x1, &y1);
return FloatRect(x0, y0, x1 - x0, y1 - y0);
@@ -263,7 +263,7 @@ FloatRect Path::boundingRect() const
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
if (applier) {
GraphicsContext gc(cr);
applier->strokeStyle(&gc);
@@ -276,7 +276,7 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
bool Path::contains(const FloatPoint& point, WindRule rule) const
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_fill_rule_t cur = cairo_get_fill_rule(cr);
cairo_set_fill_rule(cr, rule == RULE_EVENODD ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING);
bool contains = cairo_in_fill(cr, point.x(), point.y());
@@ -287,7 +287,7 @@ bool Path::contains(const FloatPoint& point, WindRule rule) const
bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point) const
{
ASSERT(applier);
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
GraphicsContext gc(cr);
applier->strokeStyle(&gc);
@@ -296,7 +296,7 @@ bool Path::strokeContains(StrokeStyleApplier* applier, const FloatPoint& point)
void Path::apply(void* info, PathApplierFunction function) const
{
- cairo_t* cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_path_t* path = cairo_copy_path(cr);
cairo_path_data_t* data;
PathElement pelement;
@@ -334,10 +334,10 @@ void Path::apply(void* info, PathApplierFunction function) const
void Path::transform(const AffineTransform& trans)
{
- cairo_t* m_cr = platformPath()->m_cr;
+ cairo_t* cr = platformPath()->context();
cairo_matrix_t c_matrix = cairo_matrix_t(trans);
cairo_matrix_invert(&c_matrix);
- cairo_transform(m_cr, &c_matrix);
+ cairo_transform(cr, &c_matrix);
}
String Path::debugString() const
@@ -346,7 +346,7 @@ String Path::debugString() const
return String();
String pathString;
- cairo_path_t* path = cairo_copy_path(platformPath()->m_cr);
+ cairo_path_t* path = cairo_copy_path(platformPath()->context());
cairo_path_data_t* data;
for (int i = 0; i < path->num_data; i += path->data[i].header.length) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list