Title: [173345] trunk/Source/WebCore
Revision
173345
Author
[email protected]
Date
2014-09-05 17:15:44 -0700 (Fri, 05 Sep 2014)

Log Message

[iOS] Work around bug 136593 by disabling the PDFDocumentImage live resize optimization there
https://bugs.webkit.org/show_bug.cgi?id=136594
rdar://problem/17457013

Reviewed by Simon Fraser.

* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
Disable the optimization on iOS, because bug 136593 rears its head
most often on iOS because it is more common to have contexts that always
use low-quality image interpolation on that platform.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (173344 => 173345)


--- trunk/Source/WebCore/ChangeLog	2014-09-06 00:14:15 UTC (rev 173344)
+++ trunk/Source/WebCore/ChangeLog	2014-09-06 00:15:44 UTC (rev 173345)
@@ -1,5 +1,19 @@
 2014-09-05  Tim Horton  <[email protected]>
 
+        [iOS] Work around bug 136593 by disabling the PDFDocumentImage live resize optimization there
+        https://bugs.webkit.org/show_bug.cgi?id=136594
+        rdar://problem/17457013
+
+        Reviewed by Simon Fraser.
+
+        * platform/graphics/cg/PDFDocumentImage.cpp:
+        (WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
+        Disable the optimization on iOS, because bug 136593 rears its head
+        most often on iOS because it is more common to have contexts that always
+        use low-quality image interpolation on that platform.
+
+2014-09-05  Tim Horton  <[email protected]>
+
         Doing a navigation on a non-opaque WKWebView can result in an empty layer tree
         https://bugs.webkit.org/show_bug.cgi?id=136590
         <rdar://problem/18234000>

Modified: trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp (173344 => 173345)


--- trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2014-09-06 00:14:15 UTC (rev 173344)
+++ trunk/Source/WebCore/platform/graphics/cg/PDFDocumentImage.cpp	2014-09-06 00:15:44 UTC (rev 173345)
@@ -144,12 +144,21 @@
 
 void PDFDocumentImage::updateCachedImageIfNeeded(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect)
 {
+#if PLATFORM(IOS)
+    // On iOS, some clients use low-quality image interpolation always, which throws off this optimization,
+    // as we never get the subsequent high-quality paint. Since live resize is rare on iOS, disable the optimization.
+    // FIXME (136593): It's also possible to do the wrong thing here if CSS specifies low-quality interpolation via the "image-rendering"
+    // property, on all platforms. We should only do this optimization if we're actually in a ImageQualityController live resize,
+    // and are guaranteed to do a high-quality paint later.
+    bool repaintIfNecessary = true;
+#else
     // If we have an existing image, reuse it if we're doing a low-quality paint, even if cache parameters don't match;
     // we'll rerender when we do the subsequent high-quality paint.
     InterpolationQuality interpolationQuality = context->imageInterpolationQuality();
-    bool useLowQualityInterpolation = interpolationQuality == InterpolationNone || interpolationQuality == InterpolationLow;
+    bool repaintIfNecessary = interpolationQuality != InterpolationNone && interpolationQuality != InterpolationLow;
+#endif
 
-    if (!m_cachedImageBuffer || (!cacheParametersMatch(context, dstRect, srcRect) && !useLowQualityInterpolation)) {
+    if (!m_cachedImageBuffer || (!cacheParametersMatch(context, dstRect, srcRect) && repaintIfNecessary)) {
         m_cachedImageBuffer = context->createCompatibleBuffer(FloatRect(enclosingIntRect(dstRect)).size());
         if (!m_cachedImageBuffer)
             return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to