<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191326] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191326">191326</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2015-10-19 19:43:59 -0700 (Mon, 19 Oct 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/191324">r191324</a>.
https://bugs.webkit.org/show_bug.cgi?id=150352
Shadowing CTM's state is not necessary (Requested by litherum
on #webkit).
Reverted changeset:
"Host GraphicsContext's CTM inside GraphicsContextState"
https://bugs.webkit.org/show_bug.cgi?id=150146
http://trac.webkit.org/changeset/191324</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContextcpp">trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsGraphicsContexth">trunk/Source/WebCore/platform/graphics/GraphicsContext.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageh">trunk/Source/WebCore/platform/graphics/Image.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoGraphicsContextCairocpp">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoGraphicsContextPlatformPrivateCairoh">trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgGraphicsContextPlatformPrivateCGh">trunk/Source/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicstransformsAffineTransformh">trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinGraphicsContextWincpp">trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDragImageMacmm">trunk/Source/WebCore/platform/mac/DragImageMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformspicgCoreGraphicsSPIh">trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/ChangeLog        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-19 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r191324.
+ https://bugs.webkit.org/show_bug.cgi?id=150352
+
+ Shadowing CTM's state is not necessary (Requested by litherum
+ on #webkit).
+
+ Reverted changeset:
+
+ "Host GraphicsContext's CTM inside GraphicsContextState"
+ https://bugs.webkit.org/show_bug.cgi?id=150146
+ http://trac.webkit.org/changeset/191324
+
</ins><span class="cx"> 2015-10-19 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> Host GraphicsContext's CTM inside GraphicsContextState
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -142,87 +142,6 @@
</span><span class="cx"> restorePlatformState();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::concatCTM(const AffineTransform& other)
-{
- if (paintingDisabled())
- return;
-
- checkCTMInvariants();
-
- m_state.ctm *= other;
- concatPlatformCTM(other);
-
- checkCTMInvariants();
-}
-
-void GraphicsContext::scale(float x, float y)
-{
- if (paintingDisabled())
- return;
-
- checkCTMInvariants();
-
- m_state.ctm.scale(x, y);
- scalePlatformCTM(x, y);
-
- checkCTMInvariants();
-}
-
-void GraphicsContext::rotate(float angle)
-{
- if (paintingDisabled())
- return;
-
- checkCTMInvariants();
-
- m_state.ctm.rotate(rad2deg(angle));
- rotatePlatformCTM(angle);
-
- checkCTMInvariants();
-}
-
-void GraphicsContext::translate(float x, float y)
-{
- if (paintingDisabled())
- return;
-
- checkCTMInvariants();
-
- m_state.ctm.translate(x, y);
- translatePlatformCTM(x, y);
-
- checkCTMInvariants();
-}
-
-void GraphicsContext::setCTM(const AffineTransform& other)
-{
- if (paintingDisabled())
- return;
-
- checkCTMInvariants();
-
- m_state.ctm = other;
- setPlatformCTM(other);
-
- checkCTMInvariants();
-}
-
-AffineTransform GraphicsContext::getCTM(IncludeDeviceScale includeScale) const
-{
- if (paintingDisabled())
- return AffineTransform();
-
- AffineTransform result;
- if (includeScale == DefinitelyIncludeDeviceScale)
- result = m_state.userToDeviceSpaceCTM * m_state.ctm;
- else
- result = m_state.ctm;
-
- ASSERT(result.isEssentiallyEqualTo(getPlatformCTM(includeScale)));
-
- return result;
-}
-
</del><span class="cx"> void GraphicsContext::drawRaisedEllipse(const FloatRect& rect, const Color& ellipseColor, ColorSpace ellipseColorSpace, const Color& shadowColor, ColorSpace shadowColorSpace)
</span><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="lines">@@ -376,8 +295,6 @@
</span><span class="cx"> {
</span><span class="cx"> beginPlatformTransparencyLayer(opacity);
</span><span class="cx"> ++m_transparencyCount;
</span><del>-
- resetPlatformCTM();
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void GraphicsContext::endTransparencyLayer()
</span><span class="lines">@@ -737,8 +654,7 @@
</span><span class="cx">
</span><span class="cx"> void GraphicsContext::applyDeviceScaleFactor(float deviceScaleFactor)
</span><span class="cx"> {
</span><del>- scale(deviceScaleFactor, deviceScaleFactor);
-
</del><ins>+ scale(FloatSize(deviceScaleFactor, deviceScaleFactor));
</ins><span class="cx"> platformApplyDeviceScaleFactor(deviceScaleFactor);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -156,9 +156,6 @@
</span><span class="cx"> CompositeOperator compositeOperator { CompositeSourceOver };
</span><span class="cx"> BlendMode blendMode { BlendModeNormal };
</span><span class="cx">
</span><del>- AffineTransform userToDeviceSpaceCTM;
- AffineTransform ctm;
-
</del><span class="cx"> bool shouldAntialias : 1;
</span><span class="cx"> bool shouldSmoothFonts : 1;
</span><span class="cx"> bool antialiasedFontDilationEnabled : 1;
</span><span class="lines">@@ -423,25 +420,18 @@
</span><span class="cx"> void canvasClip(const Path&, WindRule = RULE_EVENODD);
</span><span class="cx"> void clipOut(const Path&);
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void scale(const FloatSize& size) { scale(size.width(), size.height()); }
</del><ins>+ WEBCORE_EXPORT void scale(const FloatSize&);
</ins><span class="cx"> void rotate(float angleInRadians);
</span><span class="cx"> void translate(const FloatSize& size) { translate(size.width(), size.height()); }
</span><del>- WEBCORE_EXPORT void scale(float x, float y);
</del><span class="cx"> WEBCORE_EXPORT void translate(float x, float y);
</span><span class="cx">
</span><span class="cx"> void setURLForRect(const URL&, const IntRect&);
</span><span class="cx">
</span><del>- void checkCTMInvariants() const
- {
- ASSERT(getCTM(DefinitelyIncludeDeviceScale).isEssentiallyEqualTo(getPlatformCTM(DefinitelyIncludeDeviceScale)));
- ASSERT(getCTM(PossiblyIncludeDeviceScale).isEssentiallyEqualTo(getPlatformCTM(PossiblyIncludeDeviceScale)));
- }
</del><span class="cx"> void concatCTM(const AffineTransform&);
</span><span class="cx"> void setCTM(const AffineTransform&);
</span><del>- void resetPlatformCTM();
</del><span class="cx">
</span><span class="cx"> enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDeviceScale };
</span><del>- AffineTransform getCTM(IncludeDeviceScale = PossiblyIncludeDeviceScale) const;
</del><ins>+ AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDeviceScale) const;
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
</span><span class="cx"> // This is needed when using accelerated-compositing in software mode, like in TextureMapper.
</span><span class="lines">@@ -555,13 +545,6 @@
</span><span class="cx"> void setPlatformAlpha(float);
</span><span class="cx"> void setPlatformCompositeOperation(CompositeOperator, BlendMode = BlendModeNormal);
</span><span class="cx">
</span><del>- void concatPlatformCTM(const AffineTransform&);
- void scalePlatformCTM(float x, float y);
- void rotatePlatformCTM(float);
- void translatePlatformCTM(float, float);
- void setPlatformCTM(const AffineTransform&);
- AffineTransform getPlatformCTM(IncludeDeviceScale = PossiblyIncludeDeviceScale) const; // This is only computed to ASSERT() that the GraphicsContextState agrees with the underlying platform.
-
</del><span class="cx"> void beginPlatformTransparencyLayer(float opacity);
</span><span class="cx"> void endPlatformTransparencyLayer();
</span><span class="cx"> static bool supportsTransparencyLayers();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/Image.h (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/Image.h        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/Image.h        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx">
</span><span class="cx"> enum TileRule { StretchTile, RoundTile, SpaceTile, RepeatTile };
</span><span class="cx">
</span><del>- virtual PassNativeImagePtr nativeImageForCurrentFrame() { return nullptr; }
</del><ins>+ virtual PassNativeImagePtr nativeImageForCurrentFrame() { return 0; }
</ins><span class="cx"> virtual ImageOrientation orientationForCurrentFrame() { return ImageOrientation(); }
</span><span class="cx">
</span><span class="cx"> // Accessors for native image formats.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoGraphicsContextCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -194,16 +194,8 @@
</span><span class="cx"> delete m_data;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::resetPlatformCTM()
</del><ins>+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale) const
</ins><span class="cx"> {
</span><del>- if (platformContext())
- m_state.ctm = getPlatformCTM();
- else
- m_state.ctm.makeIdentity();
-}
-
-AffineTransform GraphicsContext::getPlatformCTM(IncludeDeviceScale) const
-{
</del><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return AffineTransform();
</span><span class="cx">
</span><span class="lines">@@ -719,14 +711,14 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::translatePlatformCTM(float x, float y)
</del><ins>+void GraphicsContext::translate(float x, float y)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> cairo_t* cr = platformContext()->cr();
</span><span class="cx"> cairo_translate(cr, x, y);
</span><del>- m_data->translatePlatformCTM(x, y);
</del><ins>+ m_data->translate(x, y);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void GraphicsContext::setPlatformFillColor(const Color&, ColorSpace)
</span><span class="lines">@@ -781,7 +773,7 @@
</span><span class="cx"> notImplemented();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::concatPlatformCTM(const AffineTransform& transform)
</del><ins>+void GraphicsContext::concatCTM(const AffineTransform& transform)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="lines">@@ -789,10 +781,10 @@
</span><span class="cx"> cairo_t* cr = platformContext()->cr();
</span><span class="cx"> const cairo_matrix_t matrix = cairo_matrix_t(transform);
</span><span class="cx"> cairo_transform(cr, &matrix);
</span><del>- m_data->concatPlatformCTM(transform);
</del><ins>+ m_data->concatCTM(transform);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::setPlatformCTM(const AffineTransform& transform)
</del><ins>+void GraphicsContext::setCTM(const AffineTransform& transform)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="lines">@@ -800,7 +792,7 @@
</span><span class="cx"> cairo_t* cr = platformContext()->cr();
</span><span class="cx"> const cairo_matrix_t matrix = cairo_matrix_t(transform);
</span><span class="cx"> cairo_set_matrix(cr, &matrix);
</span><del>- m_data->setPlatformCTM(transform);
</del><ins>+ m_data->setCTM(transform);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void GraphicsContext::setPlatformShadow(FloatSize const& size, float, Color const&, ColorSpace)
</span><span class="lines">@@ -1011,22 +1003,22 @@
</span><span class="cx"> cairo_set_fill_rule(cr, savedFillRule);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::rotatePlatformCTM(float radians)
</del><ins>+void GraphicsContext::rotate(float radians)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> cairo_rotate(platformContext()->cr(), radians);
</span><del>- m_data->rotatePlatformCTM(radians);
</del><ins>+ m_data->rotate(radians);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::scalePlatformCTM(float x, float y)
</del><ins>+void GraphicsContext::scale(const FloatSize& size)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- cairo_scale(platformContext()->cr(), x, y);
- m_data->scalePlatformCTM(x, y);
</del><ins>+ cairo_scale(platformContext()->cr(), size.width(), size.height());
+ m_data->scale(size);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void GraphicsContext::clipOut(const FloatRect& r)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoGraphicsContextPlatformPrivateCairoh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -67,24 +67,24 @@
</span><span class="cx"> void flush();
</span><span class="cx"> void clip(const FloatRect&);
</span><span class="cx"> void clip(const Path&);
</span><del>- void scalePlatformCTM(float, float);
- void rotatePlatformCTM(float);
- void translatePlatformCTM(float, float);
- void concatPlatformCTM(const AffineTransform&);
- void setPlatformCTM(const AffineTransform&);
</del><ins>+ void scale(const FloatSize&);
+ void rotate(float);
+ void translate(float, float);
+ void concatCTM(const AffineTransform&);
+ void setCTM(const AffineTransform&);
</ins><span class="cx"> void syncContext(cairo_t* cr);
</span><span class="cx"> #else
</span><span class="cx"> // On everything else, we do nothing.
</span><del>- void save() { }
- void restore() { }
- void flush() { }
- void clip(const FloatRect&) { }
- void clip(const Path&) { }
- void scalePlatformCTM(float, float) { }
- void rotatePlatformCTM(float) { }
- void translatePlatformCTM(float, float) { }
- void concatPlatformCTM(const AffineTransform&) { }
- void setPlatformCTM(const AffineTransform&) { }
</del><ins>+ void save() {}
+ void restore() {}
+ void flush() {}
+ void clip(const FloatRect&) {}
+ void clip(const Path&) {}
+ void scale(const FloatSize&) {}
+ void rotate(float) {}
+ void translate(float, float) {}
+ void concatCTM(const AffineTransform&) {}
+ void setCTM(const AffineTransform&) {}
</ins><span class="cx"> void syncContext(cairo_t*) { }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextCG.cpp        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -104,16 +104,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-void GraphicsContext::resetPlatformCTM()
-{
- m_state.ctm = CGContextGetCTM(platformContext());
-#if PLATFORM(WIN) || PLATFORM(IOS)
- m_state.userToDeviceSpaceCTM = static_cast<AffineTransform>(CGContextGetUserSpaceToDeviceSpaceTransform(platformContext())) * m_state.ctm.inverse();
-#else
- m_state.userToDeviceSpaceCTM = CGContextGetDefaultUserSpaceToDeviceSpaceTransform(platformContext());
-#endif
-}
-
</del><span class="cx"> void GraphicsContext::platformInit(CGContextRef cgContext)
</span><span class="cx"> {
</span><span class="cx"> m_data = new GraphicsContextPlatformPrivate(cgContext);
</span><span class="lines">@@ -123,7 +113,6 @@
</span><span class="cx"> setPlatformFillColor(fillColor(), fillColorSpace());
</span><span class="cx"> setPlatformStrokeColor(strokeColor(), strokeColorSpace());
</span><span class="cx"> setPlatformStrokeThickness(strokeThickness());
</span><del>- resetPlatformCTM();
</del><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -165,7 +154,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> CGContextRef context = platformContext();
</span><del>- GraphicsContextStateSaver stateSaver(*this);
</del><ins>+ CGContextStateSaver stateSaver(context);
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // Anti-aliasing is on by default on the iPhone. Need to turn it off when drawing images.
</span><span class="lines">@@ -279,7 +268,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> CGContextRef context = platformContext();
</span><del>- GraphicsContextStateSaver stateSaver(*this);
</del><ins>+ CGContextStateSaver stateSaver(context);
</ins><span class="cx"> CGContextClipToRect(context, destRect);
</span><span class="cx">
</span><span class="cx"> setPlatformCompositeOperation(op, blendMode);
</span><span class="lines">@@ -681,7 +670,7 @@
</span><span class="cx"> FloatRect rect = path.fastBoundingRect();
</span><span class="cx"> FloatSize layerSize = getCTM().mapSize(rect.size());
</span><span class="cx">
</span><del>- CGLayerRef layer = CGLayerCreateWithContext(context, layerSize, nullptr);
</del><ins>+ CGLayerRef layer = CGLayerCreateWithContext(context, layerSize, 0);
</ins><span class="cx"> CGContextRef layerContext = CGLayerGetContext(layer);
</span><span class="cx">
</span><span class="cx"> CGContextScaleCTM(layerContext, layerSize.width() / rect.width(), layerSize.height() / rect.height());
</span><span class="lines">@@ -1264,52 +1253,52 @@
</span><span class="cx"> CGContextEOClip(platformContext());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::scalePlatformCTM(float x, float y)
</del><ins>+void GraphicsContext::scale(const FloatSize& size)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><del>- CGContextScaleCTM(platformContext(), x, y);
- m_data->scalePlatformCTM(x, y);
</del><ins>+ CGContextScaleCTM(platformContext(), size.width(), size.height());
+ m_data->scale(size);
</ins><span class="cx"> m_data->m_userToDeviceTransformKnownToBeIdentity = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::rotatePlatformCTM(float angle)
</del><ins>+void GraphicsContext::rotate(float angle)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx"> CGContextRotateCTM(platformContext(), angle);
</span><del>- m_data->rotatePlatformCTM(angle);
</del><ins>+ m_data->rotate(angle);
</ins><span class="cx"> m_data->m_userToDeviceTransformKnownToBeIdentity = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::translatePlatformCTM(float x, float y)
</del><ins>+void GraphicsContext::translate(float x, float y)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx"> CGContextTranslateCTM(platformContext(), x, y);
</span><del>- m_data->translatePlatformCTM(x, y);
</del><ins>+ m_data->translate(x, y);
</ins><span class="cx"> m_data->m_userToDeviceTransformKnownToBeIdentity = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::concatPlatformCTM(const AffineTransform& transform)
</del><ins>+void GraphicsContext::concatCTM(const AffineTransform& transform)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx"> CGContextConcatCTM(platformContext(), transform);
</span><del>- m_data->concatPlatformCTM(transform);
</del><ins>+ m_data->concatCTM(transform);
</ins><span class="cx"> m_data->m_userToDeviceTransformKnownToBeIdentity = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContext::setPlatformCTM(const AffineTransform& transform)
</del><ins>+void GraphicsContext::setCTM(const AffineTransform& transform)
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return;
</span><span class="cx"> CGContextSetCTM(platformContext(), transform);
</span><del>- m_data->setPlatformCTM(transform);
</del><ins>+ m_data->setCTM(transform);
</ins><span class="cx"> m_data->m_userToDeviceTransformKnownToBeIdentity = false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-AffineTransform GraphicsContext::getPlatformCTM(IncludeDeviceScale includeScale) const
</del><ins>+AffineTransform GraphicsContext::getCTM(IncludeDeviceScale includeScale) const
</ins><span class="cx"> {
</span><span class="cx"> if (paintingDisabled())
</span><span class="cx"> return AffineTransform();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgGraphicsContextPlatformPrivateCGh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/cg/GraphicsContextPlatformPrivateCG.h        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -53,16 +53,16 @@
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> // These methods do nothing on Mac.
</span><del>- void save() { }
- void restore() { }
- void flush() { }
- void clip(const FloatRect&) { }
- void clip(const Path&) { }
- void scalePlatformCTM(float, float) { }
- void rotatePlatformCTM(float) { }
- void translatePlatformCTM(float, float) { }
- void concatPlatformCTM(const AffineTransform&) { }
- void setPlatformCTM(const AffineTransform&) { }
</del><ins>+ void save() {}
+ void restore() {}
+ void flush() {}
+ void clip(const FloatRect&) {}
+ void clip(const Path&) {}
+ void scale(const FloatSize&) {}
+ void rotate(float) {}
+ void translate(float, float) {}
+ void concatCTM(const AffineTransform&) {}
+ void setCTM(const AffineTransform&) {}
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="lines">@@ -72,11 +72,11 @@
</span><span class="cx"> void flush();
</span><span class="cx"> void clip(const FloatRect&);
</span><span class="cx"> void clip(const Path&);
</span><del>- void scalePlatformCTM(float x, float y);
- void rotatePlatformCTM(float);
- void translatePlatformCTM(float, float);
- void concatPlatformCTM(const AffineTransform&);
- void setPlatformCTM(const AffineTransform&);
</del><ins>+ void scale(const FloatSize&);
+ void rotate(float);
+ void translate(float, float);
+ void concatCTM(const AffineTransform&);
+ void setCTM(const AffineTransform&);
</ins><span class="cx">
</span><span class="cx"> HDC m_hdc;
</span><span class="cx"> bool m_shouldIncludeChildWindows;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicstransformsAffineTransformh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.h (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.h        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/transforms/AffineTransform.h        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include "PlatformExportMacros.h"
</span><span class="cx"> #include <array>
</span><span class="cx"> #include <wtf/FastMalloc.h>
</span><del>-#include <wtf/MathExtras.h>
</del><span class="cx">
</span><span class="cx"> #if USE(CG)
</span><span class="cx"> typedef struct CGAffineTransform CGAffineTransform;
</span><span class="lines">@@ -141,7 +140,6 @@
</span><span class="cx"> return (m_transform[1] == 0 && m_transform[2] == 0) || (m_transform[0] == 0 && m_transform[3] == 0);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // FIXME: If you compare floats for equality, you're gonna have a bad time. We should delete this.
</del><span class="cx"> bool operator== (const AffineTransform& m2) const
</span><span class="cx"> {
</span><span class="cx"> return (m_transform[0] == m2.m_transform[0]
</span><span class="lines">@@ -154,21 +152,6 @@
</span><span class="cx">
</span><span class="cx"> bool operator!=(const AffineTransform& other) const { return !(*this == other); }
</span><span class="cx">
</span><del>- bool isEssentiallyEqualTo(const AffineTransform& m2, double epsilon = 0.001) const
- {
- // WTF::areEssentiallyEqual() doesn't work well in this case. That function is designed to allow for error
- // which scales proportionately to the values. However, AffineTransforms are often rotated by pi/2, which
- // are not exactly representable. This results in AffineTransform components which are close to, but not
- // exactly equal to, zero. In this case, the error and the value are approximately equal, which leads to
- // a false negative return.
- return std::abs(m_transform[0] - m2.m_transform[0]) < epsilon
- && std::abs(m_transform[1] - m2.m_transform[1]) < epsilon
- && std::abs(m_transform[2] - m2.m_transform[2]) < epsilon
- && std::abs(m_transform[3] - m2.m_transform[3]) < epsilon
- && std::abs(m_transform[4] - m2.m_transform[4]) < epsilon
- && std::abs(m_transform[5] - m2.m_transform[5]) < epsilon;
- }
-
</del><span class="cx"> // *this = *this * t (i.e., a multRight)
</span><span class="cx"> AffineTransform& operator*=(const AffineTransform& t)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinGraphicsContextWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/graphics/win/GraphicsContextWin.cpp        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -171,24 +171,24 @@
</span><span class="cx"> notImplemented();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContextPlatformPrivate::scalePlatformCTM(float x, float y)
</del><ins>+void GraphicsContextPlatformPrivate::scale(const FloatSize& size)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_hdc)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- XFORM xform = TransformationMatrix().scaleNonUniform(x, y);
</del><ins>+ XFORM xform = TransformationMatrix().scaleNonUniform(size.width(), size.height());
</ins><span class="cx"> ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static const double deg2rad = 0.017453292519943295769; // pi/180
</span><span class="cx">
</span><del>-void GraphicsContextPlatformPrivate::rotatePlatformCTM(float degreesAngle)
</del><ins>+void GraphicsContextPlatformPrivate::rotate(float degreesAngle)
</ins><span class="cx"> {
</span><span class="cx"> XFORM xform = TransformationMatrix().rotate(degreesAngle);
</span><span class="cx"> ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContextPlatformPrivate::translatePlatformCTM(float x , float y)
</del><ins>+void GraphicsContextPlatformPrivate::translate(float x , float y)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_hdc)
</span><span class="cx"> return;
</span><span class="lines">@@ -197,7 +197,7 @@
</span><span class="cx"> ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContextPlatformPrivate::concatPlatformCTM(const AffineTransform& transform)
</del><ins>+void GraphicsContextPlatformPrivate::concatCTM(const AffineTransform& transform)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_hdc)
</span><span class="cx"> return;
</span><span class="lines">@@ -206,7 +206,7 @@
</span><span class="cx"> ModifyWorldTransform(m_hdc, &xform, MWT_LEFTMULTIPLY);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void GraphicsContextPlatformPrivate::setPlatformCTM(const AffineTransform& transform)
</del><ins>+void GraphicsContextPlatformPrivate::setCTM(const AffineTransform& transform)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_hdc)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDragImageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DragImageMac.mm (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DragImageMac.mm        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/mac/DragImageMac.mm        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -216,13 +216,12 @@
</span><span class="cx">
</span><span class="cx"> NSGraphicsContext *nsContext = [NSGraphicsContext currentContext];
</span><span class="cx"> CGContextRef cgContext = static_cast<CGContextRef>([nsContext graphicsPort]);
</span><ins>+ GraphicsContext graphicsContext(cgContext);
</ins><span class="cx">
</span><span class="cx"> // Safari doesn't flip the NSGraphicsContext before calling WebKit, yet WebCore requires a flipped graphics context.
</span><span class="cx"> BOOL flipped = [nsContext isFlipped];
</span><span class="cx"> if (!flipped)
</span><span class="cx"> CGContextScaleCTM(cgContext, 1, -1);
</span><del>-
- GraphicsContext graphicsContext(cgContext);
</del><span class="cx">
</span><span class="cx"> FontCascade webCoreFont(FontPlatformData(toCTFont(font), [font pointSize]), Antialiased);
</span><span class="cx"> TextRun run(StringView(buffer.data(), length));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformspicgCoreGraphicsSPIh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h (191325 => 191326)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h        2015-10-20 02:23:44 UTC (rev 191325)
+++ trunk/Source/WebCore/platform/spi/cg/CoreGraphicsSPI.h        2015-10-20 02:43:59 UTC (rev 191326)
</span><span class="lines">@@ -143,8 +143,6 @@
</span><span class="cx"> void CGContextSetCompositeOperation(CGContextRef, CGCompositeOperation);
</span><span class="cx"> void CGContextSetShouldAntialiasFonts(CGContextRef, bool shouldAntialiasFonts);
</span><span class="cx"> void CGContextResetClip(CGContextRef);
</span><del>-CGAffineTransform CGContextGetUserSpaceToDeviceSpaceTransform(CGContextRef);
-CGAffineTransform CGContextGetDefaultUserSpaceToDeviceSpaceTransform(CGContextRef);
</del><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101100
</span><span class="cx"> void CGContextSetFontDilation(CGContextRef, CGSize);
</span><span class="cx"> void CGContextSetFontRenderingStyle(CGContextRef, CGFontRenderingStyle);
</span></span></pre>
</div>
</div>
</body>
</html>