From 1044ebb29c4b37ef2a34f62440e02f25b0dcd93e Mon Sep 17 00:00:00 2001 From: Alexander von Gluck IV Date: Fri, 30 Mar 2012 14:43:27 -0500 Subject: [PATCH] swrast: Set RowStride, remove Viewport hook --- .../opengl/swrast/MesaSoftwareRenderer.cpp | 22 +++---------------- .../opengl/swrast/MesaSoftwareRenderer.h | 2 -- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/src/add-ons/opengl/swrast/MesaSoftwareRenderer.cpp b/src/add-ons/opengl/swrast/MesaSoftwareRenderer.cpp index f998ddd8c0..f42eedeef4 100644 --- a/src/add-ons/opengl/swrast/MesaSoftwareRenderer.cpp +++ b/src/add-ons/opengl/swrast/MesaSoftwareRenderer.cpp @@ -115,7 +115,6 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options, functions.UpdateState = _UpdateState; functions.GetBufferSize = NULL; functions.Error = _Error; - functions.Viewport = _Viewport; functions.Flush = _Flush; // create core context @@ -495,23 +494,6 @@ MesaSoftwareRenderer::_GetString(gl_context* ctx, GLenum name) } -void -MesaSoftwareRenderer::_Viewport(gl_context* ctx, GLint x, GLint y, GLsizei w, - GLsizei h) -{ - CALLED(); - - // TODO - //gl_framebuffer* draw = ctx->WinSysDrawBuffer; - //gl_framebuffer* read = ctx->WinSysReadBuffer; - - //struct swrast_renderbuffer* msr = haikuFrameBuffer(draw); - - //_mesa_resize_framebuffer(ctx, draw, msr->width, msr->height); - //_mesa_resize_framebuffer(ctx, read, msr->width, msr->height); -} - - void MesaSoftwareRenderer::_UpdateState(gl_context* ctx, GLuint new_state) { @@ -536,6 +518,9 @@ MesaSoftwareRenderer::_RenderBufferStorage(gl_context* ctx, render->Width = width; render->Height = height; + struct swrast_renderbuffer *swRenderBuffer = swrast_renderbuffer(render); + swRenderBuffer->RowStride = width * _mesa_get_format_bytes(render->Format); + return GL_TRUE; } @@ -568,7 +553,6 @@ MesaSoftwareRenderer::_NewRenderBuffer(bool front) _mesa_init_renderbuffer(&swRenderBuffer->Base, 0); - //swRenderBuffer->Base.ClassID = OSMESA_RENDERBUFFER_CLASS; swRenderBuffer->Base.RefCount = 1; swRenderBuffer->Base.Delete = _RenderBufferDelete; swRenderBuffer->Base.AllocStorage = _RenderBufferStorage; diff --git a/src/add-ons/opengl/swrast/MesaSoftwareRenderer.h b/src/add-ons/opengl/swrast/MesaSoftwareRenderer.h index a41d07e246..c5616f8225 100644 --- a/src/add-ons/opengl/swrast/MesaSoftwareRenderer.h +++ b/src/add-ons/opengl/swrast/MesaSoftwareRenderer.h @@ -49,8 +49,6 @@ public: private: static void _Error(gl_context* ctx); static const GLubyte* _GetString(gl_context* ctx, GLenum name); - static void _Viewport(gl_context* ctx, GLint x, GLint y, - GLsizei w, GLsizei h); void _CheckResize(); static void _UpdateState(gl_context* ctx, GLuint newState); static void _Flush(gl_context *ctx);