//#include "state_tracker/st_cb_flush.h"
#include "state_tracker/st_context.h"
#include "state_tracker/st_gl_api.h"
-#include "state_tracker/sw_winsys.h"
+#include "frontend/sw_winsys.h"
#include "sw/hgl/hgl_sw_winsys.h"
#include "util/u_atomic.h"
#include "util/u_memory.h"
+#include "util/u_framebuffer.h"
#include "target-helpers/inline_sw_helper.h"
#include "target-helpers/inline_debug_helper.h"
DestroyContext(i);
Unlock();
- pipe_mutex_destroy(fMutex);
+ mtx_destroy(&fMutex);
// TODO: Destroy fScreen
}
return;
if (fContext[contextID]->st) {
- fContext[contextID]->st->flush(fContext[contextID]->st, 0, NULL);
+ fContext[contextID]->st->flush(fContext[contextID]->st, 0, NULL, NULL, NULL);
fContext[contextID]->st->destroy(fContext[contextID]->st);
}
if (oldContextID > 0 && oldContextID != contextID) {
fContext[oldContextID]->st->flush(fContext[oldContextID]->st,
- ST_FLUSH_FRONT, NULL);
+ ST_FLUSH_FRONT, NULL, NULL, NULL);
}
// We need to lock and unlock framebuffers before accessing them
ERROR("%s: context not found\n", __func__);
return B_ERROR;
}
+ context->st->flush(context->st, ST_FLUSH_FRONT, NULL, NULL, NULL);
- // TODO: Where did st_notify_swapbuffers go?
- //st_notify_swapbuffers(context->draw->stfbi);
-
- context->st->flush(context->st, ST_FLUSH_FRONT, NULL);
-
- struct st_context *stContext = (struct st_context*)context->st;
-
- unsigned nColorBuffers = stContext->state.framebuffer.nr_cbufs;
- for (unsigned i = 0; i < nColorBuffers; i++) {
- pipe_surface* surface = stContext->state.framebuffer.cbufs[i];
- if (!surface) {
- ERROR("%s: Color buffer %d invalid!\n", __func__, i);
- continue;
- }
-
- TRACE("%s: Flushing color buffer #%d\n", __func__, i);
-
- // We pass our destination bitmap to flush_fronbuffer which passes it
- // to the private winsys display call.
- fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
- context->bitmap, NULL);
+ struct hgl_buffer* buffer = hgl_st_framebuffer(context->draw->stfbi);
+ pipe_surface* surface = buffer->surface;
+ if (!surface) {
+ ERROR("%s: Invalid drawable surface!\n", __func__);
+ return B_ERROR;
}
- #if 0
- // TODO... should we flush the z stencil buffer?
- pipe_surface* zSurface = stContext->state.framebuffer.zsbuf;
- fScreen->flush_frontbuffer(fScreen, zSurface->texture, 0, 0,
+ fScreen->flush_frontbuffer(fScreen, surface->texture, 0, 0,
context->bitmap, NULL);
- #endif
return B_OK;
}
GalliumContext::Lock()
{
CALLED();
- pipe_mutex_lock(fMutex);
+ mtx_lock(&fMutex);
}
GalliumContext::Unlock()
{
CALLED();
- pipe_mutex_unlock(fMutex);
+ mtx_unlock(&fMutex);
}
/* vim: set tabstop=4: */