~ubuntu-branches/ubuntu/vivid/virtualbox/vivid

« back to all changes in this revision

Viewing changes to src/VBox/GuestHost/OpenGL/include/cr_glstate.h

  • Committer: Package Import Robot
  • Author(s): Felix Geyer
  • Date: 2011-12-29 12:29:25 UTC
  • mfrom: (3.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20111229122925-8ota2o33fuk0bkf8
Tags: 4.1.8-dfsg-1
* New upstream release.
* Move all transitional packages to section oldlibs and priority extra.
* Refresh 16-no-update.patch.
* Drop 36-kernel-3.2.patch, applied upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
#include "spu_dispatch_table.h"
47
47
 
 
48
#ifdef CHROMIUM_THREADSAFE
 
49
# include <cr_threads.h>
 
50
#endif
 
51
 
48
52
#include <iprt/cdefs.h>
49
53
 
50
54
#ifndef IN_GUEST
117
121
 */
118
122
struct CRContext {
119
123
    int id;
 
124
 
 
125
#ifdef CHROMIUM_THREADSAFE
 
126
    /* we keep reference counting of context's makeCurrent for different threads
 
127
     * this is primarily needed to avoid having an invalid memory reference in the TLS
 
128
     * when the context is assigned to more than one threads and then destroyed from
 
129
     * one of those, i.e.
 
130
     * 1. Thread1 -> MakeCurrent(ctx1);
 
131
     * 2. Thread2 -> MakeCurrent(ctx1);
 
132
     * 3. Thread1 -> Destroy(ctx1);
 
133
     * => Thread2 still refers to destroyed ctx1
 
134
     * */
 
135
    VBOXTLSREFDATA
 
136
#endif
 
137
 
120
138
    CRbitvalue bitid[CR_MAX_BITARRAY];
121
139
    CRbitvalue neg_bitid[CR_MAX_BITARRAY];
122
140
 
180
198
 
181
199
DECLEXPORT(void) crStateInit(void);
182
200
DECLEXPORT(void) crStateDestroy(void);
 
201
DECLEXPORT(void) crStateOnThreadAttachDetach(GLboolean attach);
183
202
DECLEXPORT(CRContext *) crStateCreateContext(const CRLimitsState *limits, GLint visBits, CRContext *share);
184
203
DECLEXPORT(CRContext *) crStateCreateContextEx(const CRLimitsState *limits, GLint visBits, CRContext *share, GLint presetID);
185
204
DECLEXPORT(void) crStateMakeCurrent(CRContext *ctx);