swrast: Remove unused clear code
This commit is contained in:
parent
21e0911b7d
commit
db8c0f96f6
@ -99,13 +99,6 @@ MesaSoftwareRenderer::MesaSoftwareRenderer(BGLView* view, ulong options,
|
||||
{
|
||||
CALLED();
|
||||
|
||||
fClearColor[BE_RCOMP] = 0;
|
||||
fClearColor[BE_GCOMP] = 0;
|
||||
fClearColor[BE_BCOMP] = 0;
|
||||
fClearColor[BE_ACOMP] = 0;
|
||||
|
||||
fClearIndex = 0;
|
||||
|
||||
fColorSpace = BScreen(GLView()->Window()).ColorSpace();
|
||||
|
||||
// We force single buffering for the time being
|
||||
@ -548,51 +541,6 @@ MesaSoftwareRenderer::_UpdateState(gl_context* ctx, GLuint new_state)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MesaSoftwareRenderer::_ClearFront(gl_context* ctx)
|
||||
{
|
||||
CALLED();
|
||||
|
||||
MesaSoftwareRenderer* mr = (MesaSoftwareRenderer*)ctx->DriverCtx;
|
||||
BGLView* bglview = mr->GLView();
|
||||
assert(bglview);
|
||||
BBitmap* bitmap = mr->fBitmap;
|
||||
assert(bitmap);
|
||||
GLuint* start = (GLuint*)bitmap->Bits();
|
||||
size_t pixelSize = 0;
|
||||
get_pixel_size_for(bitmap->ColorSpace(), &pixelSize, NULL, NULL);
|
||||
const GLuint* clearPixelPtr = (const GLuint*)mr->fClearColor;
|
||||
const GLuint clearPixel = B_LENDIAN_TO_HOST_INT32(*clearPixelPtr);
|
||||
|
||||
int x = ctx->DrawBuffer->_Xmin;
|
||||
int y = ctx->DrawBuffer->_Ymin;
|
||||
uint32 width = ctx->DrawBuffer->_Xmax - x;
|
||||
uint32 height = ctx->DrawBuffer->_Ymax - y;
|
||||
GLboolean all = (width == ctx->DrawBuffer->Width
|
||||
&& height == ctx->DrawBuffer->Height);
|
||||
|
||||
if (all) {
|
||||
const int numPixels = mr->fWidth * mr->fHeight;
|
||||
if (clearPixel == 0) {
|
||||
memset(start, 0, numPixels * pixelSize);
|
||||
} else {
|
||||
for (int i = 0; i < numPixels; i++) {
|
||||
start[i] = clearPixel;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// XXX untested
|
||||
start += y * mr->fWidth + x;
|
||||
for (uint32 i = 0; i < height; i++) {
|
||||
for (uint32 j = 0; j < width; j++) {
|
||||
start[j] = clearPixel;
|
||||
}
|
||||
start += mr->fWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
GLboolean
|
||||
MesaSoftwareRenderer::_RenderBufferStorage(gl_context* ctx,
|
||||
struct gl_renderbuffer* render, GLenum internalFormat,
|
||||
|
@ -53,7 +53,6 @@ private:
|
||||
GLsizei w, GLsizei h);
|
||||
void _CheckResize();
|
||||
static void _UpdateState(gl_context* ctx, GLuint newState);
|
||||
static void _ClearFront(gl_context* ctx);
|
||||
static void _Flush(gl_context *ctx);
|
||||
|
||||
struct swrast_renderbuffer* _NewRenderBuffer(bool front);
|
||||
@ -83,9 +82,6 @@ private:
|
||||
struct swrast_renderbuffer* fFrontRenderBuffer;
|
||||
struct swrast_renderbuffer* fBackRenderBuffer;
|
||||
|
||||
GLchan fClearColor[4]; // buffer clear color
|
||||
GLuint fClearIndex; // buffer clear color index
|
||||
|
||||
GLuint fWidth;
|
||||
GLuint fHeight;
|
||||
GLuint fNewWidth;
|
||||
|
Loading…
Reference in New Issue
Block a user