1af69d88dSmrg/* 2af69d88dSmrg * Copyright 2009, Haiku, Inc. All Rights Reserved. 3af69d88dSmrg * Distributed under the terms of the MIT License. 4af69d88dSmrg * 5af69d88dSmrg * Authors: 6af69d88dSmrg * Alexander von Gluck IV, kallisti5@unixzen.com 7af69d88dSmrg */ 8af69d88dSmrg#ifndef GALLIUMCONTEXT_H 9af69d88dSmrg#define GALLIUMCONTEXT_H 10af69d88dSmrg 11af69d88dSmrg 12af69d88dSmrg#include <stddef.h> 13af69d88dSmrg#include <kernel/image.h> 14af69d88dSmrg 15af69d88dSmrg#include "pipe/p_compiler.h" 16af69d88dSmrg#include "pipe/p_screen.h" 17af69d88dSmrg#include "postprocess/filters.h" 1801e04c3fSmrg#include "hgl_context.h" 197ec681f3Smrg#include "sw/hgl/hgl_sw_winsys.h" 20af69d88dSmrg 21af69d88dSmrg 227ec681f3Smrgclass BBitmap; 23af69d88dSmrg 24af69d88dSmrgclass GalliumContext { 25af69d88dSmrgpublic: 26af69d88dSmrg GalliumContext(ulong options); 27af69d88dSmrg ~GalliumContext(); 28af69d88dSmrg 29af69d88dSmrg void Lock(); 30af69d88dSmrg void Unlock(); 31af69d88dSmrg 327ec681f3Smrg context_id CreateContext(HGLWinsysContext *wsContext); 33af69d88dSmrg void DestroyContext(context_id contextID); 34af69d88dSmrg context_id GetCurrentContext() { return fCurrentContext; }; 357ec681f3Smrg status_t SetCurrentContext(bool set, context_id contextID); 36af69d88dSmrg 37af69d88dSmrg status_t SwapBuffers(context_id contextID); 387ec681f3Smrg void Draw(context_id contextID, BRect updateRect); 3901e04c3fSmrg 4001e04c3fSmrg bool Validate(uint32 width, uint32 height); 4101e04c3fSmrg void Invalidate(uint32 width, uint32 height); 42af69d88dSmrg 43af69d88dSmrgprivate: 447ec681f3Smrg status_t CreateDisplay(); 457ec681f3Smrg void DestroyDisplay(); 46af69d88dSmrg void Flush(); 47af69d88dSmrg 48af69d88dSmrg ulong fOptions; 497ec681f3Smrg static int32 fDisplayRefCount; 507ec681f3Smrg static hgl_display* fDisplay; 51af69d88dSmrg 52af69d88dSmrg // Context Management 53af69d88dSmrg struct hgl_context* fContext[CONTEXT_MAX]; 54af69d88dSmrg context_id fCurrentContext; 557ec681f3Smrg mtx_t fMutex; 56af69d88dSmrg}; 5701e04c3fSmrg 58af69d88dSmrg 59af69d88dSmrg#endif /* GALLIUMCONTEXT_H */ 60