~didrocks/nux/disable-blacklist

« back to all changes in this revision

Viewing changes to NuxGraphics/GraphicsEngine.cpp

  • Committer: Jay Taoko
  • Date: 2011-04-20 05:47:48 UTC
  • mfrom: (334.1.2 trunk)
  • Revision ID: jay.taoko@canonical.com-20110420054748-9ylkher7efivnk7v
* Fix for bug #726033:
This is a hack for what looks like a bug in the radeon opensource driver on R300/400/500. Rather than passing a null region to glScissor, we give the clip area a 1 pixel width/height

Show diffs side-by-side

added added

removed removed

Lines of Context:
1153
1153
  {
1154
1154
    nuxAssert (w >= 0);
1155
1155
    nuxAssert (h >= 0);
 
1156
 
 
1157
    NUX_RETURN_IF_FALSE (w >= 0);
 
1158
    NUX_RETURN_IF_FALSE (h >= 0);
 
1159
 
1156
1160
    _scissor.x = x;
1157
1161
    _scissor.y = y;
1158
1162
    _scissor.width = w;
1159
1163
    _scissor.height = h;
1160
1164
 
1161
 
    if (_scissor.width < 0)
1162
 
    {
1163
 
      nuxAssertMsg (0, TEXT ("[GraphicsEngine::SetViewport] Incorrect context size.") );
1164
 
      _scissor.width = 1;
1165
 
    }
1166
 
 
1167
 
    if (_scissor.height < 0)
1168
 
    {
1169
 
      nuxAssertMsg (0, TEXT ("[GraphicsEngine::SetViewport] Incorrect context size.") );
1170
 
      _scissor.height = 1;
1171
 
    }
1172
 
 
1173
 
    CHECKGL ( glScissor (_scissor.x /*+ m_ScissorXOffset*/, _scissor.y /*+ m_ScissorYOffset*/, _scissor.width, _scissor.height) );
 
1165
    if (_scissor.x < 0)
 
1166
    {
 
1167
      _scissor.width += _scissor.x;
 
1168
      _scissor.x = 0;
 
1169
    }
 
1170
    
 
1171
    if (_scissor.y < 0)
 
1172
    {
 
1173
      _scissor.height += _scissor.y;
 
1174
      _scissor.y = 0;
 
1175
    }
 
1176
 
 
1177
    if (_scissor.width <= 0)
 
1178
    {
 
1179
      // jaytaoko: This is a hack for what looks like a bug (#726033) in the radeon opensource driver
 
1180
      // on R300/400/500. Rather than passing a null region to glScissor, we give the clip area a 1 pixel width.
 
1181
      //_scissor.width = 1;
 
1182
      CHECKGL (glScissor (0, 0, 1, 1));
 
1183
      return;
 
1184
    }
 
1185
 
 
1186
    if (_scissor.height <= 0)
 
1187
    {
 
1188
      // jaytaoko: This is a hack for what looks like a bug (#726033) in the radeon opensource driver
 
1189
      // on R300/400/500. Rather than passing a null region to glScissor, we give the clip area a 1 pixel height.
 
1190
      //_scissor.height = 1;
 
1191
      CHECKGL (glScissor (0, 0, 1, 1));
 
1192
      return;
 
1193
    }
 
1194
 
 
1195
    CHECKGL (glScissor (_scissor.x, _scissor.y, _scissor.width, _scissor.height));
1174
1196
  }
1175
1197
 
1176
1198
  Rect GraphicsEngine::GetScissorRect()