swrast: Remove fNewWidth/fNewHeight
This commit is contained in:
@@ -179,8 +179,8 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options,
|
|||||||
fVisual->haveAccumBuffer, alphaFlag, GL_FALSE);
|
fVisual->haveAccumBuffer, alphaFlag, GL_FALSE);
|
||||||
|
|
||||||
BRect bounds = view->Bounds();
|
BRect bounds = view->Bounds();
|
||||||
fWidth = fNewWidth = (GLint)bounds.Width();
|
fWidth = (GLint)bounds.Width();
|
||||||
fHeight = fNewHeight = (GLint)bounds.Height();
|
fHeight = (GLint)bounds.Height();
|
||||||
|
|
||||||
// some stupid applications (Quake2) don't even think about calling LockGL()
|
// some stupid applications (Quake2) don't even think about calling LockGL()
|
||||||
// before using glGetString and its glGet*() friends...
|
// before using glGetString and its glGet*() friends...
|
||||||
@@ -221,11 +221,14 @@ MesaSoftwareRenderer::LockGL()
|
|||||||
|
|
||||||
color_space colorSpace = BScreen(GLView()->Window()).ColorSpace();
|
color_space colorSpace = BScreen(GLView()->Window()).ColorSpace();
|
||||||
|
|
||||||
|
GLuint width = fWidth;
|
||||||
|
GLuint height = fHeight;
|
||||||
|
|
||||||
BAutolock lock(fInfoLocker);
|
BAutolock lock(fInfoLocker);
|
||||||
if (fDirectModeEnabled && fInfo != NULL) {
|
if (fDirectModeEnabled && fInfo != NULL) {
|
||||||
fNewWidth = fInfo->window_bounds.right
|
width = fInfo->window_bounds.right
|
||||||
- fInfo->window_bounds.left + 1;
|
- fInfo->window_bounds.left + 1;
|
||||||
fNewHeight = fInfo->window_bounds.bottom
|
height = fInfo->window_bounds.bottom
|
||||||
- fInfo->window_bounds.top + 1;
|
- fInfo->window_bounds.top + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -236,7 +239,7 @@ MesaSoftwareRenderer::LockGL()
|
|||||||
_SetupRenderBuffer(&fBackRenderBuffer->Base, fColorSpace);
|
_SetupRenderBuffer(&fBackRenderBuffer->Base, fColorSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
_CheckResize();
|
_CheckResize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -396,25 +399,23 @@ void
|
|||||||
MesaSoftwareRenderer::FrameResized(float width, float height)
|
MesaSoftwareRenderer::FrameResized(float width, float height)
|
||||||
{
|
{
|
||||||
BAutolock lock(fInfoLocker);
|
BAutolock lock(fInfoLocker);
|
||||||
fNewWidth = (GLuint)width;
|
_CheckResize((GLuint)width, (GLuint)height);
|
||||||
fNewHeight = (GLuint)height;
|
|
||||||
_CheckResize();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
MesaSoftwareRenderer::_CheckResize()
|
MesaSoftwareRenderer::_CheckResize(GLuint newWidth, GLuint newHeight)
|
||||||
{
|
{
|
||||||
CALLED();
|
CALLED();
|
||||||
|
|
||||||
if (fBitmap && fNewWidth == fWidth
|
if (fBitmap && newWidth == fWidth
|
||||||
&& fNewHeight == fHeight) {
|
&& newHeight == fHeight) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fHeight = fNewHeight;
|
_mesa_resize_framebuffer(fContext, fFrameBuffer, newWidth, newHeight);
|
||||||
fWidth = fNewWidth;
|
fHeight = newHeight;
|
||||||
_mesa_resize_framebuffer(fContext, fFrameBuffer, fWidth, fHeight);
|
fWidth = newWidth;
|
||||||
|
|
||||||
_AllocateBitmap();
|
_AllocateBitmap();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
static void _Error(gl_context* ctx);
|
static void _Error(gl_context* ctx);
|
||||||
static const GLubyte* _GetString(gl_context* ctx, GLenum name);
|
static const GLubyte* _GetString(gl_context* ctx, GLenum name);
|
||||||
void _CheckResize();
|
void _CheckResize(GLuint newWidth, GLuint newHeight);
|
||||||
static void _UpdateState(gl_context* ctx, GLuint newState);
|
static void _UpdateState(gl_context* ctx, GLuint newState);
|
||||||
static void _Flush(gl_context *ctx);
|
static void _Flush(gl_context *ctx);
|
||||||
|
|
||||||
@@ -88,8 +88,6 @@ private:
|
|||||||
|
|
||||||
GLuint fWidth;
|
GLuint fWidth;
|
||||||
GLuint fHeight;
|
GLuint fHeight;
|
||||||
GLuint fNewWidth;
|
|
||||||
GLuint fNewHeight;
|
|
||||||
color_space fColorSpace;
|
color_space fColorSpace;
|
||||||
|
|
||||||
void* fRowAddr[SWRAST_MAX_HEIGHT];
|
void* fRowAddr[SWRAST_MAX_HEIGHT];
|
||||||
|
|||||||
Reference in New Issue
Block a user