No subject
Mon Jan 28 08:41:14 PST 2013
9608">r149608</a> by <jbroman at chromium.org>
<http://src.chromium.org/viewvc/blink?view=3Drevision&revision=3D1=
49608>
This is no longer used since almost a year ago, when HAVE(PATH_BASED_BORD=
ER_RADIUS_DRAWING) was inlined.
* platform/graphics/GraphicsContext.h:
* platform/graphics/blackberry/GraphicsContextBlackBerry.cpp:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/wince/GraphicsContextWinCE.cpp:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href=3D"#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeL=
og</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicsGraphicsContexth">trunk=
/Source/WebCore/platform/graphics/GraphicsContext.h</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicsblackberryGraphicsConte=
xtBlackBerrycpp">trunk/Source/WebCore/platform/graphics/blackberry/Graphi=
csContextBlackBerry.cpp</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicscairoGraphicsContextCai=
rocpp">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.=
cpp</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"=
>trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp</a></li>
<li><a href=3D"#trunkSourceWebCoreplatformgraphicswinceGraphicsContextWin=
CEcpp">trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.=
cpp</a></li>
</ul>
</div>
<div id=3D"patch">
<h3>Diff</h3>
<a id=3D"trunkSourceWebCoreChangeLog"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (1495=
65 =3D> 149566)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/ChangeLog 2013-05-04 20:10:=
12 UTC (rev 149565)
+++ trunk/Source/WebCore/ChangeLog 2013-05-04 20:22:01 UTC (rev 149566)
</span><span class=3D"lines">@@ -1,5 +1,20 @@
</span><span class=3D"cx"> 2013-05-04 Andreas Kling <akling at apple.co=
m>
</span><span class=3D"cx">=20
</span><ins>+ Remove GraphicsContext::strokeArc(), which is unused=
.
+
+ From Blink r149608 by <jbroman at chromium.org>
+ <http://src.chromium.org/viewvc/blink?view=3Drevision&rev=
ision=3D149608>
+
+ This is no longer used since almost a year ago, when HAVE(PATH_B=
ASED_BORDER_RADIUS_DRAWING) was inlined.
+
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/blackberry/GraphicsContextBlackBerry.cpp:
+ * platform/graphics/cairo/GraphicsContextCairo.cpp:
+ * platform/graphics/cg/GraphicsContextCG.cpp:
+ * platform/graphics/wince/GraphicsContextWinCE.cpp:
+
+2013-05-04 Andreas Kling <akling at apple.com>
+
</ins><span class=3D"cx"> Remove unused CSSSelector::isCustomPseu=
doType().
</span><span class=3D"cx">=20
</span><span class=3D"cx"> From Blink r149574 by <dominicc at chr=
omium.org>
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/GraphicsContext.h (149565 =3D> 149566)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/GraphicsC=
ontext.h 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h 2013-05-04 2=
0:22:01 UTC (rev 149566)
</span><span class=3D"lines">@@ -268,9 +268,6 @@
</span><span class=3D"cx"> void fillEllipse(const FloatRect&)=
;
</span><span class=3D"cx"> void strokeEllipse(const FloatRect&=
;);
</span><span class=3D"cx">=20
</span><del>- // Arc drawing (used by border-radius in CSS) just s=
upports stroking at the moment.
- void strokeArc(const IntRect&, int startAngle, int angleSpan=
);
-
</del><span class=3D"cx"> void fillRect(const FloatRect&);
</span><span class=3D"cx"> void fillRect(const FloatRect&, co=
nst Color&, ColorSpace);
</span><span class=3D"cx"> void fillRect(const FloatRect&, Ge=
nerator&);
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicsblackberryGraphicsContextBlack=
Berrycpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/blackberry/GraphicsContextBlackBerry.cpp (149565 =3D> 149566)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/blackberr=
y/GraphicsContextBlackBerry.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/blackberry/GraphicsContextBlac=
kBerry.cpp 2013-05-04 20:22:01 UTC (rev 149566)
</span><span class=3D"lines">@@ -166,14 +166,6 @@
</span><span class=3D"cx"> platformContext()->addEllipse(FloatRect=
(rect));
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-void GraphicsContext::strokeArc(const IntRect& rect, int=
startAngle, int angleSpan)
-{
- if (paintingDisabled())
- return;
-
- platformContext()->addArc(rect, startAngle, angleSpan);
-}
-
</del><span class=3D"cx"> void GraphicsContext::drawConvexPolygon(size_t =
numPoints, const FloatPoint* points, bool)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> if (paintingDisabled())
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicscairoGraphicsContextCairocpp">=
</a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/cairo/GraphicsContextCairo.cpp (149565 =3D> 149566)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/cairo/Gra=
phicsContextCairo.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp=
2013-05-04 20:22:01 UTC (rev 149566)
</span><span class=3D"lines">@@ -365,63 +365,6 @@
</span><span class=3D"cx"> cairo_new_path(cr);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-void GraphicsContext::strokeArc(const IntRect& rect, int=
startAngle, int angleSpan)
-{
- if (paintingDisabled() || strokeStyle() =3D=3D NoStroke)
- return;
-
- int x =3D rect.x();
- int y =3D rect.y();
- float w =3D rect.width();
- float h =3D rect.height();
- float scaleFactor =3D h / w;
- float reverseScaleFactor =3D w / h;
-
- float hRadius =3D w / 2;
- float vRadius =3D h / 2;
- float fa =3D startAngle;
- float falen =3D fa + angleSpan;
-
- cairo_t* cr =3D platformContext()->cr();
- cairo_save(cr);
-
- if (w !=3D h)
- cairo_scale(cr, 1., scaleFactor);
-
- cairo_arc_negative(cr, x + hRadius, (y + vRadius) * reverseScaleFact=
or, hRadius, deg2rad(-fa), deg2rad(-falen));
-
- if (w !=3D h)
- cairo_scale(cr, 1., reverseScaleFactor);
-
- int patternWidth =3D 0;
- switch (strokeStyle()) {
- case DottedStroke:
- patternWidth =3D floorf(strokeThickness() / 2.f);
- break;
- case DashedStroke:
- patternWidth =3D 3 * floorf(strokeThickness() / 2.f);
- break;
- default:
- break;
- }
-
- setSourceRGBAFromColor(cr, strokeColor());
-
- if (patternWidth) {
- float distance =3D 0;
- if (hRadius =3D=3D vRadius)
- distance =3D (piFloat * hRadius) / 2.f;
- else // We are elliptical and will have to estimate the distance
- distance =3D (piFloat * sqrtf((hRadius * hRadius + vRadius *=
vRadius) / 2.f)) / 2.f;
- double patternOffset =3D calculateStrokePatternOffset(floorf(dis=
tance), patternWidth);
- double patternWidthAsDouble =3D patternWidth;
- cairo_set_dash(cr, &patternWidthAsDouble, 1, patternOffset);
- }
-
- cairo_stroke(cr);
- cairo_restore(cr);
-}
-
</del><span class=3D"cx"> void GraphicsContext::drawConvexPolygon(size_t =
npoints, const FloatPoint* points, bool shouldAntialias)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> if (paintingDisabled())
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"></a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/cg/GraphicsContextCG.cpp (149565 =3D> 149566)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/cg/Graphi=
csContextCG.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp 2013-=
05-04 20:22:01 UTC (rev 149566)
</span><span class=3D"lines">@@ -412,95 +412,6 @@
</span><span class=3D"cx"> drawPath(path);
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-
-void GraphicsContext::strokeArc(const IntRect& rect, int startAngle,=
int angleSpan)
-{
- if (paintingDisabled() || strokeStyle() =3D=3D NoStroke || strokeThi=
ckness() <=3D 0.0f)
- return;
-
- CGContextRef context =3D platformContext();
- CGContextSaveGState(context);
- CGContextBeginPath(context);
- CGContextSetShouldAntialias(context, false);
-
- int x =3D rect.x();
- int y =3D rect.y();
- float w =3D (float)rect.width();
- float h =3D (float)rect.height();
- float scaleFactor =3D h / w;
- float reverseScaleFactor =3D w / h;
-
- if (w !=3D h)
- scale(FloatSize(1, scaleFactor));
-
- float hRadius =3D w / 2;
- float vRadius =3D h / 2;
- float fa =3D startAngle;
- float falen =3D fa + angleSpan;
- float start =3D -fa * piFloat / 180.0f;
- float end =3D -falen * piFloat / 180.0f;
- CGContextAddArc(context, x + hRadius, (y + vRadius) * reverseScaleFa=
ctor, hRadius, start, end, true);
-
- if (w !=3D h)
- scale(FloatSize(1, reverseScaleFactor));
-
- float width =3D strokeThickness();
- int patWidth =3D 0;
-
- switch (strokeStyle()) {
- case DottedStroke:
- patWidth =3D (int)(width / 2);
- break;
- case DashedStroke:
- patWidth =3D 3 * (int)(width / 2);
- break;
- default:
- break;
- }
-
- if (patWidth) {
- // Example: 80 pixels with a width of 30 pixels.
- // Remainder is 20. The maximum pixels of line we could paint
- // will be 50 pixels.
- int distance;
- if (hRadius =3D=3D vRadius)
- distance =3D static_cast<int>((piFloat * hRadius) / 2.=
0f);
- else // We are elliptical and will have to estimate the distance
- distance =3D static_cast<int>((piFloat * sqrtf((hRadiu=
s * hRadius + vRadius * vRadius) / 2.0f)) / 2.0f);
-
- int remainder =3D distance % patWidth;
- int coverage =3D distance - remainder;
- int numSegments =3D coverage / patWidth;
-
- float patternOffset =3D 0.0f;
- // Special case 1px dotted borders for speed.
- if (patWidth =3D=3D 1)
- patternOffset =3D 1.0f;
- else {
- bool evenNumberOfSegments =3D !(numSegments % 2);
- if (remainder)
- evenNumberOfSegments =3D !evenNumberOfSegments;
- if (evenNumberOfSegments) {
- if (remainder) {
- patternOffset +=3D patWidth - remainder;
- patternOffset +=3D remainder / 2.0f;
- } else
- patternOffset =3D patWidth / 2.0f;
- } else {
- if (remainder)
- patternOffset =3D (patWidth - remainder) / 2.0f;
- }
- }
-
- const CGFloat dottedLine[2] =3D { static_cast<CGFloat>(pat=
Width), static_cast<CGFloat>(patWidth) };
- CGContextSetLineDash(context, patternOffset, dottedLine, 2);
- }
-
- CGContextStrokePath(context);
-
- CGContextRestoreGState(context);
-}
-
</del><span class=3D"cx"> static void addConvexPolygonToPath(Path& pa=
th, size_t numberOfPoints, const FloatPoint* points)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> ASSERT(numberOfPoints > 0);
</span></span></pre></div>
<a id=3D"trunkSourceWebCoreplatformgraphicswinceGraphicsContextWinCEcpp">=
</a>
<div class=3D"modfile"><h4>Modified: trunk/Source/WebCore/platform/graphi=
cs/wince/GraphicsContextWinCE.cpp (149565 =3D> 149566)</h4>
<pre class=3D"diff"><span>
<span class=3D"info">--- trunk/Source/WebCore/platform/graphics/wince/Gra=
phicsContextWinCE.cpp 2013-05-04 20:10:12 UTC (rev 149565)
+++ trunk/Source/WebCore/platform/graphics/wince/GraphicsContextWinCE.cpp=
2013-05-04 20:22:01 UTC (rev 149566)
</span><span class=3D"lines">@@ -783,81 +783,6 @@
</span><span class=3D"cx"> }
</span><span class=3D"cx"> }
</span><span class=3D"cx">=20
</span><del>-void GraphicsContext::strokeArc(const IntRect& rect, int=
startAngle, int angleSpan)
-{
- if (!m_data->m_opacity || paintingDisabled() || strokeStyle() =3D=
=3D NoStroke || rect.isEmpty())
- return;
-
- ScopeDCProvider dcProvider(m_data);
- if (!m_data->m_dc)
- return;
-
- IntRect trRect =3D m_data->mapRect(rect);
- TransparentLayerDC transparentDC(m_data, trRect, &rect);
- HDC dc =3D transparentDC.hdc();
- if (!dc)
- return;
- trRect.move(transparentDC.toShift());
-
- OwnPtr<HPEN> pen =3D createPen(strokeColor(), strokeThickness(=
), strokeStyle());
- HGDIOBJ oldPen =3D SelectObject(dc, pen.get());
-
- double a =3D trRect.width() * 0.5;
- double b =3D trRect.height() * 0.5;
- int centerX =3D stableRound(trRect.x() + a);
- int centerY =3D stableRound(trRect.y() + b);
- float fstartX, fstartY, fendX, fendY;
- int startX, startY, endX, endY;
- getEllipsePointByAngle(deg2rad((double)startAngle), a, b, fstartX, f=
startY);
- getEllipsePointByAngle(deg2rad((double)startAngle + angleSpan), a, b=
, fendX, fendY);
- startX =3D stableRound(fstartX);
- startY =3D stableRound(fstartY);
- endX =3D stableRound(fendX);
- endY =3D stableRound(fendY);
-
- startX +=3D centerX;
- startY =3D centerY - startY;
- endX +=3D centerX;
- endY =3D centerY - endY;
- RECT clipRect;
- if (startX < endX) {
- clipRect.left =3D startX;
- clipRect.right =3D endX;
- } else {
- clipRect.left =3D endX;
- clipRect.right =3D startX;
- }
- if (startY < endY) {
- clipRect.top =3D startY;
- clipRect.bottom =3D endY;
- } else {
- clipRect.top =3D endY;
- clipRect.bottom =3D startY;
- }
-
- OwnPtr<HRGN> clipRgn =3D adoptPtr(CreateRectRgn(0, 0, 0, 0));
- bool newClip;
- if (GetClipRgn(dc, clipRgn.get()) <=3D 0) {
- newClip =3D true;
- clipRgn =3D adoptPtr(CreateRectRgn(clipRect.left, clipRect.top, =
clipRect.right, clipRect.bottom));
- SelectClipRgn(dc, clipRgn.get());
- } else {
- newClip =3D false;
- IntersectClipRect(dc, clipRect.left, clipRect.top, clipRect.righ=
t, clipRect.bottom);
- }
-
- HGDIOBJ oldBrush =3D SelectObject(dc, GetStockObject(NULL_BRUSH));
- Ellipse(dc, trRect.x(), trRect.y(), trRect.maxX(), trRect.maxY());
- SelectObject(dc, oldBrush);
-
- if (newClip)
- SelectClipRgn(dc, 0);
- else
- SelectClipRgn(dc, clipRgn.get());
-
- SelectObject(dc, oldPen);
-}
-
</del><span class=3D"cx"> void GraphicsContext::drawConvexPolygon(size_t =
npoints, const FloatPoint* points, bool shouldAntialias)
</span><span class=3D"cx"> {
</span><span class=3D"cx"> if (!m_data->m_opacity || paintingDisab=
led() || npoints <=3D 1 || !points)
</span></span></pre>
</div>
</div>
</body>
</html>
More information about the webkit-changes
mailing list