WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
wcore-cairo-path.diff (text/plain), 22.60 KB, created by
Carlos Garcia Campos
on 2020-03-09 07:16:33 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Garcia Campos
Created:
2020-03-09 07:16:33 PDT
Size:
22.60 KB
patch
obsolete
>diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ca2c6b72fb6..d5db8d0dcc7 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,52 @@ >+2020-03-09 Carlos Garcia Campos <cgarcia@igalia.com> >+ >+ [Cairo] Remove PlatformPathCairo >+ https://bugs.webkit.org/show_bug.cgi?id=208807 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We have a class CairoPath defined in PlatformPathCairo.h that simply wraps a cairo_t. We can use the cairo_t >+ directly as PlatformPath and simplify the cairo path implementation. >+ >+ * platform/SourcesCairo.txt: >+ * platform/graphics/Path.h: >+ (WebCore::Path::platformPath const): >+ * platform/graphics/cairo/CairoOperations.cpp: >+ (WebCore::Cairo::fillRectWithRoundedHole): >+ (WebCore::Cairo::fillPath): >+ (WebCore::Cairo::strokePath): >+ (WebCore::Cairo::clipPath): >+ * platform/graphics/cairo/CairoUtilities.cpp: >+ (WebCore::appendWebCorePathToCairoContext): >+ * platform/graphics/cairo/FontCairo.cpp: >+ (WebCore::Font::platformPathForGlyph const): >+ * platform/graphics/cairo/PathCairo.cpp: >+ (WebCore::Path::Path): >+ (WebCore::Path::ensurePlatformPath): >+ (WebCore::Path::operator=): >+ (WebCore::Path::clear): >+ (WebCore::Path::isEmptySlowCase const): >+ (WebCore::Path::currentPointSlowCase const): >+ (WebCore::Path::translate): >+ (WebCore::Path::moveToSlowCase): >+ (WebCore::Path::addLineToSlowCase): >+ (WebCore::Path::addRect): >+ (WebCore::Path::addQuadCurveTo): >+ (WebCore::Path::addBezierCurveTo): >+ (WebCore::Path::addArcSlowCase): >+ (WebCore::Path::addArcTo): >+ (WebCore::Path::addEllipse): >+ (WebCore::Path::addPath): >+ (WebCore::Path::closeSubpath): >+ (WebCore::Path::boundingRectSlowCase const): >+ (WebCore::Path::strokeBoundingRect const): >+ (WebCore::Path::contains const): >+ (WebCore::Path::strokeContains const): >+ (WebCore::Path::applySlowCase const): >+ (WebCore::Path::transform): >+ * platform/graphics/cairo/PlatformPathCairo.cpp: Removed. >+ * platform/graphics/cairo/PlatformPathCairo.h: Removed. >+ > 2020-03-07 Darin Adler <darin@apple.com> > > Begin moving off of live ranges for WebKit internals >diff --git a/Source/WebCore/platform/SourcesCairo.txt b/Source/WebCore/platform/SourcesCairo.txt >index 6fa4ffe1460..21d93d01a80 100644 >--- a/Source/WebCore/platform/SourcesCairo.txt >+++ b/Source/WebCore/platform/SourcesCairo.txt >@@ -40,5 +40,4 @@ platform/graphics/cairo/NativeImageCairo.cpp > platform/graphics/cairo/PathCairo.cpp > platform/graphics/cairo/PatternCairo.cpp > platform/graphics/cairo/PlatformContextCairo.cpp >-platform/graphics/cairo/PlatformPathCairo.cpp > platform/graphics/cairo/RefPtrCairo.cpp >diff --git a/Source/WebCore/platform/graphics/Path.h b/Source/WebCore/platform/graphics/Path.h >index debe2f0dc72..e99329803fb 100644 >--- a/Source/WebCore/platform/graphics/Path.h >+++ b/Source/WebCore/platform/graphics/Path.h >@@ -55,11 +55,10 @@ class PlatformContextDirect2D; > } > > #elif USE(CAIRO) >+#include "RefPtrCairo.h" > >-namespace WebCore { >-class CairoPath; >-} >-typedef WebCore::CairoPath PlatformPath; >+// cairo_path_fixed_t isn't exposed in Cairo's public API, so we need to use context. >+typedef cairo_t PlatformPath; > > #elif USE(WINGDI) > >@@ -80,6 +79,8 @@ typedef PlatformPath* PlatformPathPtr; > using PlatformPathStorageType = RetainPtr<CGMutablePathRef>; > #elif USE(DIRECT2D) > using PlatformPathStorageType = COMPtr<ID2D1GeometryGroup>; >+#elif USE(CAIRO) >+using PlatformPathStorageType = RefPtr<cairo_t>; > #else > using PlatformPathStorageType = PlatformPathPtr; > #endif >@@ -188,6 +189,8 @@ public: > PlatformPathPtr platformPath() const { return m_path.get(); } > #elif USE(CG) > WEBCORE_EXPORT PlatformPathPtr platformPath() const; >+#elif USE(CAIRO) >+ PlatformPathPtr platformPath() const { return m_path.get(); } > #else > PlatformPathPtr platformPath() const { return m_path; } > #endif >diff --git a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >index ad33265418e..6127679e69f 100644 >--- a/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >+++ b/Source/WebCore/platform/graphics/cairo/CairoOperations.cpp >@@ -46,7 +46,6 @@ > #include "ImageBuffer.h" > #include "Path.h" > #include "PlatformContextCairo.h" >-#include "PlatformPathCairo.h" > #include "ShadowBlur.h" > #include <algorithm> > #include <cairo.h> >@@ -780,7 +779,7 @@ void fillRectWithRoundedHole(PlatformContextCairo& platformContext, const FloatR > cairo_t* cr = platformContext.cr(); > > cairo_save(cr); >- setPathOnCairoContext(platformContext.cr(), path.platformPath()->context()); >+ setPathOnCairoContext(platformContext.cr(), path.platformPath()); > fillCurrentCairoPath(platformContext, fillSource); > cairo_restore(cr); > } >@@ -789,7 +788,7 @@ void fillPath(PlatformContextCairo& platformContext, const Path& path, const Fil > { > cairo_t* cr = platformContext.cr(); > >- setPathOnCairoContext(cr, path.platformPath()->context()); >+ setPathOnCairoContext(cr, path.platformPath()); > drawPathShadow(platformContext, fillSource, { }, shadowState, Fill); > fillCurrentCairoPath(platformContext, fillSource); > } >@@ -812,7 +811,7 @@ void strokePath(PlatformContextCairo& platformContext, const Path& path, const S > { > cairo_t* cr = platformContext.cr(); > >- setPathOnCairoContext(cr, path.platformPath()->context()); >+ setPathOnCairoContext(cr, path.platformPath()); > drawPathShadow(platformContext, { }, strokeSource, shadowState, Stroke); > prepareForStroking(cr, strokeSource, PreserveAlpha); > cairo_stroke(cr); >@@ -1285,7 +1284,7 @@ void clipPath(PlatformContextCairo& platformContext, const Path& path, WindRule > cairo_t* cr = platformContext.cr(); > > if (!path.isNull()) >- setPathOnCairoContext(cr, path.platformPath()->context()); >+ setPathOnCairoContext(cr, path.platformPath()); > > cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr); > cairo_set_fill_rule(cr, clipRule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); >diff --git a/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp b/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp >index 02185b7607c..56059d6b2c9 100644 >--- a/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp >+++ b/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp >@@ -35,7 +35,6 @@ > #include "FloatRect.h" > #include "IntRect.h" > #include "Path.h" >-#include "PlatformPathCairo.h" > #include "RefPtrCairo.h" > #include "Region.h" > #include <wtf/Assertions.h> >@@ -109,7 +108,7 @@ void appendWebCorePathToCairoContext(cairo_t* context, const Path& path) > { > if (path.isEmpty()) > return; >- appendPathToCairoContext(context, path.platformPath()->context()); >+ appendPathToCairoContext(context, path.platformPath()); > } > > void appendRegionToCairoContext(cairo_t* to, const cairo_region_t* region) >diff --git a/Source/WebCore/platform/graphics/cairo/FontCairo.cpp b/Source/WebCore/platform/graphics/cairo/FontCairo.cpp >index 6970d4639c8..08e91a3ba66 100644 >--- a/Source/WebCore/platform/graphics/cairo/FontCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/FontCairo.cpp >@@ -43,7 +43,6 @@ > #include "ImageBuffer.h" > #include "Pattern.h" > #include "PlatformContextCairo.h" >-#include "PlatformPathCairo.h" > #include "ShadowBlur.h" > > namespace WebCore { >@@ -83,16 +82,16 @@ void FontCascade::drawGlyphs(GraphicsContext& context, const Font& font, const G > Path Font::platformPathForGlyph(Glyph glyph) const > { > Path path; >- path.ensurePlatformPath(); >+ cairo_t* cr = path.ensurePlatformPath(); > > cairo_glyph_t cairoGlyph = { glyph, 0, 0 }; >- cairo_set_scaled_font(path.platformPath()->context(), platformData().scaledFont()); >- cairo_glyph_path(path.platformPath()->context(), &cairoGlyph, 1); >+ cairo_set_scaled_font(cr, platformData().scaledFont()); >+ cairo_glyph_path(cr, &cairoGlyph, 1); > > float syntheticBoldOffset = this->syntheticBoldOffset(); > if (syntheticBoldOffset) { >- cairo_translate(path.platformPath()->context(), syntheticBoldOffset, 0); >- cairo_glyph_path(path.platformPath()->context(), &cairoGlyph, 1); >+ cairo_translate(cr, syntheticBoldOffset, 0); >+ cairo_glyph_path(cr, &cairoGlyph, 1); > } > return path; > } >diff --git a/Source/WebCore/platform/graphics/cairo/PathCairo.cpp b/Source/WebCore/platform/graphics/cairo/PathCairo.cpp >index 552569fd197..90c4d166b66 100644 >--- a/Source/WebCore/platform/graphics/cairo/PathCairo.cpp >+++ b/Source/WebCore/platform/graphics/cairo/PathCairo.cpp >@@ -5,7 +5,7 @@ > 2005, 2007 Apple Inc. All Rights reserved. > 2007 Alp Toker <alp@atoker.com> > 2008 Dirk Schulze <krit@webkit.org> >- 2011 Igalia S.L. >+ 2011, 2020 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 >@@ -31,7 +31,6 @@ > #include "CairoUtilities.h" > #include "FloatRect.h" > #include "GraphicsContextImplCairo.h" >-#include "PlatformPathCairo.h" > #include "StrokeStyleApplier.h" > #include <math.h> > #include <wtf/MathExtras.h> >@@ -39,29 +38,21 @@ > > namespace WebCore { > >-Path::Path() >- : m_path(0) >-{ >-} >+Path::Path() = default; > >-Path::~Path() >-{ >- if (m_path) >- delete m_path; >-} >+Path::~Path() = default; > > Path::Path(const Path& other) >- : m_path(0) > { > if (other.isNull()) > return; > >- cairo_t* cr = ensurePlatformPath()->context(); >- auto pathCopy = cairo_copy_path(other.platformPath()->context()); >+ cairo_t* cr = ensurePlatformPath(); >+ auto pathCopy = cairo_copy_path(other.platformPath()); > cairo_append_path(cr, pathCopy); > cairo_path_destroy(pathCopy); > } >- >+ > Path::Path(Path&& other) > { > m_path = other.m_path; >@@ -70,9 +61,11 @@ Path::Path(Path&& other) > > PlatformPathPtr Path::ensurePlatformPath() > { >- if (!m_path) >- m_path = new CairoPath(); >- return m_path; >+ if (!m_path) { >+ RefPtr<cairo_surface_t> surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1)); >+ m_path = adoptRef(cairo_create(surface.get())); >+ } >+ return m_path.get(); > } > > Path& Path::operator=(const Path& other) >@@ -81,27 +74,24 @@ Path& Path::operator=(const Path& other) > return *this; > > if (other.isNull()) { >- if (m_path) { >- delete m_path; >- m_path = 0; >- } >- } else { >- clear(); >- cairo_t* cr = ensurePlatformPath()->context(); >- auto pathCopy = cairo_copy_path(other.platformPath()->context()); >- cairo_append_path(cr, pathCopy); >- cairo_path_destroy(pathCopy); >+ m_path = nullptr; >+ return *this; > } > >+ clear(); >+ cairo_t* cr = ensurePlatformPath(); >+ auto pathCopy = cairo_copy_path(other.platformPath()); >+ cairo_append_path(cr, pathCopy); >+ cairo_path_destroy(pathCopy); >+ > return *this; > } >- >+ > Path& Path::operator=(Path&& other) > { > if (this == &other) > return *this; >- if (m_path) >- delete m_path; >+ > m_path = other.m_path; > other.m_path = nullptr; > return *this; >@@ -112,78 +102,69 @@ void Path::clear() > if (isNull()) > return; > >- cairo_t* cr = platformPath()->context(); >- cairo_identity_matrix(cr); >- cairo_new_path(cr); >+ cairo_identity_matrix(m_path.get()); >+ cairo_new_path(m_path.get()); > } > > bool Path::isEmptySlowCase() const > { >- return !cairo_has_current_point(platformPath()->context()); >+ return !cairo_has_current_point(m_path.get()); > } > > FloatPoint Path::currentPointSlowCase() const > { >+ ASSERT(m_path); > // FIXME: Is this the correct way? > double x; > double y; >- cairo_get_current_point(platformPath()->context(), &x, &y); >+ cairo_get_current_point(m_path.get(), &x, &y); > return FloatPoint(x, y); > } > > void Path::translate(const FloatSize& p) > { >- cairo_t* cr = ensurePlatformPath()->context(); >- cairo_translate(cr, -p.width(), -p.height()); >+ cairo_translate(ensurePlatformPath(), -p.width(), -p.height()); > } > > void Path::moveToSlowCase(const FloatPoint& p) > { >- cairo_t* cr = ensurePlatformPath()->context(); >- cairo_move_to(cr, p.x(), p.y()); >+ cairo_move_to(ensurePlatformPath(), p.x(), p.y()); > } > > void Path::addLineToSlowCase(const FloatPoint& p) > { >- cairo_t* cr = ensurePlatformPath()->context(); >- cairo_line_to(cr, p.x(), p.y()); >+ cairo_line_to(ensurePlatformPath(), p.x(), p.y()); > } > > void Path::addRect(const FloatRect& rect) > { >- cairo_t* cr = ensurePlatformPath()->context(); >- cairo_rectangle(cr, rect.x(), rect.y(), rect.width(), rect.height()); >+ cairo_rectangle(ensurePlatformPath(), rect.x(), rect.y(), rect.width(), rect.height()); > } > >-/* >- * inspired by libsvg-cairo >- */ > void Path::addQuadCurveTo(const FloatPoint& controlPoint, const FloatPoint& point) > { >- cairo_t* cr = ensurePlatformPath()->context(); > double x, y; > double x1 = controlPoint.x(); > double y1 = controlPoint.y(); > double x2 = point.x(); > double y2 = point.y(); >+ cairo_t* cr = ensurePlatformPath(); > cairo_get_current_point(cr, &x, &y); > cairo_curve_to(cr, >- x + 2.0 / 3.0 * (x1 - x), y + 2.0 / 3.0 * (y1 - y), >- x2 + 2.0 / 3.0 * (x1 - x2), y2 + 2.0 / 3.0 * (y1 - y2), >- x2, y2); >+ x + 2.0 / 3.0 * (x1 - x), y + 2.0 / 3.0 * (y1 - y), >+ x2 + 2.0 / 3.0 * (x1 - x2), y2 + 2.0 / 3.0 * (y1 - y2), >+ x2, y2); > } > > void Path::addBezierCurveTo(const FloatPoint& controlPoint1, const FloatPoint& controlPoint2, const FloatPoint& controlPoint3) > { >- cairo_t* cr = ensurePlatformPath()->context(); >- cairo_curve_to(cr, controlPoint1.x(), controlPoint1.y(), >- controlPoint2.x(), controlPoint2.y(), >- controlPoint3.x(), controlPoint3.y()); >+ cairo_curve_to(ensurePlatformPath(), controlPoint1.x(), controlPoint1.y(), >+ controlPoint2.x(), controlPoint2.y(), controlPoint3.x(), controlPoint3.y()); > } > > void Path::addArcSlowCase(const FloatPoint& p, float r, float startAngle, float endAngle, bool anticlockwise) > { >- cairo_t* cr = ensurePlatformPath()->context(); >+ cairo_t* cr = ensurePlatformPath(); > float sweep = endAngle - startAngle; > const float twoPI = 2 * piFloat; > if ((sweep <= -twoPI || sweep >= twoPI) >@@ -213,8 +194,7 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius) > if (isEmpty()) > return; > >- cairo_t* cr = platformPath()->context(); >- >+ cairo_t* cr = platformPath(); > double x0, y0; > cairo_get_current_point(cr, &x0, &y0); > FloatPoint p0(x0, y0); >@@ -231,7 +211,6 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius) > FloatPoint p1p2((p2.x() - p1.x()),(p2.y() - p1.y())); > float p1p0_length = std::hypot(p1p0.x(), p1p0.y()); > float p1p2_length = std::hypot(p1p2.x(), p1p2.y()); >- > double cos_phi = (p1p0.x() * p1p2.x() + p1p0.y() * p1p2.y()) / (p1p0_length * p1p2_length); > // all points on a line logic > if (cos_phi == -1) { >@@ -290,7 +269,7 @@ void Path::addArcTo(const FloatPoint& p1, const FloatPoint& p2, float radius) > > void Path::addEllipse(FloatPoint point, float radiusX, float radiusY, float rotation, float startAngle, float endAngle, bool anticlockwise) > { >- cairo_t* cr = ensurePlatformPath()->context(); >+ cairo_t* cr = ensurePlatformPath(); > cairo_save(cr); > cairo_translate(cr, point.x(), point.y()); > cairo_rotate(cr, rotation); >@@ -306,7 +285,7 @@ void Path::addEllipse(FloatPoint point, float radiusX, float radiusY, float rota > > void Path::addEllipse(const FloatRect& rect) > { >- cairo_t* cr = ensurePlatformPath()->context(); >+ cairo_t* cr = ensurePlatformPath(); > cairo_save(cr); > float yRadius = .5 * rect.height(); > float xRadius = .5 * rect.width(); >@@ -325,26 +304,25 @@ void Path::addPath(const Path& path, const AffineTransform& transform) > if (cairo_matrix_invert(&matrix) != CAIRO_STATUS_SUCCESS) > return; > >- cairo_t* cr = path.platformPath()->context(); >+ cairo_t* cr = path.platformPath(); > cairo_save(cr); > cairo_transform(cr, &matrix); > auto pathCopy = cairo_copy_path(cr); > cairo_restore(cr); >- cairo_append_path(ensurePlatformPath()->context(), pathCopy); >+ cairo_append_path(ensurePlatformPath(), pathCopy); > cairo_path_destroy(pathCopy); > } > > void Path::closeSubpath() > { >- cairo_t* cr = ensurePlatformPath()->context(); >- cairo_close_path(cr); >+ cairo_close_path(ensurePlatformPath()); > } > > FloatRect Path::boundingRectSlowCase() const > { >- cairo_t* cr = platformPath()->context(); >+ ASSERT(m_path); > double x0, x1, y0, y1; >- cairo_path_extents(cr, &x0, &y0, &x1, &y1); >+ cairo_path_extents(m_path.get(), &x0, &y0, &x1, &y1); > return FloatRect(x0, y0, x1 - x0, y1 - y0); > } > >@@ -354,14 +332,14 @@ FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier) const > if (isNull()) > return FloatRect(); > >- cairo_t* cr = platformPath()->context(); >+ ASSERT(m_path); > if (applier) { >- GraphicsContext gc(GraphicsContextImplCairo::createFactory(cr)); >+ GraphicsContext gc(GraphicsContextImplCairo::createFactory(m_path.get())); > applier->strokeStyle(&gc); > } > > double x0, x1, y0, y1; >- cairo_stroke_extents(cr, &x0, &y0, &x1, &y1); >+ cairo_stroke_extents(m_path.get(), &x0, &y0, &x1, &y1); > return FloatRect(x0, y0, x1 - x0, y1 - y0); > } > >@@ -369,11 +347,12 @@ bool Path::contains(const FloatPoint& point, WindRule rule) const > { > if (isNull() || !std::isfinite(point.x()) || !std::isfinite(point.y())) > return false; >- cairo_t* cr = platformPath()->context(); >- cairo_fill_rule_t cur = cairo_get_fill_rule(cr); >- cairo_set_fill_rule(cr, rule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); >- bool contains = cairo_in_fill(cr, point.x(), point.y()); >- cairo_set_fill_rule(cr, cur); >+ >+ ASSERT(m_path); >+ cairo_fill_rule_t cur = cairo_get_fill_rule(m_path.get()); >+ cairo_set_fill_rule(m_path.get(), rule == WindRule::EvenOdd ? CAIRO_FILL_RULE_EVEN_ODD : CAIRO_FILL_RULE_WINDING); >+ bool contains = cairo_in_fill(m_path.get(), point.x(), point.y()); >+ cairo_set_fill_rule(m_path.get(), cur); > return contains; > } > >@@ -382,19 +361,19 @@ bool Path::strokeContains(StrokeStyleApplier& applier, const FloatPoint& point) > if (isNull()) > return false; > >- cairo_t* cr = platformPath()->context(); >+ ASSERT(m_path); > { >- GraphicsContext graphicsContext(GraphicsContextImplCairo::createFactory(cr)); >+ GraphicsContext graphicsContext(GraphicsContextImplCairo::createFactory(m_path.get())); > applier.strokeStyle(&graphicsContext); > } > >- return cairo_in_stroke(cr, point.x(), point.y()); >+ return cairo_in_stroke(m_path.get(), point.x(), point.y()); > } > > void Path::applySlowCase(const PathApplierFunction& function) const > { >- cairo_t* cr = platformPath()->context(); >- auto pathCopy = cairo_copy_path(cr); >+ ASSERT(m_path); >+ auto pathCopy = cairo_copy_path(m_path.get()); > cairo_path_data_t* data; > PathElement pathElement; > >@@ -434,10 +413,9 @@ FloatRect Path::fastBoundingRectSlowCase() const > > void Path::transform(const AffineTransform& transform) > { >- cairo_t* cr = ensurePlatformPath()->context(); > cairo_matrix_t matrix = toCairoMatrix(transform); > cairo_matrix_invert(&matrix); >- cairo_transform(cr, &matrix); >+ cairo_transform(ensurePlatformPath(), &matrix); > } > > bool Path::isNull() const >diff --git a/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp b/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp >deleted file mode 100644 >index 5a0171311c7..00000000000 >--- a/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.cpp >+++ /dev/null >@@ -1,38 +0,0 @@ >-/* >- * Copyright (C) 2011 Collabora Ltd. >- * >- * This library is free software; you can redistribute it and/or >- * modify it under the terms of the GNU Library General Public >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#include "config.h" >-#include "PlatformPathCairo.h" >- >-#if USE(CAIRO) >- >-#include <cairo.h> >- >-namespace WebCore { >- >-CairoPath::CairoPath() >-{ >- // cairo_t takes its own reference of the surface, meaning we don't have to keep one. >- auto surface = adoptRef(cairo_image_surface_create(CAIRO_FORMAT_A8, 1, 1)); >- m_context = adoptRef(cairo_create(surface.get())); >-} >- >-} // namespace WebCore >- >-#endif // USE(CAIRO) >diff --git a/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.h b/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.h >deleted file mode 100644 >index cd1f541b5f3..00000000000 >--- a/Source/WebCore/platform/graphics/cairo/PlatformPathCairo.h >+++ /dev/null >@@ -1,43 +0,0 @@ >-/* >- * Copyright (C) 2007 Alp Toker <alp.toker@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 >- * License as published by the Free Software Foundation; either >- * version 2 of the License, or (at your option) any later version. >- * >- * This library is distributed in the hope that it will be useful, >- * but WITHOUT ANY WARRANTY; without even the implied warranty of >- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU >- * Library General Public License for more details. >- * >- * You should have received a copy of the GNU Library General Public License >- * along with this library; see the file COPYING.LIB. If not, write to >- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, >- * Boston, MA 02110-1301, USA. >- */ >- >-#pragma once >- >-#if USE(CAIRO) >- >-#include "RefPtrCairo.h" >- >-namespace WebCore { >- >-// This is necessary since cairo_path_fixed_t isn't exposed in Cairo's public API. >-class CairoPath { >-public: >- CairoPath(); >- ~CairoPath() = default; >- >- cairo_t* context() { return m_context.get(); } >- >-private: >- RefPtr<cairo_t> m_context; >-}; >- >-} // namespace WebCore >- >-#endif // USE(CAIRO)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
darin
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 208807
:
393028
|
393142