<!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>[215163] 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/215163">215163</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-04-09 11:45:06 -0700 (Sun, 09 Apr 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>REGRESSION(<a href="http://trac.webkit.org/projects/webkit/changeset/214635">r214635</a>): Calculate image subsampling only for CG
https://bugs.webkit.org/show_bug.cgi?id=170353
Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-04-09
Reviewed by Simon Fraser.
In <a href="http://trac.webkit.org/projects/webkit/changeset/214635">r214635</a>, we needed to calculate the image scaleFactor for all platforms.
It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor.
This made ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel
not equal to SubsamplingLevel::Default if the image scaleFactor is greater
than {1, 1} for all platforms. The subsamplingLevel should only be used for CG.
This is also a chance to make nativeImageDrawingScale() a across platform
function and move it to the GraphicsContext class.
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::draw):
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::scaleFactorForDrawing):
* platform/graphics/GraphicsContext.h:
* platform/graphics/ImageSource.cpp:
(WebCore::ImageSource::subsamplingLevelForScaleFactor):
(WebCore::ImageSource::subsamplingLevelForScale): Deleted.
* platform/graphics/ImageSource.h:
* platform/graphics/NativeImage.h:
* platform/graphics/cairo/NativeImageCairo.cpp:
(WebCore::nativeImageDrawingScale): Deleted.
* platform/graphics/cg/NativeImageCG.cpp:
(WebCore::nativeImageDrawingScale): Deleted.
* platform/graphics/win/NativeImageDirect2D.cpp:
(WebCore::nativeImageDrawingScale): Deleted.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsBitmapImagecpp">trunk/Source/WebCore/platform/graphics/BitmapImage.cpp</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="#trunkSourceWebCoreplatformgraphicsImageSourcecpp">trunk/Source/WebCore/platform/graphics/ImageSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsImageSourceh">trunk/Source/WebCore/platform/graphics/ImageSource.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsNativeImageh">trunk/Source/WebCore/platform/graphics/NativeImage.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscairoNativeImageCairocpp">trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscgNativeImageCGcpp">trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinNativeImageDirect2Dcpp">trunk/Source/WebCore/platform/graphics/win/NativeImageDirect2D.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/ChangeLog        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2017-04-09 Said Abou-Hallawa <sabouhallawa@apple.com>
+
+ REGRESSION(r214635): Calculate image subsampling only for CG
+ https://bugs.webkit.org/show_bug.cgi?id=170353
+
+ Reviewed by Simon Fraser.
+
+ In r214635, we needed to calculate the image scaleFactor for all platforms.
+ It was needed do the calculation: sizeForDrawing = sizeOfImage * imageScaleFactor.
+ This made ImageSource::subsamplingLevelForScale() now returns a SubsamplingLevel
+ not equal to SubsamplingLevel::Default if the image scaleFactor is greater
+ than {1, 1} for all platforms. The subsamplingLevel should only be used for CG.
+
+ This is also a chance to make nativeImageDrawingScale() a across platform
+ function and move it to the GraphicsContext class.
+
+ * platform/graphics/BitmapImage.cpp:
+ (WebCore::BitmapImage::draw):
+ * platform/graphics/GraphicsContext.cpp:
+ (WebCore::GraphicsContext::scaleFactorForDrawing):
+ * platform/graphics/GraphicsContext.h:
+ * platform/graphics/ImageSource.cpp:
+ (WebCore::ImageSource::subsamplingLevelForScaleFactor):
+ (WebCore::ImageSource::subsamplingLevelForScale): Deleted.
+ * platform/graphics/ImageSource.h:
+ * platform/graphics/NativeImage.h:
+ * platform/graphics/cairo/NativeImageCairo.cpp:
+ (WebCore::nativeImageDrawingScale): Deleted.
+ * platform/graphics/cg/NativeImageCG.cpp:
+ (WebCore::nativeImageDrawingScale): Deleted.
+ * platform/graphics/win/NativeImageDirect2D.cpp:
+ (WebCore::nativeImageDrawingScale): Deleted.
+
</ins><span class="cx"> 2017-04-09 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Start dropping Timer API dealing with double
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsBitmapImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -163,13 +163,12 @@
</span><span class="cx"> if (destRect.isEmpty() || srcRect.isEmpty())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- FloatSize scale = nativeImageDrawingScale(context, destRect, srcRect);
- float subsamplingScale = std::min(float(1), std::max(scale.width(), scale.height()));
- m_currentSubsamplingLevel = allowSubsampling() ? m_source.subsamplingLevelForScale(subsamplingScale) : SubsamplingLevel::Default;
- IntSize sizeForDrawing = expandedIntSize(size() * scale);
</del><ins>+ FloatSize scaleFactorForDrawing = context.scaleFactorForDrawing(destRect, srcRect);
+ IntSize sizeForDrawing = expandedIntSize(size() * scaleFactorForDrawing);
+
+ m_currentSubsamplingLevel = allowSubsampling() ? m_source.subsamplingLevelForScaleFactor(context, scaleFactorForDrawing) : SubsamplingLevel::Default;
+ LOG(Images, "BitmapImage::%s - %p - url: %s [subsamplingLevel = %d scaleFactorForDrawing = (%.4f, %.4f)]", __FUNCTION__, this, sourceURL().utf8().data(), static_cast<int>(m_currentSubsamplingLevel), scaleFactorForDrawing.width(), scaleFactorForDrawing.height());
</ins><span class="cx">
</span><del>- LOG(Images, "BitmapImage::%s - %p - url: %s [subsamplingLevel = %d scale = %.4f]", __FUNCTION__, this, sourceURL().utf8().data(), static_cast<int>(m_currentSubsamplingLevel), subsamplingScale);
-
</del><span class="cx"> NativeImagePtr image;
</span><span class="cx"> if (decodingMode == DecodingMode::Asynchronous && shouldUseAsyncDecodingForLargeImages()) {
</span><span class="cx"> ASSERT(!canAnimate() && !m_currentFrame);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -1036,6 +1036,13 @@
</span><span class="cx"> AffineTransform transform = getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
</span><span class="cx"> return FloatSize(transform.xScale(), transform.yScale());
</span><span class="cx"> }
</span><ins>+
+FloatSize GraphicsContext::scaleFactorForDrawing(const FloatRect& destRect, const FloatRect& srcRect) const
+{
+ AffineTransform transform = getCTM(GraphicsContext::DefinitelyIncludeDeviceScale);
+ auto transformedDestRect = transform.mapRect(destRect);
+ return { static_cast<float>(transformedDestRect.width() / srcRect.width()), static_cast<float>(transformedDestRect.height() / srcRect.height()) };
+}
</ins><span class="cx">
</span><span class="cx"> void GraphicsContext::fillEllipse(const FloatRect& ellipse)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsGraphicsContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.h (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.h        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -499,6 +499,7 @@
</span><span class="cx"> WEBCORE_EXPORT void applyDeviceScaleFactor(float);
</span><span class="cx"> void platformApplyDeviceScaleFactor(float);
</span><span class="cx"> FloatSize scaleFactor() const;
</span><ins>+ FloatSize scaleFactorForDrawing(const FloatRect& destRect, const FloatRect& srcRect) const;
</ins><span class="cx">
</span><span class="cx"> #if OS(WINDOWS)
</span><span class="cx"> HDC getWindowsContext(const IntRect&, bool supportAlphaBlend, bool mayCreateBitmap); // The passed in rect is used to create a bitmap for compositing inside transparency layers.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.cpp (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.cpp        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.cpp        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -29,18 +29,20 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ImageSource.h"
</span><span class="cx">
</span><ins>+#include "GraphicsContext.h"
+
</ins><span class="cx"> #if USE(CG)
</span><span class="cx"> #include "ImageDecoderCG.h"
</span><ins>+#if PLATFORM(WIN)
+#include <WebKitSystemInterface/WebKitSystemInterface.h>
+#endif
</ins><span class="cx"> #elif USE(DIRECT2D)
</span><del>-#include "GraphicsContext.h"
</del><span class="cx"> #include "ImageDecoderDirect2D.h"
</span><del>-#include <WinCodec.h>
</del><span class="cx"> #else
</span><span class="cx"> #include "ImageDecoder.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #include "ImageOrientation.h"
</span><del>-
</del><span class="cx"> #include <wtf/CurrentTime.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -177,13 +179,24 @@
</span><span class="cx"> return m_maximumSubsamplingLevel.value();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-SubsamplingLevel ImageSource::subsamplingLevelForScale(float scale)
</del><ins>+SubsamplingLevel ImageSource::subsamplingLevelForScaleFactor(GraphicsContext& context, const FloatSize& scaleFactor)
</ins><span class="cx"> {
</span><ins>+#if USE(CG)
+ // Never use subsampled images for drawing into PDF contexts.
+ if (wkCGContextIsPDFContext(context.platformContext()))
+ return SubsamplingLevel::Default;
+
+ float scale = std::min(float(1), std::max(scaleFactor.width(), scaleFactor.height()));
</ins><span class="cx"> if (!(scale > 0 && scale <= 1))
</span><span class="cx"> return SubsamplingLevel::Default;
</span><span class="cx">
</span><span class="cx"> int result = std::ceil(std::log2(1 / scale));
</span><span class="cx"> return static_cast<SubsamplingLevel>(std::min(result, static_cast<int>(maximumSubsamplingLevel())));
</span><ins>+#else
+ UNUSED_PARAM(context);
+ UNUSED_PARAM(scaleFactor);
+ return SubsamplingLevel::Default;
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> NativeImagePtr ImageSource::createFrameImageAtIndex(size_t index, SubsamplingLevel subsamplingLevel)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsImageSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ImageSource.h (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ImageSource.h        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/ImageSource.h        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -105,7 +105,7 @@
</span><span class="cx"> NativeImagePtr frameImageAtIndexCacheIfNeeded(size_t, SubsamplingLevel = SubsamplingLevel::Default, const GraphicsContext* = nullptr);
</span><span class="cx">
</span><span class="cx"> SubsamplingLevel maximumSubsamplingLevel();
</span><del>- SubsamplingLevel subsamplingLevelForScale(float);
</del><ins>+ SubsamplingLevel subsamplingLevelForScaleFactor(GraphicsContext&, const FloatSize& scaleFactor);
</ins><span class="cx"> NativeImagePtr createFrameImageAtIndex(size_t, SubsamplingLevel = SubsamplingLevel::Default);
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsNativeImageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/NativeImage.h (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/NativeImage.h        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/NativeImage.h        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -65,8 +65,6 @@
</span><span class="cx"> bool nativeImageHasAlpha(const NativeImagePtr&);
</span><span class="cx"> Color nativeImageSinglePixelSolidColor(const NativeImagePtr&);
</span><span class="cx">
</span><del>-FloatSize nativeImageDrawingScale(GraphicsContext&, const FloatRect& destRect, const FloatRect& srcRect);
-
</del><span class="cx"> void drawNativeImage(const NativeImagePtr&, GraphicsContext&, const FloatRect&, const FloatRect&, const IntSize&, CompositeOperator, BlendMode, const ImageOrientation&);
</span><span class="cx"> void clearNativeImageSubimages(const NativeImagePtr&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscairoNativeImageCairocpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/cairo/NativeImageCairo.cpp        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -56,12 +56,6 @@
</span><span class="cx"> return colorFromPremultipliedARGB(*pixel);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FloatSize nativeImageDrawingScale(GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect)
-{
- auto transformedDestinationRect = context.getCTM().mapRect(destRect);
- return { static_cast<float>(transformedDestinationRect.width() / srcRect.width()), static_cast<float>(transformedDestinationRect.height() / srcRect.height()) };
-}
-
</del><span class="cx"> void drawNativeImage(const NativeImagePtr& image, GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, const IntSize&, CompositeOperator op, BlendMode mode, const ImageOrientation& orientation)
</span><span class="cx"> {
</span><span class="cx"> context.save();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscgNativeImageCGcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/cg/NativeImageCG.cpp        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -36,10 +36,6 @@
</span><span class="cx"> #include "IntSize.h"
</span><span class="cx"> #include "SubimageCacheWithTimer.h"
</span><span class="cx">
</span><del>-#if PLATFORM(WIN)
-#include <WebKitSystemInterface/WebKitSystemInterface.h>
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> IntSize nativeImageSize(const NativeImagePtr& image)
</span><span class="lines">@@ -73,16 +69,6 @@
</span><span class="cx"> return Color(pixel[0] * 255 / pixel[3], pixel[1] * 255 / pixel[3], pixel[2] * 255 / pixel[3], pixel[3]);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FloatSize nativeImageDrawingScale(GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect)
-{
- // Never use subsampled images for drawing into PDF contexts.
- if (wkCGContextIsPDFContext(context.platformContext()))
- return { 1, 1 };
-
- CGRect transformedDestinationRect = CGRectApplyAffineTransform(destRect, CGContextGetCTM(context.platformContext()));
- return { static_cast<float>(transformedDestinationRect.size.width / srcRect.width()), static_cast<float>(transformedDestinationRect.size.height / srcRect.height()) };
-}
-
</del><span class="cx"> void drawNativeImage(const NativeImagePtr& image, GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, const IntSize& srcSize, CompositeOperator op, BlendMode mode, const ImageOrientation& orientation)
</span><span class="cx"> {
</span><span class="cx"> // Subsampling may have given us an image that is smaller than size().
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinNativeImageDirect2Dcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/NativeImageDirect2D.cpp (215162 => 215163)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/NativeImageDirect2D.cpp        2017-04-09 17:11:24 UTC (rev 215162)
+++ trunk/Source/WebCore/platform/graphics/win/NativeImageDirect2D.cpp        2017-04-09 18:45:06 UTC (rev 215163)
</span><span class="lines">@@ -60,17 +60,6 @@
</span><span class="cx"> return Color();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FloatSize nativeImageDrawingScale(GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect)
-{
- D2D1_MATRIX_3X2_F ctm;
- context.platformContext()->GetTransform(&ctm);
-
- AffineTransform transform(ctm);
-
- auto transformedDestinationRect = transform.mapRect(destRect);
- return { static_cast<float>(transformedDestinationRect.width() / srcRect.width()), static_cast<float>(transformedDestinationRect.height() / srcRect.height()) };
-}
-
</del><span class="cx"> void drawNativeImage(const NativeImagePtr& image, GraphicsContext& context, const FloatRect& destRect, const FloatRect& srcRect, const IntSize& srcSize, CompositeOperator compositeOp, BlendMode blendMode, const ImageOrientation& orientation)
</span><span class="cx"> {
</span><span class="cx"> auto platformContext = context.platformContext();
</span></span></pre>
</div>
</div>
</body>
</html>