Skip to content

Commit

Permalink
Remove unneeded ImageryState.
Browse files Browse the repository at this point in the history
  • Loading branch information
kring committed Mar 11, 2013
1 parent 45eac42 commit b8b9f7d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Source/Scene/ImageryLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ define([

imagery.texture = texture;
imagery.image = undefined;
imagery.state = ImageryState.TEXTURE_LOADED;
imagery.state = ImageryState.READY;
};

/**
Expand Down
1 change: 0 additions & 1 deletion Source/Scene/ImageryState.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ define(['../Core/Enumeration'], function(Enumeration) {
UNLOADED : new Enumeration(0, 'UNLOADED'),
TRANSITIONING : new Enumeration(1, 'TRANSITIONING'),
RECEIVED : new Enumeration(2, 'RECEIVED'),
TEXTURE_LOADED : new Enumeration(3, 'TEXTURE_LOADED'),
READY : new Enumeration(4, 'READY'),
FAILED : new Enumeration(5, 'FAILED'),
INVALID : new Enumeration(6, 'INVALID'),
Expand Down
5 changes: 0 additions & 5 deletions Source/Scene/Tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,6 @@ define([
imageryLayer._createTexture(context, imagery);
}

if (imagery.state === ImageryState.TEXTURE_LOADED) {
// TODO: unnecessary extra state.
imagery.state = ImageryState.READY;
}

if (imagery.state === ImageryState.READY && typeof tileImagery.textureTranslationAndScale === 'undefined') {
tileImagery.textureTranslationAndScale = imageryLayer._calculateTextureTranslationAndScale(this, tileImagery);
}
Expand Down
12 changes: 1 addition & 11 deletions Specs/Scene/ImageryLayerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,22 +150,12 @@ defineSuite([
layer._createTexture(context, imagery);
});

waitsFor(function() {
return imagery.state === ImageryState.TEXTURE_LOADED;
}, 'texture to load');

var textureBeforeReprojection;
runs(function() {
textureBeforeReprojection = imagery.texture;
layer._reprojectTexture(context, imagery);
});

waitsFor(function() {
return imagery.state === ImageryState.READY;
}, 'texture to be ready');

runs(function() {
expect(textureBeforeReprojection).not.toEqual(imagery.texture);
expect(imagery.texture).toBeDefined();
imagery.releaseReference();
});
});
Expand Down

0 comments on commit b8b9f7d

Please sign in to comment.