fix(weather): upright N. America cloud tiles; lift shells over coarse 3D tiles (#730)

This commit is contained in:
Bilawal Sidhu authored and GitHub committed 2026-09-23 14:49:39 -05:00
1 parent 082074a006
commit 005254fcd1
7 files changed
+130 -3

No files matched your search

+35
View File
@@ -75,9 +75,13 @@ function target(extra = {}) {
function mockCanvas() {
const canvas = { width: 0, height: 0 };
canvas.getContext = () => ({
setTransform(...matrix) {
canvas.transforms = [...(canvas.transforms ?? []), matrix];
},
drawImage(source, ...crop) {
canvas.source = source;
canvas.crop = crop;
canvas.drawnWith = canvas.transforms?.at(-1) ?? null;
},
getImageData: () => ({ data: new Uint8ClampedArray([194, 100, 0, 200]) }),
putImageData(pixels) {
@@ -1510,6 +1514,37 @@ test('regional transfer preserves deferrals, original Request, rejection and can
assert.equal(await stage, false);
});
test('regional tiles decoded as flipped ImageBitmaps are drawn back upright', async () => {
const hadBitmap = Object.hasOwn(globalThis, 'ImageBitmap');
const previous = globalThis.ImageBitmap;
globalThis.ImageBitmap = class ImageBitmap {
width = 256;
height = 256;
};
try {
const h = renderingHarness();
void h.rendering.setFrame(
{ ...snapshot, product: 'clouds-regional' },
times[0],
);
const provider = h.providers[0];
// Cesium decodes with imageOrientation 'flipY'; the canvas upload flips again.
provider.response = { promise: Promise.resolve(new ImageBitmap()) };
const bitmapTile = await provider.requestImage(0, 0, 0, {});
assert.deepEqual(bitmapTile.drawnWith, [1, 0, 0, -1, 0, 256]);
// An HTMLImageElement fallback is not pre-flipped.
provider.response = {
promise: Promise.resolve({ width: 256, height: 256 }),
};
const imageTile = await provider.requestImage(1, 0, 0, {});
assert.equal(imageTile.drawnWith, null);
h.rendering.clear();
} finally {
if (hadBitmap) globalThis.ImageBitmap = previous;
else delete globalThis.ImageBitmap;
}
});
for (const kind of ['globe']) {
test(`infrared mode restages the same time on ${kind}, retaining the old layer for one rendered frame`, async () => {
let host,