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

Refactored ViewportQuadSpec #2987

Merged
merged 4 commits into from
Aug 31, 2015

Conversation

lilleyse
Copy link
Contributor

For #1259

There's an issue where ClearCommand.ALL.execute(context) doesn't seem to do anything, and instead the clear color ends up being the scene's background color (0,0,0,255). I noticed other specs account for this, like TextureAtlasSpec.

I'm going to look into this more, but decided to start the pull request anyways.


us = context.uniformState;
us.update(context, createFrameState(createCamera()));
scene.primitives.add(viewportQuad);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest writing

viewportQuad = new ViewportQuad();
scene.primitives.add(viewportQuad);

as

viewportQuad = scene.primitives.add(new ViewportQuad());

This code was written before add returned the added primitive.

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 31, 2015

There's an issue where ClearCommand.ALL.execute(context)...

Don't use ClearCommand directly since the test is built on Scene now; let Scene execute all of the commands.

Instead of adding the primitive in beforeEach, we can test like:

expect(scene.renderForSpecs()).toEqual([0, 0, 0, 255]);
scene.primitives.add(viewportQuad);
expect(scene.renderForSpecs()).not.toEqual([0, 0, 0, 255]);

which, of course, makes my tip above not useful.

@lilleyse
Copy link
Contributor Author

Updated.

viewportQuad.rectangle = undefined;

expect(function() {
render(context, frameState, viewportQuad);
scene.primitives.add(viewportQuad);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only put the part that we expect to throw in the callback so, here and below, move this above:

scene.primitives.add(viewportQuad);

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 31, 2015

Just that minor comment.

@lilleyse
Copy link
Contributor Author

Done

@pjcozzi
Copy link
Contributor

pjcozzi commented Aug 31, 2015

Breathtaking.

pjcozzi added a commit that referenced this pull request Aug 31, 2015
@pjcozzi pjcozzi merged commit fd81f3a into CesiumGS:master Aug 31, 2015
@pjcozzi pjcozzi deleted the refactor-ViewportQuadSpec branch August 31, 2015 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants