#include "VG/openvg.h"
+#include "vg_manager.h"
#include "vg_context.h"
+#include "api.h"
#include "pipe/p_context.h"
#include "pipe/p_screen.h"
-VGErrorCode vgGetError(void)
+VGErrorCode vegaGetError(void)
{
struct vg_context *ctx = vg_current_context();
VGErrorCode error = VG_NO_CONTEXT_ERROR;
return error;
}
-void vgFlush(void)
+void vegaFlush(void)
{
struct vg_context *ctx = vg_current_context();
struct pipe_context *pipe;
return;
pipe = ctx->pipe;
- pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE, NULL);
+ pipe->flush(pipe, NULL, 0);
+
+ vg_manager_flush_frontbuffer(ctx);
}
-void vgFinish(void)
+void vegaFinish(void)
{
struct vg_context *ctx = vg_current_context();
struct pipe_fence_handle *fence = NULL;
pipe = ctx->pipe;
- pipe->flush(pipe, PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, &fence);
-
- pipe->screen->fence_finish(pipe->screen, fence, 0);
- pipe->screen->fence_reference(pipe->screen, &fence, NULL);
+ pipe->flush(pipe, &fence, 0);
+ if (fence) {
+ pipe->screen->fence_finish(pipe->screen, fence,
+ PIPE_TIMEOUT_INFINITE);
+ pipe->screen->fence_reference(pipe->screen, &fence, NULL);
+ }
}