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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html

Issue 2182583002: Change implementation of resize ImageBitmap to meet specs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments 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/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html
index b734fb0a36c54ae05a29664b670fd7856b960941..e40b12dc6238c25e92d4a2452d7f256a6fbbc457 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-createImageBitmap-resize.html
@@ -12,19 +12,14 @@ function checkNoCrop(imageBitmap)
ctx.drawImage(imageBitmap, 0, 0);
var d = ctx.getImageData(0, 0, 1, 1).data;
assert_array_equals(d, [255, 0, 0, 255], "This pixel should be red.");
- console.log(d[0] + " " + d[1] + " " + d[2] + " " + d[3]);
d = ctx.getImageData(39, 0, 1, 1).data;
assert_array_equals(d, [0, 255, 0, 255], "This pixel should be green.");
- console.log(d[0] + " " + d[1] + " " + d[2] + " " + d[3]);
d = ctx.getImageData(0, 39, 1, 1).data;
assert_array_equals(d, [0, 0, 255, 255], "This pixel should be blue.");
- console.log(d[0] + " " + d[1] + " " + d[2] + " " + d[3]);
d = ctx.getImageData(39, 39, 1, 1).data;
assert_array_equals(d, [0, 0, 0, 255], "This pixel should be black.");
- console.log(d[0] + " " + d[1] + " " + d[2] + " " + d[3]);
d = ctx.getImageData(41, 41, 1, 1).data;
assert_array_equals(d, [0, 0, 0, 0], "This pixel should be transparent black.");
- console.log(d[0] + " " + d[1] + " " + d[2] + " " + d[3]);
}
function checkCrop(imageBitmap)
@@ -80,10 +75,10 @@ function testImageBitmap(source)
createImageBitmap(source, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "medium"}),
createImageBitmap(source, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "low"}),
createImageBitmap(source, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "pixelated"}),
- createImageBitmap(source, 10, 10, 20, 20, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "high"}),
- createImageBitmap(source, 10, 10, 20, 20, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "medium"}),
- createImageBitmap(source, 10, 10, 20, 20, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "low"}),
- createImageBitmap(source, 10, 10, 20, 20, {resizeWidth: 40, resizeHeight: 40, resizeQuality: "pixelated"}),
+ createImageBitmap(source, 5, 5, 10, 10, {resizeWidth: 20, resizeHeight: 20, resizeQuality: "high"}),
+ createImageBitmap(source, 5, 5, 10, 10, {resizeWidth: 20, resizeHeight: 20, resizeQuality: "medium"}),
+ createImageBitmap(source, 5, 5, 10, 10, {resizeWidth: 20, resizeHeight: 20, resizeQuality: "low"}),
+ createImageBitmap(source, 5, 5, 10, 10, {resizeWidth: 20, resizeHeight: 20, resizeQuality: "pixelated"}),
]).then(([noCropHigh, noCropMedium, noCropLow, noCropPixelated, cropHigh, cropMedium, cropLow, cropPixelated]) => {
checkNoCrop(noCropHigh);
checkNoCrop(noCropMedium);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/ImageBitmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698