[cogl/cogl-1.8] Clear the color bits of the textures in the color mask test
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/cogl-1.8] Clear the color bits of the textures in the color mask test
- Date: Thu, 29 Sep 2011 09:34:33 +0000 (UTC)
commit 4cd8ba0c4af9237d7bcd597a0b197c65e9b289f9
Author: Luca Bruno <lucabru src gnome org>
Date: Wed Sep 28 20:48:45 2011 +0200
Clear the color bits of the textures in the color mask test
Uninitialized textures could contain random bits. That makes the test
fail as glColorMask is used to let only one of the RGB pass through.
https://bugzilla.gnome.org/show_bug.cgi?id=660387
Reviewed-by: Neil Roberts <neil linux intel com>
(cherry picked from commit e7cdb1b11b47c81fe9e9a4815a3a2085343e03e8)
tests/conform/test-color-mask.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/tests/conform/test-color-mask.c b/tests/conform/test-color-mask.c
index d3817ef..389a41d 100644
--- a/tests/conform/test-color-mask.c
+++ b/tests/conform/test-color-mask.c
@@ -92,11 +92,14 @@ test_cogl_color_mask (TestUtilsGTestFixture *fixture,
{
TestUtilsSharedState *shared_state = data;
TestState state;
+ CoglColor bg;
int i;
state.width = cogl_framebuffer_get_width (shared_state->fb);
state.height = cogl_framebuffer_get_height (shared_state->fb);
+ cogl_color_init_from_4ub (&bg, 0, 0, 0, 255);
+
for (i = 0; i < NUM_FBOS; i++)
{
state.tex[i] = cogl_texture_new_with_size (128, 128,
@@ -105,6 +108,12 @@ test_cogl_color_mask (TestUtilsGTestFixture *fixture,
state.fbo[i] = cogl_offscreen_new_to_texture (state.tex[i]);
+
+ /* Clear the texture color bits */
+ cogl_push_framebuffer (state.fbo[i]);
+ cogl_clear (&bg, COGL_BUFFER_BIT_COLOR);
+ cogl_pop_framebuffer ();
+
cogl_framebuffer_set_color_mask (state.fbo[i],
i == 0 ? COGL_COLOR_MASK_RED :
i == 1 ? COGL_COLOR_MASK_GREEN :
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]