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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-in-worker.html

Issue 1928043002: Add drawImage() originClean() getSecurityOrigin() to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drawImage API added to interface listing Created 4 years, 8 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
Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-in-worker.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-pattern-in-worker.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-in-worker.html
similarity index 87%
copy from third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-pattern-in-worker.html
copy to third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-in-worker.html
index 4d43564d11c017d397ca852d1c08e9498d6a4194..c91c4e9e561b3da09ec8cc7f09e1aa5a5edf6edf 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-pattern-in-worker.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage-in-worker.html
@@ -7,9 +7,12 @@ self.onmessage = function(e) {
var aCanvas = new OffscreenCanvas(150, 150);
var ctx = aCanvas.getContext('2d');
- var myPattern = ctx.createPattern(e.data, 'repeat');
- ctx.fillStyle = myPattern;
- ctx.fillRect(0, 0, aCanvas.width, aCanvas.height);
+ ctx.drawImage(e.data, 0, 0);
+ ctx.drawImage(e.data, 30, 30);
+ // stretch the image
+ ctx.drawImage(e.data, 8, 8, 15, 15, 60, 60, 60, 60);
+ // reduce the image
+ ctx.drawImage(e.data, 8, 8, 15, 15, 120, 120, 15, 15);
var image = aCanvas.transferToImageBitmap();
self.postMessage(image, [image]);

Powered by Google App Engine
This is Rietveld 408576698