- // 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;