[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198
paroga at webkit.org
paroga at webkit.org
Sun Feb 20 23:53:35 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 4f7e03d947626fc509dfd938d54085b7dc381059
Author: paroga at webkit.org <paroga at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 26 14:50:19 2011 +0000
2011-01-26 Patrick Gansterer <paroga at webkit.org>
Reviewed by Andreas Kling.
[SKIA] Remove "current path" of GraphicsContext
https://bugs.webkit.org/show_bug.cgi?id=53124
* platform/graphics/GraphicsContext.h:
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::clipPath):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
* platform/graphics/skia/PathSkia.cpp:
(WebCore::Path::strokeBoundingRect):
* platform/graphics/skia/PlatformContextSkia.cpp:
* platform/graphics/skia/PlatformContextSkia.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76688 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index e704760..0bf84c9 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2011-01-26 Patrick Gansterer <paroga at webkit.org>
+
+ Reviewed by Andreas Kling.
+
+ [SKIA] Remove "current path" of GraphicsContext
+ https://bugs.webkit.org/show_bug.cgi?id=53124
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/skia/GraphicsContextSkia.cpp:
+ (WebCore::GraphicsContext::clipPath):
+ (WebCore::GraphicsContext::fillPath):
+ (WebCore::GraphicsContext::strokePath):
+ * platform/graphics/skia/PathSkia.cpp:
+ (WebCore::Path::strokeBoundingRect):
+ * platform/graphics/skia/PlatformContextSkia.cpp:
+ * platform/graphics/skia/PlatformContextSkia.h:
+
2011-01-26 Zalan Bujtas <zbujtas at gmail.com>
Reviewed by Andreas Kling.
diff --git a/Source/WebCore/platform/graphics/GraphicsContext.h b/Source/WebCore/platform/graphics/GraphicsContext.h
index 6d6c043..6c9a2f6 100644
--- a/Source/WebCore/platform/graphics/GraphicsContext.h
+++ b/Source/WebCore/platform/graphics/GraphicsContext.h
@@ -369,11 +369,6 @@ namespace WebCore {
void setCompositeOperation(CompositeOperator);
CompositeOperator compositeOperation() const;
-#if PLATFORM(SKIA)
- void beginPath();
- void addPath(const Path&);
-#endif
-
void clip(const Path&);
// This clip function is used only by <canvas> code. It allows
diff --git a/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp b/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
index 1a7112b..9f2ed32 100644
--- a/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp
@@ -309,20 +309,6 @@ void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness
platformContext()->clipPathAntiAliased(path);
}
-void GraphicsContext::addPath(const Path& path)
-{
- if (paintingDisabled())
- return;
- platformContext()->addPath(*path.platformPath());
-}
-
-void GraphicsContext::beginPath()
-{
- if (paintingDisabled())
- return;
- platformContext()->beginPath();
-}
-
void GraphicsContext::clearPlatformShadow()
{
if (paintingDisabled())
@@ -431,11 +417,7 @@ void GraphicsContext::clipPath(const Path& pathToClip, WindRule clipRule)
if (platformContext()->useGPU())
platformContext()->gpuCanvas()->clipPath(pathToClip);
- // FIXME: Be smarter about this.
- beginPath();
- addPath(pathToClip);
-
- SkPath path = platformContext()->currentPathInLocalCoordinates();
+ SkPath path = *pathToClip.platformPath();
if (!isPathSkiaSafe(getCTM(), path))
return;
@@ -738,17 +720,13 @@ void GraphicsContext::fillPath(const Path& pathToFill)
if (paintingDisabled())
return;
- // FIXME: Be smarter about this.
- beginPath();
- addPath(pathToFill);
-
if (platformContext()->useGPU() && platformContext()->canAccelerate()) {
platformContext()->prepareForHardwareDraw();
platformContext()->gpuCanvas()->fillPath(pathToFill);
return;
}
- SkPath path = platformContext()->currentPathInLocalCoordinates();
+ SkPath path = *pathToFill.platformPath();
if (!isPathSkiaSafe(getCTM(), path))
return;
@@ -1204,11 +1182,7 @@ void GraphicsContext::strokePath(const Path& pathToStroke)
if (paintingDisabled())
return;
- // FIXME: Be smarter about this.
- beginPath();
- addPath(pathToStroke);
-
- SkPath path = platformContext()->currentPathInLocalCoordinates();
+ SkPath path = *pathToStroke.platformPath();
if (!isPathSkiaSafe(getCTM(), path))
return;
diff --git a/Source/WebCore/platform/graphics/skia/PathSkia.cpp b/Source/WebCore/platform/graphics/skia/PathSkia.cpp
index 89323c4..6318c21 100644
--- a/Source/WebCore/platform/graphics/skia/PathSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PathSkia.cpp
@@ -227,28 +227,20 @@ void Path::transform(const AffineTransform& xform)
m_path->transform(xform);
}
-// Computes the bounding box for the stroke and style currently selected into
-// the given bounding box. This also takes into account the stroke width.
-static FloatRect boundingBoxForCurrentStroke(const GraphicsContext* context)
-{
- SkPaint paint;
- context->platformContext()->setupPaintForStroking(&paint, 0, 0);
- SkPath boundingPath;
- paint.getFillPath(context->platformContext()->currentPathInLocalCoordinates(), &boundingPath);
- return boundingPath.getBounds();
-}
-
FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
{
GraphicsContext* scratch = scratchContext();
scratch->save();
- scratch->beginPath();
- scratch->addPath(*this);
if (applier)
applier->strokeStyle(scratch);
- FloatRect r = boundingBoxForCurrentStroke(scratch);
+ SkPaint paint;
+ scratch->platformContext()->setupPaintForStroking(&paint, 0, 0);
+ SkPath boundingPath;
+ paint.getFillPath(*platformPath(), &boundingPath);
+
+ FloatRect r = boundingPath.getBounds();
scratch->restore();
return r;
}
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
index d852e9b..183a24f 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.cpp
@@ -550,38 +550,12 @@ SkColor PlatformContextSkia::effectiveStrokeColor() const
return m_state->applyAlpha(m_state->m_strokeColor);
}
-void PlatformContextSkia::beginPath()
-{
- m_path.reset();
-}
-
-void PlatformContextSkia::addPath(const SkPath& path)
-{
- m_path.addPath(path, m_canvas->getTotalMatrix());
-}
-
-SkPath PlatformContextSkia::currentPathInLocalCoordinates() const
-{
- SkPath localPath = m_path;
- const SkMatrix& matrix = m_canvas->getTotalMatrix();
- SkMatrix inverseMatrix;
- if (!matrix.invert(&inverseMatrix))
- return SkPath();
- localPath.transform(inverseMatrix);
- return localPath;
-}
-
void PlatformContextSkia::canvasClipPath(const SkPath& path)
{
m_state->m_canvasClipApplied = true;
m_canvas->clipPath(path);
}
-void PlatformContextSkia::setFillRule(SkPath::FillType fr)
-{
- m_path.setFillType(fr);
-}
-
void PlatformContextSkia::setFillShader(SkShader* fillShader)
{
if (fillShader)
diff --git a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
index 0304486..d7dd6a9 100644
--- a/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
+++ b/Source/WebCore/platform/graphics/skia/PlatformContextSkia.h
@@ -118,7 +118,6 @@ public:
void setAlpha(float);
void setLineCap(SkPaint::Cap);
void setLineJoin(SkPaint::Join);
- void setFillRule(SkPath::FillType);
void setXfermodeMode(SkXfermode::Mode);
void setFillColor(SkColor);
void setFillShader(SkShader*);
@@ -137,10 +136,6 @@ public:
float getAlpha() const;
int getNormalizedAlpha() const;
- void beginPath();
- void addPath(const SkPath&);
- SkPath currentPathInLocalCoordinates() const;
-
void canvasClipPath(const SkPath&);
// Returns the fill color. The returned color has it's alpha adjusted
@@ -220,9 +215,6 @@ private:
// mStateStack.back().
State* m_state;
- // Current path in global coordinates.
- SkPath m_path;
-
// Stores image sizes for a hint to compute image resampling modes.
// Values are used in ImageSkia.cpp
IntSize m_imageResamplingHintSrcSize;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list