diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-01 21:32:26 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2017-06-13 13:37:41 +0300 |
commit | a05f060153497e1be6515120b65f580f4551f9e0 (patch) | |
tree | b736fe12eebe4bfdac0154c4e45d4dbf26207b57 /test/util | |
parent | 28eb2e635417c7fb8d746a9ed1d76774066098b3 (diff) | |
download | qtlocation-mapboxgl-a05f060153497e1be6515120b65f580f4551f9e0.tar.gz |
[core] Added Backend::{assume,set}ScissorTest
Diffstat (limited to 'test/util')
-rw-r--r-- | test/util/offscreen_texture.test.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/util/offscreen_texture.test.cpp b/test/util/offscreen_texture.test.cpp index feaabf2630..0149b1a8dd 100644 --- a/test/util/offscreen_texture.test.cpp +++ b/test/util/offscreen_texture.test.cpp @@ -14,6 +14,11 @@ TEST(OffscreenTexture, EmptyRed) { HeadlessBackend backend { test::sharedDisplay() }; BackendScope scope { backend }; OffscreenView view(backend.getContext(), { 512, 256 }); + + // Scissor test shouldn't leak after OffscreenView::bind(). + MBGL_CHECK_ERROR(glScissor(64, 64, 128, 128)); + backend.getContext().scissorTest.setCurrentValue(true); + view.bind(); MBGL_CHECK_ERROR(glClearColor(1.0f, 0.0f, 0.0f, 1.0f)); @@ -128,6 +133,11 @@ void main() { // Then, create a texture, bind it, and render yellow to that texture. This should not // affect the originally bound FBO. OffscreenTexture texture(context, { 128, 128 }); + + // Scissor test shouldn't leak after OffscreenTexture::bind(). + MBGL_CHECK_ERROR(glScissor(32, 32, 64, 64)); + context.scissorTest.setCurrentValue(true); + texture.bind(); context.clear(Color(), {}, {}); |