Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageBitmap and OffscreenCanvas for DEM tiles #8845

Merged
merged 18 commits into from
Dec 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/util/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ export const resetImageRequestQueue = () => {
resetImageRequestQueue();

export const getImage = function(requestParameters: RequestParameters, callback: Callback<HTMLImageElement | ImageBitmap>): Cancelable {
if (webpSupported.supported) {
if (!requestParameters.headers) {
requestParameters.headers = {};
}
requestParameters.headers.accept = 'image/webp,*/*';
}

// limit concurrent image loads to help with raster sources performance on big screens
if (numImageRequests >= config.MAX_PARALLEL_IMAGE_REQUESTS) {
const queued = {
Expand Down
6 changes: 5 additions & 1 deletion src/util/web_worker_transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function serialize(input: mixed, transferables: ?Array<Transferable>): Se
return input;
}

if (input instanceof ArrayBuffer || window.ImageBitmap && input instanceof window.ImageBitmap) {
if (isArrayBuffer(input) || window.ImageBitmap && input instanceof window.ImageBitmap) {
if (transferables) {
transferables.push(((input: any): ArrayBuffer));
}
Expand Down Expand Up @@ -223,8 +223,12 @@ export function deserialize(input: Serialized): mixed {
input instanceof String ||
input instanceof Date ||
input instanceof RegExp ||
<<<<<<< HEAD
input instanceof ArrayBuffer ||
input instanceof ImageBitmap ||
=======
isArrayBuffer(input) ||
>>>>>>> 8e8a28025dca26e258ad6a26c064d07596f11527
arindam1993 marked this conversation as resolved.
Show resolved Hide resolved
ArrayBuffer.isView(input) ||
input instanceof ImageData) {
return input;
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.