Title: [261162] trunk
Revision
261162
Author
grao...@webkit.org
Date
2020-05-05 06:01:04 -0700 (Tue, 05 May 2020)

Log Message

Unreviewed, reverting r260989.

Mistakenly identified cause of MotionMark 1.1 performance regression

Reverted changeset:

"REGRESSION: MotionMark 1.1 regressed due to r260016"
https://bugs.webkit.org/show_bug.cgi?id=211280
https://trac.webkit.org/changeset/260989

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261161 => 261162)


--- trunk/LayoutTests/ChangeLog	2020-05-05 12:37:13 UTC (rev 261161)
+++ trunk/LayoutTests/ChangeLog	2020-05-05 13:01:04 UTC (rev 261162)
@@ -1,3 +1,15 @@
+2020-05-05  Antoine Quint  <grao...@apple.com>
+
+        Unreviewed, reverting r260989.
+
+        Mistakenly identified cause of MotionMark 1.1 performance regression
+
+        Reverted changeset:
+
+        "REGRESSION: MotionMark 1.1 regressed due to r260016"
+        https://bugs.webkit.org/show_bug.cgi?id=211280
+        https://trac.webkit.org/changeset/260989
+
 2020-05-05  Rob Buis  <rb...@igalia.com>
 
         [GTK][WPE][Fetch API] Stale-while-revalidate is not enabled

Modified: trunk/LayoutTests/fast/images/image-orientation-none-canvas.html (261161 => 261162)


--- trunk/LayoutTests/fast/images/image-orientation-none-canvas.html	2020-05-05 12:37:13 UTC (rev 261161)
+++ trunk/LayoutTests/fast/images/image-orientation-none-canvas.html	2020-05-05 13:01:04 UTC (rev 261162)
@@ -11,7 +11,13 @@
         width: 102px;
         height: 52px;
     }
