зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678909 - mark image bitmap as premult when converted so that we don't repeatedly premultiply it. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D100287
This commit is contained in:
Родитель
896fb71c16
Коммит
00c0e09335
|
@ -592,6 +592,7 @@ already_AddRefed<SourceSurface> ImageBitmap::PrepareForDrawTarget(
|
|||
srcSurface->Unmap();
|
||||
}
|
||||
|
||||
mAlphaType = gfxAlphaType::Premult;
|
||||
mSurface = dstSurface;
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ class ImageBitmap final : public nsISupports, public nsWrapperCache {
|
|||
*/
|
||||
gfx::IntRect mPictureRect;
|
||||
|
||||
const gfxAlphaType mAlphaType;
|
||||
gfxAlphaType mAlphaType;
|
||||
|
||||
RefPtr<ImageBitmapShutdownObserver> mShutdownObserver;
|
||||
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<head><meta charset="utf-8"></head>
|
||||
<body>
|
||||
<canvas id="canvas" width="200" height="200"></canvas>
|
||||
<script>
|
||||
let canvas = document.getElementById('canvas');
|
||||
let ctx = canvas.getContext('2d');
|
||||
for (let i=0; i<100; i+=50) {
|
||||
let arr = new Uint8ClampedArray(Array(40000).fill(200));
|
||||
createImageBitmap(new ImageData(arr, 100)).then(img => {
|
||||
ctx.drawImage(img, i, i);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<head><meta charset="utf-8"></head>
|
||||
<body>
|
||||
<canvas id="canvas" width="200" height="200"></canvas>
|
||||
<script>
|
||||
let canvas = document.getElementById('canvas');
|
||||
let ctx = canvas.getContext('2d');
|
||||
let arr = new Uint8ClampedArray(Array(40000).fill(200));
|
||||
createImageBitmap(new ImageData(arr, 100)).then(img => {
|
||||
for (let i=0; i<100; i+=50)
|
||||
ctx.drawImage(img, i, i);
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -175,3 +175,6 @@ fuzzy-if(azureSkia,0-16,0-2) fuzzy-if(Android,0-3,0-40) fuzzy-if(/^Windows\x20NT
|
|||
|
||||
# Bug 1377303
|
||||
skip-if(Android) == visible-occluded.html visible-occluded-ref.html
|
||||
|
||||
== 1678909-1.html 1678909-1-ref.html
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче