summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-22 18:55:26 +0000
committerdglazkov@google.com <dglazkov@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-22 18:55:26 +0000
commit0c849446b658b3f26d40048221f8735045a64745 (patch)
treed924cb2074b338da969a4d5a916ce4d5a43aa7aa
parentc01615a10a463957b17a34da1192a4da0d59afaa (diff)
downloadchromium_src-0c849446b658b3f26d40048221f8735045a64745.zip
chromium_src-0c849446b658b3f26d40048221f8735045a64745.tar.gz
chromium_src-0c849446b658b3f26d40048221f8735045a64745.tar.bz2
Move svg/graphics/skia to the vendor branch (2/2).
R=darin Review URL: http://codereview.chromium.org/16801 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7359 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--DEPS2
-rw-r--r--webkit/SConscript.port8
-rw-r--r--webkit/build/WebCore/SConscript8
-rw-r--r--webkit/build/WebCore/WebCore.vcproj36
-rw-r--r--webkit/build/port/port.vcproj44
-rw-r--r--webkit/port/svg/graphics/skia/RenderPathSkia.cpp77
-rw-r--r--webkit/port/svg/graphics/skia/SVGPaintServerGradientSkia.cpp229
-rw-r--r--webkit/port/svg/graphics/skia/SVGPaintServerPatternSkia.cpp86
-rw-r--r--webkit/port/svg/graphics/skia/SVGPaintServerSkia.cpp75
-rw-r--r--webkit/port/svg/graphics/skia/SVGResourceFilterSkia.cpp54
-rw-r--r--webkit/port/svg/graphics/skia/SVGResourceMaskerSkia.cpp58
-rw-r--r--webkit/port/svg/graphics/skia/SkiaSupport.cpp117
-rw-r--r--webkit/port/svg/graphics/skia/SkiaSupport.h43
13 files changed, 45 insertions, 792 deletions
diff --git a/DEPS b/DEPS
index e45aafa..b5c6941 100644
--- a/DEPS
+++ b/DEPS
@@ -12,7 +12,7 @@ deps = {
"http://googletest.googlecode.com/svn/trunk@63",
"src/third_party/WebKit":
- "/trunk/deps/third_party/WebKit@7351",
+ "/trunk/deps/third_party/WebKit@7358",
"src/third_party/icu38":
"/trunk/deps/third_party/icu38@7121",
diff --git a/webkit/SConscript.port b/webkit/SConscript.port
index 4288838..c404384 100644
--- a/webkit/SConscript.port
+++ b/webkit/SConscript.port
@@ -83,14 +83,6 @@ input_files = [
'$PORT_DIR/platform/graphics/chromium/FontCustomPlatformData.cpp',
- '$PORT_DIR/svg/graphics/skia/RenderPathSkia.cpp',
- '$PORT_DIR/svg/graphics/skia/SkiaSupport.cpp',
- '$PORT_DIR/svg/graphics/skia/SVGPaintServerGradientSkia.cpp',
- '$PORT_DIR/svg/graphics/skia/SVGPaintServerPatternSkia.cpp',
- '$PORT_DIR/svg/graphics/skia/SVGPaintServerSkia.cpp',
- '$PORT_DIR/svg/graphics/skia/SVGResourceFilterSkia.cpp',
- '$PORT_DIR/svg/graphics/skia/SVGResourceMaskerSkia.cpp',
-
'$PORT_DIR/platform/image-decoders/bmp/BMPImageDecoder.cpp',
'$PORT_DIR/platform/image-decoders/bmp/BMPImageReader.cpp',
'$PORT_DIR/platform/image-decoders/gif/GIFImageDecoder.cpp',
diff --git a/webkit/build/WebCore/SConscript b/webkit/build/WebCore/SConscript
index 1235c8f..9889946 100644
--- a/webkit/build/WebCore/SConscript
+++ b/webkit/build/WebCore/SConscript
@@ -778,6 +778,14 @@ input_files = [
'$WEBCORE_DIR/svg/graphics/SVGResourceMarker.cpp',
'$WEBCORE_DIR/svg/graphics/SVGResourceMasker.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/RenderPathSkia.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/SkiaSupport.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/SVGPaintServerGradientSkia.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/SVGPaintServerPatternSkia.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/SVGPaintServerSkia.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/SVGResourceFilterSkia.cpp',
+ '$WEBCORE_DIR/svg/graphics/skia/SVGResourceMaskerSkia.cpp',
+
'$WEBCORE_DIR/xml/DOMParser.cpp',
'$WEBCORE_DIR/xml/NativeXPathNSResolver.cpp',
'$WEBCORE_DIR/xml/XMLHttpRequest.cpp',
diff --git a/webkit/build/WebCore/WebCore.vcproj b/webkit/build/WebCore/WebCore.vcproj
index dbf6632..3dcf2ff 100644
--- a/webkit/build/WebCore/WebCore.vcproj
+++ b/webkit/build/WebCore/WebCore.vcproj
@@ -6416,6 +6416,42 @@
<Filter
Name="graphics"
>
+ <Filter
+ Name="skia"
+ >
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\RenderPathSkia.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SkiaSupport.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SkiaSupport.h"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SVGPaintServerGradientSkia.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SVGPaintServerPatternSkia.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SVGPaintServerSkia.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SVGResourceFilterSkia.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\skia\SVGResourceMaskerSkia.cpp"
+ >
+ </File>
+ </Filter>
<File
RelativePath="..\..\..\third_party\WebKit\WebCore\svg\graphics\SVGImage.cpp"
>
diff --git a/webkit/build/port/port.vcproj b/webkit/build/port/port.vcproj
index 15265a9..8e2a2dc 100644
--- a/webkit/build/port/port.vcproj
+++ b/webkit/build/port/port.vcproj
@@ -1350,50 +1350,6 @@
</File>
</Filter>
<Filter
- Name="svg"
- >
- <Filter
- Name="graphics"
- >
- <Filter
- Name="skia"
- >
- <File
- RelativePath="..\..\port\svg\graphics\skia\RenderPathSkia.cpp"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SkiaSupport.cpp"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SkiaSupport.h"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SVGPaintServerGradientSkia.cpp"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SVGPaintServerPatternSkia.cpp"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SVGPaintServerSkia.cpp"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SVGResourceFilterSkia.cpp"
- >
- </File>
- <File
- RelativePath="..\..\port\svg\graphics\skia\SVGResourceMaskerSkia.cpp"
- >
- </File>
- </Filter>
- </Filter>
- </Filter>
- <Filter
Name="bridge"
>
<Filter
diff --git a/webkit/port/svg/graphics/skia/RenderPathSkia.cpp b/webkit/port/svg/graphics/skia/RenderPathSkia.cpp
deleted file mode 100644
index 1212969..0000000
--- a/webkit/port/svg/graphics/skia/RenderPathSkia.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "config.h"
-#include "GraphicsContext.h"
-#include "PlatformContextSkia.h"
-#include "RenderPath.h"
-#include "SkiaSupport.h"
-#include "SkiaUtils.h"
-#include "SkPaint.h"
-#include "SkPath.h"
-#include "SVGPaintServer.h"
-
-#if ENABLE(SVG)
-
-namespace WebCore {
-
-bool RenderPath::strokeContains(const FloatPoint& point, bool requiresStroke) const
-{
- if (path().isEmpty())
- return false;
-
- if (requiresStroke && !SVGPaintServer::strokePaintServer(style(), this))
- return false;
-
- GraphicsContext* scratch = scratchContext();
- scratch->save();
- applyStrokeStyleToContext(scratch, style(), this);
-
- SkPaint paint;
- scratch->platformContext()->setupPaintForStroking(&paint, 0, 0);
- SkPath strokePath;
- paint.getFillPath(*path().platformPath(), &strokePath);
- bool contains = SkPathContainsPoint(&strokePath, point,
- SkPath::kWinding_FillType);
-
- scratch->restore();
- return contains;
-}
-
-FloatRect RenderPath::strokeBBox() const
-{
- if (style()->svgStyle()->hasStroke())
- return strokeBoundingBox(path(), style(), this);
-
- return path().boundingRect();
-}
-
-}
-
-#endif // ENABLE(SVG)
diff --git a/webkit/port/svg/graphics/skia/SVGPaintServerGradientSkia.cpp b/webkit/port/svg/graphics/skia/SVGPaintServerGradientSkia.cpp
deleted file mode 100644
index 3b8b61b..0000000
--- a/webkit/port/svg/graphics/skia/SVGPaintServerGradientSkia.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "SVGPaintServerGradient.h"
-#include "SVGPaintServerLinearGradient.h"
-#include "SVGPaintServerRadialGradient.h"
-
-#include "GraphicsContext.h"
-#include "Path.h"
-#include "PlatformContextSkia.h"
-#include "RenderObject.h"
-#include "RenderPath.h"
-#include "RenderStyle.h"
-#include "SVGGradientElement.h"
-#include "SkiaSupport.h"
-
-#include "SkGradientShader.h"
-#include "SkPath.h"
-#include "SkMatrix.h"
-#include "SkiaUtils.h"
-
-namespace WebCore {
-
-// Helper class used by linear & radial gradient
-class SkiaGradientBuilder
-{
-public:
- SkiaGradientBuilder(const Vector<SVGGradientStop>& stops, float opacity) {
- count_ = stops.size();
- unsigned cur = 0;
-
- // If the gradient doesn't span the full width, add pseudo-stops
- // at the endpoints
- if (stops[0].first > 0) {
- count_++;
- cur++;
- }
-
- if (stops[stops.size()-1].first < 1)
- count_++;
-
- colors_ = new SkColor[count_];
- pos_ = new SkScalar[count_];
- float last = 0.0;
-
- // Loop through the WebKit-provided array of SVG gradient stops and
- // put it in a format suitable for providing to Skia
- for (unsigned i = 0; i < stops.size(); ++i, ++cur) {
- float offset = stops[i].first;
- Color color = stops[i].second;
-
- colors_[cur]=SkColorSetARGB(static_cast<int>(opacity*color.alpha()),
- color.red(),
- color.green(),
- color.blue());
- last=pos_[cur]=std::max(last, offset);
- }
-
- if (stops[0].first > 0) {
- colors_[0] = colors_[1];
- pos_[0] = 0;
- }
- if (stops[stops.size()-1].first < 1) {
- colors_[count_-1] = colors_[count_-2];
- pos_[count_-1] = 1;
- }
- }
-
- ~SkiaGradientBuilder() {
- delete[] colors_;
- delete[] pos_;
- }
-
- const SkColor* colors() const { return colors_; }
- const SkScalar* pos() const { return pos_; }
- unsigned count() const { return count_; }
-
-private:
- SkColor* colors_;
- SkScalar* pos_;
- unsigned count_;
-};
-
-bool SVGPaintServerGradient::setup(GraphicsContext*& context,
- const RenderObject* object,
- SVGPaintTargetType type,
- bool isPaintingText) const
-{
- m_ownerElement->buildGradient();
-
- RenderStyle* style = object->style();
- bool isFilled =
- (type & ApplyToFillTargetType) &&
- style->svgStyle()->hasFill();
- bool isStroked =
- (type & ApplyToStrokeTargetType) &&
- style->svgStyle()->hasStroke();
-
- if(!gradientStops().size())
- return false;
-
- if(gradientStops().size()==1) {
- context->setFillColor(gradientStops()[0].second);
- return true;
- }
-
- // Create a gradient builder helper to generate the data
- // we'll need to provide Skia
- SkiaGradientBuilder builder(gradientStops(),
- isFilled ? style->svgStyle()->fillOpacity() :
- style->svgStyle()->strokeOpacity());
-
- SkShader::TileMode tile_mode;
-
- // Convert SVG spread modes to Skia tile modes
- switch(spreadMethod())
- {
- default:
- case SpreadMethodPad:
- tile_mode = SkShader::kClamp_TileMode; break;
- case SpreadMethodReflect:
- tile_mode = SkShader::kMirror_TileMode; break;
- case SpreadMethodRepeat:
- tile_mode = SkShader::kRepeat_TileMode; break;
- }
-
- SkShader* shader = NULL;
-
- SkMatrix matrix;
-
- // Calculate a matrix to transform a gradient to fit the bounding box
- if (boundingBoxMode()) {
- matrix.reset();
- SkRect rc = boundingBoxForCurrentStroke(context);
-
- matrix.preTranslate(rc.fLeft, rc.fTop);
- matrix.preScale(rc.width(), rc.height());
- matrix.preConcat(gradientTransform());
- } else
- matrix = gradientTransform();
-
- if (this->type() == LinearGradientPaintServer) {
- const SVGPaintServerLinearGradient* linear =
- static_cast<const SVGPaintServerLinearGradient*>(this);
-
- SkPoint pts[2];
-
- pts[0].fX = linear->gradientStart().x();
- pts[0].fY = linear->gradientStart().y();
- pts[1].fX = linear->gradientEnd().x();
- pts[1].fY = linear->gradientEnd().y();
-
- shader = SkGradientShader::CreateLinear(pts,
- builder.colors(), builder.pos(), builder.count(), tile_mode);
- } else if (this->type() == RadialGradientPaintServer) {
- const SVGPaintServerRadialGradient* radial =
- static_cast<const SVGPaintServerRadialGradient*>(this);
-
- SkPoint center;
- SkScalar radius;
-
- center.fX = radial->gradientCenter().x();
- center.fY = radial->gradientCenter().y();
- radius = radial->gradientRadius();
-
- shader = SkGradientShader::CreateRadial(
- center, radius, builder.colors(), builder.pos(),
- builder.count(), tile_mode);
-
- } else {
- return false;
- }
-
- if (isPaintingText) {
- if (isFilled) {
- context->setTextDrawingMode(cTextFill);
- }
-
- if (isStroked) {
- context->setTextDrawingMode(cTextStroke);
- }
- }
-
- if (isStroked) {
- applyStrokeStyleToContext(context, style, object);
- }
-
- if (shader) {
- shader->setLocalMatrix(matrix);
- context->platformContext()->setGradient(shader);
-
- return true;
- }
-
- return false;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/webkit/port/svg/graphics/skia/SVGPaintServerPatternSkia.cpp b/webkit/port/svg/graphics/skia/SVGPaintServerPatternSkia.cpp
deleted file mode 100644
index 8400633..0000000
--- a/webkit/port/svg/graphics/skia/SVGPaintServerPatternSkia.cpp
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "GraphicsContext.h"
-#include "ImageBuffer.h"
-#include "RenderObject.h"
-#include "Pattern.h"
-#include "SVGPatternElement.h"
-#include "SVGPaintServerPattern.h"
-#include "SkiaSupport.h"
-
-#include "SkShader.h"
-#include "SkiaUtils.h"
-
-namespace WebCore {
-
-bool SVGPaintServerPattern::setup(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type, bool isPaintingText) const
-{
- RenderStyle* style = object->style();
-
- // Build pattern tile, passing destination object bounding box
- FloatRect targetRect;
- if (isPaintingText) {
- IntRect textBoundary = const_cast<RenderObject*>(object)->absoluteBoundingBoxRect();
- targetRect = object->absoluteTransform().inverse().mapRect(textBoundary);
- } else
- targetRect = object->relativeBBox(false);
-
- m_ownerElement->buildPattern(targetRect);
-
- if (!tile())
- return false;
-
- AffineTransform transform = patternTransform();
- transform.translate(patternBoundaries().x(), patternBoundaries().y());
-
- RefPtr<Pattern> pattern(Pattern::create(tile()->image(), true, true));
-
- if ((type & ApplyToFillTargetType) && style->svgStyle()->hasFill()) {
- context->setFillPattern(pattern);
- if (isPaintingText)
- context->setTextDrawingMode(cTextFill);
- }
-
- if ((type & ApplyToStrokeTargetType) && style->svgStyle()->hasStroke()) {
- context->setStrokePattern(pattern);
- applyStrokeStyleToContext(context, style, object);
- if (isPaintingText)
- context->setTextDrawingMode(cTextStroke);
- }
-
- return true;
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/webkit/port/svg/graphics/skia/SVGPaintServerSkia.cpp b/webkit/port/svg/graphics/skia/SVGPaintServerSkia.cpp
deleted file mode 100644
index 79776d8..0000000
--- a/webkit/port/svg/graphics/skia/SVGPaintServerSkia.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "SVGPaintServer.h"
-
-#include "GraphicsContext.h"
-#include "RenderPath.h"
-#include "PlatformContextSkia.h"
-#include "SkiaUtils.h"
-
-namespace WebCore {
-
-void SVGPaintServer::draw(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
-{
- if (!setup(context, object, type))
- return;
-
- renderPath(context, object, type);
- teardown(context, object, type);
-}
-
-void SVGPaintServer::teardown(GraphicsContext*& context, const RenderObject*, SVGPaintTargetType, bool isPaintingText) const
-{
- // WebKit implicitly expects us to reset the path.
- // For example in fillAndStrokePath() of RenderPath.cpp the path is
- // added back to the context after filling. This is because internally it
- // calls CGContextFillPath() which closes the path.
- context->beginPath();
- context->platformContext()->setGradient(NULL);
- context->platformContext()->setPattern(NULL);
-}
-
-void SVGPaintServer::renderPath(GraphicsContext*& context, const RenderObject* object, SVGPaintTargetType type) const
-{
- RenderStyle* renderStyle = object ? object->style() : NULL;
-
- if ((type & ApplyToFillTargetType) && (!renderStyle || renderStyle->svgStyle()->hasFill()))
- context->fillPath();
-
- if ((type & ApplyToStrokeTargetType) && (!renderStyle || renderStyle->svgStyle()->hasStroke()))
- context->strokePath();
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/webkit/port/svg/graphics/skia/SVGResourceFilterSkia.cpp b/webkit/port/svg/graphics/skia/SVGResourceFilterSkia.cpp
deleted file mode 100644
index 4f9aea7..0000000
--- a/webkit/port/svg/graphics/skia/SVGResourceFilterSkia.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "config.h"
-#if ENABLE(SVG) && ENABLE(SVG_FILTERS)
-#include "NotImplemented.h"
-#include "SVGResourceFilter.h"
-
-namespace WebCore {
-
-SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData()
-{
- return 0;
-}
-
-void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&)
-{
- notImplemented();
-}
-
-void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&)
-{
- notImplemented();
-}
-
-}
-
-#endif // ENABLE(SVG) && ENABLE(SVG_FILTERS)
diff --git a/webkit/port/svg/graphics/skia/SVGResourceMaskerSkia.cpp b/webkit/port/svg/graphics/skia/SVGResourceMaskerSkia.cpp
deleted file mode 100644
index e430633..0000000
--- a/webkit/port/svg/graphics/skia/SVGResourceMaskerSkia.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "config.h"
-
-#if ENABLE(SVG)
-#include "SVGResourceMasker.h"
-#include "ImageBuffer.h"
-#include "GraphicsContext.h"
-
-#include "NotImplemented.h"
-
-namespace WebCore {
-
-void SVGResourceMasker::applyMask(GraphicsContext*, const FloatRect& boundingBox)
-{
- // TODO(jhaas): implement me
-#if 0
- cairo_t* cr = context->platformContext();
- cairo_surface_t* surface = mask()->surface();
- if (!surface)
- return;
- cairo_pattern_t* mask = cairo_pattern_create_for_surface(surface);
- cairo_mask(cr, mask);
- cairo_pattern_destroy(mask);
-#endif
- notImplemented();
-}
-
-} // namespace WebCore
-
-#endif
diff --git a/webkit/port/svg/graphics/skia/SkiaSupport.cpp b/webkit/port/svg/graphics/skia/SkiaSupport.cpp
deleted file mode 100644
index 2c3fe0d..0000000
--- a/webkit/port/svg/graphics/skia/SkiaSupport.cpp
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Helper methods for Skia SVG rendering, inspired by CgSupport.*
-
-
-
-#include "config.h"
-#if ENABLE(SVG)
-#include "SkiaSupport.h"
-
-#include "ImageBuffer.h"
-#include "GraphicsContext.h"
-#include "RenderStyle.h"
-#include "RenderPath.h"
-#include "SVGPaintServer.h"
-#include "SVGRenderStyle.h"
-
-#include "SkiaUtils.h"
-#include "SkDashPathEffect.h"
-
-namespace WebCore {
-
-void applyStrokeStyleToContext(GraphicsContext* context, const RenderStyle* style, const RenderObject* object)
-{
- const SVGRenderStyle* svgStyle = style->svgStyle();
-
- context->setStrokeThickness(SVGRenderStyle::cssPrimitiveToLength(object, svgStyle->strokeWidth(), 1.0));
-
- context->setLineCap(svgStyle->capStyle());
- context->setLineJoin(svgStyle->joinStyle());
-
- if (svgStyle->joinStyle() == MiterJoin)
- context->setMiterLimit(svgStyle->strokeMiterLimit());
-
- const DashArray& dashes = dashArrayFromRenderingStyle(style);
- float dashOffset = SVGRenderStyle::cssPrimitiveToLength(object, style->svgStyle()->strokeDashOffset(), 0.0);
-
- unsigned int dashLength = !dashes.isEmpty() ? dashes.size() : 0;
- if(dashLength) {
- unsigned int count = (dashLength % 2) == 0 ? dashLength : dashLength * 2;
- SkScalar* intervals = new SkScalar[count];
-
- for(unsigned int i = 0; i < count; i++)
- intervals[i] = dashes[i % dashLength];
-
- context->platformContext()->setDashPathEffect(new SkDashPathEffect(intervals, count, dashOffset));
-
- delete[] intervals;
- }
-}
-
-GraphicsContext* scratchContext()
-{
- static ImageBuffer* scratch = NULL;
- if (!scratch)
- scratch = ImageBuffer::create(IntSize(1, 1), false).release();
- // We don't bother checking for failure creating the ImageBuffer, since our
- // ImageBuffer initializer won't fail.
- return scratch->context();
-}
-
-FloatRect boundingBoxForCurrentStroke(const GraphicsContext* context)
-{
- SkPaint paint;
- context->platformContext()->setupPaintForStroking(&paint, 0, 0);
- SkPath boundingPath;
- paint.getFillPath(*context->platformContext()->currentPath(),
- &boundingPath);
- SkRect r;
- boundingPath.computeBounds(&r, SkPath::kExact_BoundsType);
- return r;
-}
-
-FloatRect strokeBoundingBox(const Path& path, RenderStyle* style,
- const RenderObject* object)
-{
- GraphicsContext* scratch = scratchContext();
- scratch->save();
- scratch->beginPath();
- scratch->addPath(path);
- applyStrokeStyleToContext(scratch, style, object);
-
- FloatRect r = boundingBoxForCurrentStroke(scratch);
- scratch->restore();
- return r;
-}
-
-}
-
-#endif // ENABLE(SVG)
diff --git a/webkit/port/svg/graphics/skia/SkiaSupport.h b/webkit/port/svg/graphics/skia/SkiaSupport.h
deleted file mode 100644
index c4e7547..0000000
--- a/webkit/port/svg/graphics/skia/SkiaSupport.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Helper methods for Skia SVG rendering, inspired by CgSupport.*
-
-#ifndef SkiaSupport_h
-#define SkiaSupport_h
-
-#if ENABLE(SVG)
-
-#include "SVGResource.h"
-
-namespace WebCore {
-
-class Path;
-class FloatRect;
-class RenderStyle;
-class RenderObject;
-class GraphicsContext;
-
-void applyStrokeStyleToContext(GraphicsContext*, const RenderStyle*, const RenderObject*);
-void applyFillStyleToContext(GraphicsContext*, const RenderStyle*, const RenderObject*);
-
-// Returns a statically allocated 1x1 GraphicsContext intended for temporary
-// operations. Please save() the state and restore() it when you're done with
-// the context.
-GraphicsContext* scratchContext();
-
-// Computes the bounding box for the stroke and style currently selected into
-// the given bounding box. This also takes into account the stroke width.
-FloatRect boundingBoxForCurrentStroke(const GraphicsContext* context);
-
-// Returns the bounding box for the given path of the given style, including the
-// stroke width.
-FloatRect strokeBoundingBox(const Path& path, RenderStyle*, const RenderObject*);
-
-}
-
-
-#endif // ENABLE(SVG)
-#endif // #ifndef SkiaSupport_h
-