diff options
author | Alexander von Gluck IV <[email protected]> | 2013-10-03 01:22:48 +0000 |
---|---|---|
committer | Alexander von Gluck IV <[email protected]> | 2013-10-04 18:20:09 -0500 |
commit | 8730236d1a900c9512a9ef92c08034f0223bcf92 (patch) | |
tree | 9d4ec570b0604811cc4431f0e0f5cab292939021 /src/gallium/targets/haiku-softpipe/GalliumContext.h | |
parent | c9f1217e1f2c309cfd8770940773f1f35582a795 (diff) |
haiku: Add first Haiku renderer (softpipe)
* This shared library gets parsed by the
system as a system "add-on"
Diffstat (limited to 'src/gallium/targets/haiku-softpipe/GalliumContext.h')
-rw-r--r-- | src/gallium/targets/haiku-softpipe/GalliumContext.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.h b/src/gallium/targets/haiku-softpipe/GalliumContext.h new file mode 100644 index 00000000000..88e9f81238e --- /dev/null +++ b/src/gallium/targets/haiku-softpipe/GalliumContext.h @@ -0,0 +1,83 @@ +/* + * Copyright 2009, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Alexander von Gluck IV, [email protected] + */ +#ifndef GALLIUMCONTEXT_H +#define GALLIUMCONTEXT_H + + +#include <stddef.h> +#include <kernel/image.h> + +extern "C" { +#include "state_tracker/st_api.h" +#include "pipe/p_compiler.h" +#include "pipe/p_screen.h" +#include "postprocess/filters.h" +#include "os/os_thread.h" +} +#include "bitmap_wrapper.h" +#include "GalliumFramebuffer.h" + + +#define CONTEXT_MAX 32 + + +typedef int64 context_id; + +struct hgl_context +{ + struct st_api* api; + // State Tracker API + struct st_manager* manager; + // State Tracker Manager + struct st_context_iface* st; + // State Tracker Interface Object + struct st_visual* stVisual; + // State Tracker Visual + + struct pipe_resource* textures[ST_ATTACHMENT_COUNT]; + + // Post processing + struct pp_queue_t* postProcess; + unsigned int postProcessEnable[PP_FILTERS]; + + Bitmap* bitmap; + color_space colorSpace; + + GalliumFramebuffer* draw; + GalliumFramebuffer* read; +}; + + +class GalliumContext { +public: + GalliumContext(ulong options); + ~GalliumContext(); + + context_id CreateContext(Bitmap* bitmap); + void DestroyContext(context_id contextID); + context_id GetCurrentContext() { return fCurrentContext; }; + status_t SetCurrentContext(Bitmap *bitmap, + context_id contextID); + + status_t SwapBuffers(context_id contextID); + +private: + status_t CreateScreen(); + void Flush(); + + ulong fOptions; + + struct hgl_context* fContext[CONTEXT_MAX]; + context_id fCurrentContext; + + struct pipe_screen* fScreen; + pipe_mutex fMutex; +}; + + +#endif /* GALLIUMCONTEXT_H */ |