From 347585cf975afac59ec6b9960e093acd015627f5 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 10 Mar 2010 14:32:40 -0800 Subject: Fix for EXT-6276. Added a check in LLTextBase::drawSelectionBackground() to keep it from sending degenerate rectangles to gl_rect_2d(). This seems to be what was causing the GL state to go bad. Reviewed by Richard at http://codereview.lindenlab.com/534001 --- indra/llui/llui.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 5121ef5351..9134adc6d1 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -202,6 +202,11 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) { + // FIXME: Drawing degenerate rectangles (specifically, zero-width rectangles) was causing + // https://jira.secondlife.com/browse/EXT-6276 on the Mac (presumably it was doing something bad to the GL state). + // That was fixed by checking for this case in LLTextBase::drawSelectionBackground(). + // It's possible we should check for degenerate rectangles here and not draw, but I wanted to do the minimal change for the moment. + stop_glerror(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -- cgit v1.2.3 From 58afe469f9d29aea0d3d974ac112725ddbaa3a19 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 12 Mar 2010 13:01:50 -0600 Subject: Bizarrely hacky fix for EXT-6276 (#if LL_DARWIN out copyFromPrimarySubstring) General gl state cleanup in llui. Make llrender more gGL.begin/end friendly. --- indra/llui/llui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 9134adc6d1..28ca83ad48 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -212,7 +212,7 @@ void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) // Counterclockwise quad will face the viewer if( filled ) - { + { gGL.begin( LLRender::QUADS ); gGL.vertex2i(left, top); gGL.vertex2i(left, bottom); @@ -513,8 +513,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (solid_color) { - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); + //gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); + //gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); } gGL.pushUIMatrix(); @@ -650,7 +650,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (solid_color) { - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + //gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } } -- cgit v1.2.3 From 4c8ae214b3f9745102ee90c25d9f67183aea0903 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 12 Mar 2010 14:11:08 -0600 Subject: Didn't mean to check in with these lines commented out. --- indra/llui/llui.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 28ca83ad48..2cd3bac7dd 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -513,8 +513,8 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (solid_color) { - //gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); - //gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); + gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); } gGL.pushUIMatrix(); @@ -650,7 +650,7 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (solid_color) { - //gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } } -- cgit v1.2.3 From 7ac2427b57c2d8e325b5e9c7fa87076bcaf2f6ef Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 12 Mar 2010 12:14:35 -0800 Subject: Backed out changeset 6fdd352b80d6 We thought this was a fix for EXT-6276, but it turned out it was just moving the problem. --- indra/llui/llui.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'indra/llui/llui.cpp') diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 9134adc6d1..5121ef5351 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -202,11 +202,6 @@ void gl_rect_2d_offset_local( S32 left, S32 top, S32 right, S32 bottom, S32 pixe void gl_rect_2d(S32 left, S32 top, S32 right, S32 bottom, BOOL filled ) { - // FIXME: Drawing degenerate rectangles (specifically, zero-width rectangles) was causing - // https://jira.secondlife.com/browse/EXT-6276 on the Mac (presumably it was doing something bad to the GL state). - // That was fixed by checking for this case in LLTextBase::drawSelectionBackground(). - // It's possible we should check for degenerate rectangles here and not draw, but I wanted to do the minimal change for the moment. - stop_glerror(); gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); -- cgit v1.2.3