+    img {
+        position: fixed;
+        image-orientation: none;
+        visibility: hidden;
+    }
     canvas {
+        position: fixed;
         border: 1px solid black;
         width: 100px;
         height: 50px;
@@ -23,25 +29,29 @@
     <br>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas1"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Normal
     </div>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas2"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Flipped horizontally
     </div>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas3"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Rotated 180&deg;
     </div>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas4"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Flipped vertically
     </div>
@@ -48,25 +58,29 @@
     <br>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas5"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Rotated 90&deg; CCW and flipped vertically
     </div>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas6"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Rotated 90&deg; CCW
     </div>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas7"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Rotated 90&deg; CW and flipped vertically
     </div>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas8"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Rotated 90&deg; CW
     </div>
@@ -73,7 +87,8 @@
     <br>
     <div class ="container">
         <div class ="box">
-            <canvas id="canvas9"></canvas>
+            <img src=""
+            <canvas></canvas>
         </div>
         <br>Undefined (invalid value)
     </div>
@@ -82,38 +97,18 @@
             window.testRunner.waitUntilDone();
 
         window._onload_ = function() {
-            var names = [
-                { resource: "resources/exif-orientation-1-ul.jpg",  id : "canvas1" },
-                { resource: "resources/exif-orientation-2-ur.jpg",  id : "canvas2" },
-                { resource: "resources/exif-orientation-3-lr.jpg",  id : "canvas3" },
-                { resource: "resources/exif-orientation-4-lol.jpg", id : "canvas4" },
-                { resource: "resources/exif-orientation-5-lu.jpg",  id : "canvas5" },
-                { resource: "resources/exif-orientation-6-ru.jpg",  id : "canvas6" },
-                { resource: "resources/exif-orientation-7-rl.jpg",  id : "canvas7" },
-                { resource: "resources/exif-orientation-8-llo.jpg", id : "canvas8" },
-                { resource: "resources/exif-orientation-9-u.jpg",   id : "canvas9" }
-            ];
+            var boxes = document.querySelectorAll(".box");
 
-            var drawCount = 0;
+            boxes.forEach(function(box) {
+                let image = box.querySelector("img");
+                let canvas = box.querySelector("canvas");
+                canvas.width = canvas.clientWidth;
+                canvas.height = canvas.clientHeight;
+                let context = canvas.getContext("2d");
+                context.drawImage(image, 0, 0, canvas.width, canvas.height);
+            });
 
-            names.forEach(function(name) {
-                var image = new Image;
-                image.style.imageOrientation = "none";
-                image.style.display = "none";
-                image.src = ""
-                document.body.appendChild(image);
-                image.decode().then(() => {
-                    let canvas = document.getElementById(name.id);
-                    canvas.width = canvas.offsetWidth - 2;
-                    canvas.height = canvas.offsetHeight - 2;
-                    let context = canvas.getContext("2d");
-                    context.drawImage(image, 0, 0, canvas.width, canvas.height);
-                    if (++drawCount == names.length) {
-                        if (window.testRunner)
-                            window.testRunner.notifyDone();
-                    }
-                });
-            });
+            window.testRunner.notifyDone();
         }
     </script>
 </body>

Modified: trunk/Source/WebCore/ChangeLog (261161 => 261162)


--- trunk/Source/WebCore/ChangeLog	2020-05-05 12:37:13 UTC (rev 261161)
+++ trunk/Source/WebCore/ChangeLog	2020-05-05 13:01:04 UTC (rev 261162)
@@ -1,3 +1,15 @@
+2020-05-05  Antoine Quint  <grao...@apple.com>
+
+        Unreviewed, reverting r260989.
+
+        Mistakenly identified cause of MotionMark 1.1 performance regression
+
+        Reverted changeset:
+
+        "REGRESSION: MotionMark 1.1 regressed due to r260016"
+        https://bugs.webkit.org/show_bug.cgi?id=211280
+        https://trac.webkit.org/changeset/260989
+
 2020-05-05  Alexey Shvayka  <shvaikal...@gmail.com>
 
         Object.prototype.toString is not spec-perfect

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (261161 => 261162)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2020-05-05 12:37:13 UTC (rev 261161)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp	2020-05-05 13:01:04 UTC (rev 261162)
@@ -1466,7 +1466,9 @@
     FloatRect imageRect = FloatRect(FloatPoint(), size(imageElement, ImageSizeType::BeforeDevicePixelRatio));
 
     auto orientation = ImageOrientation::FromImage;
-    if (auto* computedStyle = imageElement.computedStyle())
+    if (auto* renderer = imageElement.renderer())
+        orientation = renderer->style().imageOrientation();
+    else if (auto* computedStyle = imageElement.computedStyle())
         orientation = computedStyle->imageOrientation();
 
     auto result = drawImage(imageElement.document(), imageElement.cachedImage(), imageElement.renderer(), imageRect, srcRect, dstRect, op, blendMode, orientation);

Modified: trunk/Source/WebCore/platform/graphics/BitmapImage.cpp (261161 => 261162)


--- trunk/Source/WebCore/platform/graphics/BitmapImage.cpp	2020-05-05 12:37:13 UTC (rev 261161)
+++ trunk/Source/WebCore/platform/graphics/BitmapImage.cpp	2020-05-05 13:01:04 UTC (rev 261162)
@@ -210,7 +210,7 @@
         return ImageDrawResult::DidNothing;
 
     FloatSize scaleFactorForDrawing = context.scaleFactorForDrawing(destRect, srcRect);
-    IntSize sizeForDrawing = expandedIntSize(size() * scaleFactorForDrawing);
+    IntSize sizeForDrawing = expandedIntSize(size(ImageOrientation::None) * scaleFactorForDrawing);
     ImageDrawResult result = ImageDrawResult::DidDraw;
 
     m_currentSubsamplingLevel = m_allowSubsampling ? subsamplingLevelForScaleFactor(context, scaleFactorForDrawing) : SubsamplingLevel::Default;
@@ -289,10 +289,12 @@
         return result;
     }
 
-    if (options.orientation() == ImageOrientation::FromImage)
-        drawNativeImage(image, context, destRect, srcRect, IntSize(size()), { options, frameOrientationAtIndex(m_currentFrame) });
-    else
-        drawNativeImage(image, context, destRect, srcRect, IntSize(size()), options);
+    auto orientation = options.orientation();
+    if (orientation == ImageOrientation::FromImage) {
+        orientation = frameOrientationAtIndex(m_currentFrame);
+        drawNativeImage(image, context, destRect, srcRect, IntSize(size(orientation)), { options, orientation });
+    } else
+        drawNativeImage(image, context, destRect, srcRect, IntSize(size(orientation)), options);
 
     m_currentFrameDecodingStatus = frameDecodingStatusAtIndex(m_currentFrame);
 

Modified: trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp (261161 => 261162)


--- trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2020-05-05 12:37:13 UTC (rev 261161)
+++ trunk/Source/WebCore/platform/graphics/GraphicsContext.cpp	2020-05-05 13:01:04 UTC (rev 261162)
@@ -711,7 +711,7 @@
 
 ImageDrawResult GraphicsContext::drawImage(Image& image, const FloatRect& destination, const ImagePaintingOptions& imagePaintingOptions)
 {
-    FloatRect srcRect(FloatPoint(), image.size());
+    FloatRect srcRect(FloatPoint(), image.size(imagePaintingOptions.orientation()));
     return drawImage(image, destination, srcRect, imagePaintingOptions);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to