Skip to content

Commit

Permalink
Avoid unnecessary image decode. (#7550)
Browse files Browse the repository at this point in the history
* Avoid unnecessary image decode.

* Remove unused import.
  • Loading branch information
dcervelli authored and mourner committed Nov 8, 2018
1 parent 9cce446 commit 9232211
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/source/image_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import { CanonicalTileID } from './tile_id';
import { Event, ErrorEvent, Evented } from '../util/evented';
import { getImage, ResourceType } from '../util/ajax';
import browser from '../util/browser';
import EXTENT from '../data/extent';
import { RasterBoundsArray } from '../data/array_types';
import rasterBoundsAttributes from '../data/raster_bounds_attributes';
Expand Down Expand Up @@ -79,7 +78,7 @@ class ImageSource extends Evented implements Source {
dispatcher: Dispatcher;
map: Map;
texture: Texture | null;
image: ImageData;
image: HTMLImageElement;
tileID: CanonicalTileID;
_boundsArray: RasterBoundsArray;
boundsBuffer: VertexBuffer;
Expand Down Expand Up @@ -114,7 +113,7 @@ class ImageSource extends Evented implements Source {
if (err) {
this.fire(new ErrorEvent(err));
} else if (image) {
this.image = browser.getImageData(image);
this.image = image;
if (newCoordinates) {
this.coordinates = newCoordinates;
}
Expand Down

0 comments on commit 9232211

Please sign in to comment.