Path: blob/21.2-virgl/src/gallium/targets/haiku-softpipe/GalliumContext.h
4565 views
/*1* Copyright 2009, Haiku, Inc. All Rights Reserved.2* Distributed under the terms of the MIT License.3*4* Authors:5* Alexander von Gluck IV, [email protected]6*/7#ifndef GALLIUMCONTEXT_H8#define GALLIUMCONTEXT_H91011#include <stddef.h>12#include <kernel/image.h>1314#include "pipe/p_compiler.h"15#include "pipe/p_screen.h"16#include "postprocess/filters.h"17#include "hgl_context.h"18#include "sw/hgl/hgl_sw_winsys.h"192021class BBitmap;2223class GalliumContext {24public:25GalliumContext(ulong options);26~GalliumContext();2728void Lock();29void Unlock();3031context_id CreateContext(HGLWinsysContext *wsContext);32void DestroyContext(context_id contextID);33context_id GetCurrentContext() { return fCurrentContext; };34status_t SetCurrentContext(bool set, context_id contextID);3536status_t SwapBuffers(context_id contextID);37void Draw(context_id contextID, BRect updateRect);3839bool Validate(uint32 width, uint32 height);40void Invalidate(uint32 width, uint32 height);4142private:43status_t CreateDisplay();44void DestroyDisplay();45void Flush();4647ulong fOptions;48static int32 fDisplayRefCount;49static hgl_display* fDisplay;5051// Context Management52struct hgl_context* fContext[CONTEXT_MAX];53context_id fCurrentContext;54mtx_t fMutex;55};565758#endif /* GALLIUMCONTEXT_H */596061