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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap-from-blob.html

Issue 1809603004: Use ImageDecoder for createImageBitmap(HTMLImageElement, premultiplyAlpha=false) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: halfRed-->darkRed Created 4 years, 9 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/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap-from-blob.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap.html b/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap-from-blob.html
similarity index 85%
copy from third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap.html
copy to third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap-from-blob.html
index 75928662546000748fd6bd6f340a3060b25af16e..cbba86a51dc2bab2fdb0f1ab863d46b821b68f60 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/webgl/tex-image-and-sub-image-2d-image-bitmap-from-image-bitmap-from-blob.html
@@ -18,8 +18,10 @@ var pixelType = "UNSIGNED_BYTE";
var redColor = [255, 0, 0];
var greenColor = [0, 255, 0];
var blackColor = [0, 0, 0];
-var halfRed = [128, 0, 0];
-var halfGreen = [0, 128, 0];
+var darkRed = [26, 0, 0];
+var darkGreen = [0, 26, 0];
+
+var blob = null;
function promiseRejected()
{
@@ -40,18 +42,10 @@ function generateTest()
gl.clearColor(0,0,0,1);
gl.clearDepth(1);
- gl.disable(gl.BLEND);
-
- var imageData = new ImageData(new Uint8ClampedArray(
- [255, 0, 0, 255,
- 255, 0, 0, 0,
- 0, 255, 0, 255,
- 0, 255, 0, 0]),
- 2, 2);
var bitmap; // bitmap will be in unpremultiplied format
- createImageBitmap(imageData, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(image) {
- bitmap = image;
+ createImageBitmap(blob, {imageOrientation: "none", premultiplyAlpha: "none"}).then(function(imageBitmap) {
+ bitmap = imageBitmap;
var p1 = createImageBitmap(bitmap).then(function(imageBitmap) { bitmaps.defaultOption = imageBitmap });
var p2 = createImageBitmap(bitmap, {imageOrientation: "none", premultiplyAlpha: "premultiply"}).then(function(imageBitmap) { bitmaps.noFlipYPremul = imageBitmap });
var p3 = createImageBitmap(bitmap, {imageOrientation: "none", premultiplyAlpha: "default"}).then(function(imageBitmap) { bitmaps.noFlipYDefault = imageBitmap });
@@ -63,7 +57,7 @@ function generateTest()
var p9 = createImageBitmap(bitmap, {colorspaceConversion: "none"}).then(function(imageBitmap) { bitmaps.colorspaceNone = imageBitmap });
var p10 = createImageBitmap(bitmap, {colorspaceConversion: "default"}).then(function(imageBitmap) { bitmaps.colorspaceDefault = imageBitmap });
Promise.all([p1, p2, p3, p4, p5, p6, p7, p8, p9, p10]).then(function() {
- var alphaVal = 0;
+ var alphaVal = 0.5;
var testPassed = runTest(bitmaps, alphaVal, false);
if (testPassed)
pass();
@@ -84,7 +78,14 @@ function init()
testRunner.overridePreference("WebKitWebGLEnabled", "1");
testRunner.dumpAsText();
}
- generateTest();
+ var xhr = new XMLHttpRequest();
+ xhr.open("GET", 'resources/red-green-semi-transparent.png');
+ xhr.responseType = 'blob';
+ xhr.send();
+ xhr.onload = function() {
+ blob = xhr.response;
+ generateTest();
+ }
}
</script>
</head>

Powered by Google App Engine
This is Rietveld 408576698