Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and Desti...
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Apr 2014 12:44:58 +0000 (12:44 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Apr 2014 12:44:58 +0000 (12:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=79659

Patch by Dirk Schulze <krit@webkit.org> on 2014-04-11
Reviewed by Andreas Kling.

Add performance tests for real this time.

* Canvas/compositing-drawimage.html: Added.
* Canvas/compositing-fillRect.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167124 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Canvas/compositing-drawimage.html [new file with mode: 0644]
PerformanceTests/Canvas/compositing-fillRect.html [new file with mode: 0644]
PerformanceTests/ChangeLog

diff --git a/PerformanceTests/Canvas/compositing-drawimage.html b/PerformanceTests/Canvas/compositing-drawimage.html
new file mode 100644 (file)
index 0000000..ecee5b6
--- /dev/null
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/runner.js"></script>
+<script>
+
+var source = document.createElement("canvas");
+source.width = 300;
+source.height = 150;
+source.getContext("2d").fillStyle = 'rgba(0,128,0,0.5)';
+source.getContext("2d").fillRect(0, 0, source.width, source.height);
+
+var target = document.createElement("canvas");
+target.width = source.width;
+target.height = source.height;
+var context = target.getContext("2d")
+context.globalCompositeOperation = "destination-atop";
+
+PerfTestRunner.measureRunsPerSecond({run: function() {
+    context.drawImage(source, 0, 0);   
+}});
+</script>
+</body>
+</html>
diff --git a/PerformanceTests/Canvas/compositing-fillRect.html b/PerformanceTests/Canvas/compositing-fillRect.html
new file mode 100644 (file)
index 0000000..9e4b6bd
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/runner.js"></script>
+<script>
+var target = document.createElement("canvas");
+target.width = 300;
+target.height = 150;
+var context = target.getContext("2d");
+context.globalCompositeOperation = "destination-atop";
+context.fillStyle = "rgba(0,128,0,0.5)";
+
+PerfTestRunner.measureRunsPerSecond({run: function() {
+    context.fillRect(10,10,10,10);
+}});
+</script>
+</body>
+</html>
index 8163a65..294defd 100644 (file)
@@ -5,6 +5,19 @@
 
         Reviewed by Andreas Kling.
 
+        Add performance tests for real this time.
+
+        * Canvas/compositing-drawimage.html: Added.
+        * Canvas/compositing-fillRect.html: Added.
+
+
+2014-04-11  Dirk Schulze  <krit@webkit.org>
+
+        Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.
+        https://bugs.webkit.org/show_bug.cgi?id=79659
+
+        Reviewed by Andreas Kling.
+
         Add performance tests for fillRect() and drawImage() on composited contexts.
 
         * Canvas/compositing-drawimage.html: Added.