Auto merge of #8788 - ecoal95:fix-webgl-texturing, r=jdm

webgl: Fix texturing

These two tiny changes were making WebGL textures not work.

It was not seen in our texturing test since it only used one texture,
we render to a texture by default, and that texture was bound to
`gl::TEXTURE_2D`.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8788)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-12-04 22:12:26 +05:30
commit 2cfcc26d9e
2 changed files with 5 additions and 2 deletions

View file

@ -171,6 +171,9 @@ impl WebGLPaintTask {
CanvasWebGLMsg::DrawingBufferHeight(sender) =>
self.send_drawing_buffer_height(sender),
}
// FIXME: Convert to `debug_assert!` once tests are run with debug assertions
assert!(gl::get_error() == gl::NO_ERROR);
}
/// Creates a new `WebGLPaintTask` and returns the out-of-process sender and the in-process
@ -259,7 +262,7 @@ impl WebGLPaintTask {
}
fn create_texture(&self, chan: IpcSender<Option<NonZero<u32>>>) {
let texture = gl::gen_framebuffers(1)[0];
let texture = gl::gen_textures(1)[0];
let texture = if texture == 0 {
None
} else {