Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html

Issue 2126013002: Fix canvas blink_perf tests to avoid GPU fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: whoops Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-webgl-to-hw-accelerated-canvas-2d.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html
diff --git a/third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html b/third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html
index b678a428f215addf79417e42ad8322238db654fa..fa221baec7e872d42ba36cd88430f39a8751bbef 100644
--- a/third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html
+++ b/third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-canvas-2d-to-hw-accelerated-canvas-2d.html
@@ -8,7 +8,12 @@ var sourceCanvas2D = document.createElement("canvas");
var sourceCtx2D = sourceCanvas2D.getContext("2d");
var destCanvas2D = document.createElement("canvas");
var destCtx2D = destCanvas2D.getContext("2d");
-
+var dummyCanvas2D = document.createElement("canvas");
+var dummyCtx2D = dummyCanvas2D.getContext("2d");
+
+dummyCanvas2D.width = 1;
+dummyCanvas2D.height = 1;
+
function setSize(sourceWidth, sourceHeight, destWidth, destHeight) {
sourceCanvas2D.width = sourceWidth;
sourceCanvas2D.height = sourceHeight;
@@ -32,9 +37,9 @@ function doRun() {
}
function ensureComplete() {
- // Calling getImageData() is just to flush out the content when
- // accelerated 2D canvas is in use. The cost of reading 1x1 pixels is low.
- destCtx2D.getImageData(0, 0, 1, 1);
+ // Using destCanvas2D as a source image is just to flush out the content when
+ // accelerated 2D canvas is in use.
+ dummyCtx2D.drawImage(destCanvas2D, 0, 0, 1, 1, 0, 0, 1, 1);
}
window.onload = function () {
« no previous file with comments | « no previous file | third_party/WebKit/PerformanceTests/Canvas/draw-dynamic-webgl-to-hw-accelerated-canvas-2d.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698