17ec681f3Smrg/************************************************************************** 27ec681f3Smrg * 37ec681f3Smrg * Copyright (C) 2009 VMware, Inc. 47ec681f3Smrg * All Rights Reserved. 57ec681f3Smrg * 67ec681f3Smrg * Permission is hereby granted, free of charge, to any person obtaining a 77ec681f3Smrg * copy of this software and associated documentation files (the 87ec681f3Smrg * "Software"), to deal in the Software without restriction, including 97ec681f3Smrg * without limitation the rights to use, copy, modify, merge, publish, 107ec681f3Smrg * distribute, sub license, and/or sell copies of the Software, and to 117ec681f3Smrg * permit persons to whom the Software is furnished to do so, subject to 127ec681f3Smrg * the following conditions: 137ec681f3Smrg * 147ec681f3Smrg * The above copyright notice and this permission notice (including the 157ec681f3Smrg * next paragraph) shall be included in all copies or substantial portions 167ec681f3Smrg * of the Software. 177ec681f3Smrg * 187ec681f3Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 197ec681f3Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 207ec681f3Smrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 217ec681f3Smrg * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR 227ec681f3Smrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 237ec681f3Smrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 247ec681f3Smrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 257ec681f3Smrg * 267ec681f3Smrg **************************************************************************/ 277ec681f3Smrg/* 287ec681f3Smrg * Author: Keith Whitwell <keithw@vmware.com> 297ec681f3Smrg * Author: Jakob Bornecrantz <wallbraker@gmail.com> 307ec681f3Smrg */ 317ec681f3Smrg 327ec681f3Smrg#ifndef DRI_CONTEXT_H 337ec681f3Smrg#define DRI_CONTEXT_H 347ec681f3Smrg 357ec681f3Smrg#include "dri_util.h" 367ec681f3Smrg#include "pipe/p_compiler.h" 377ec681f3Smrg#include "hud/hud_context.h" 387ec681f3Smrg 397ec681f3Smrgstruct pipe_context; 407ec681f3Smrgstruct pipe_fence; 417ec681f3Smrgstruct st_api; 427ec681f3Smrgstruct st_context_iface; 437ec681f3Smrgstruct dri_drawable; 447ec681f3Smrg 457ec681f3Smrgstruct dri_context 467ec681f3Smrg{ 477ec681f3Smrg /* dri */ 487ec681f3Smrg __DRIscreen *sPriv; 497ec681f3Smrg __DRIcontext *cPriv; 507ec681f3Smrg __DRIdrawable *dPriv; 517ec681f3Smrg __DRIdrawable *rPriv; 527ec681f3Smrg 537ec681f3Smrg unsigned int bind_count; 547ec681f3Smrg 557ec681f3Smrg /** 567ec681f3Smrg * True if the __DRIdrawable's current __DRIimageBufferMask is 577ec681f3Smrg * __DRI_IMAGE_BUFFER_SHARED. 587ec681f3Smrg */ 597ec681f3Smrg bool is_shared_buffer_bound; 607ec681f3Smrg 617ec681f3Smrg /* gallium */ 627ec681f3Smrg struct st_api *stapi; 637ec681f3Smrg struct st_context_iface *st; 647ec681f3Smrg struct pp_queue_t *pp; 657ec681f3Smrg struct hud_context *hud; 667ec681f3Smrg}; 677ec681f3Smrg 687ec681f3Smrgstatic inline struct dri_context * 697ec681f3Smrgdri_context(__DRIcontext * driContextPriv) 707ec681f3Smrg{ 717ec681f3Smrg if (!driContextPriv) 727ec681f3Smrg return NULL; 737ec681f3Smrg return (struct dri_context *)driContextPriv->driverPrivate; 747ec681f3Smrg} 757ec681f3Smrg 767ec681f3Smrg/*********************************************************************** 777ec681f3Smrg * dri_context.c 787ec681f3Smrg */ 797ec681f3Smrgvoid dri_destroy_context(__DRIcontext * driContextPriv); 807ec681f3Smrg 817ec681f3Smrgboolean dri_unbind_context(__DRIcontext * driContextPriv); 827ec681f3Smrg 837ec681f3Smrgboolean 847ec681f3Smrgdri_make_current(__DRIcontext * driContextPriv, 857ec681f3Smrg __DRIdrawable * driDrawPriv, 867ec681f3Smrg __DRIdrawable * driReadPriv); 877ec681f3Smrg 887ec681f3Smrgstruct dri_context * 897ec681f3Smrgdri_get_current(__DRIscreen * driScreenPriv); 907ec681f3Smrg 917ec681f3Smrgboolean 927ec681f3Smrgdri_create_context(gl_api api, 937ec681f3Smrg const struct gl_config * visual, 947ec681f3Smrg __DRIcontext * driContextPriv, 957ec681f3Smrg const struct __DriverContextConfig *ctx_config, 967ec681f3Smrg unsigned *error, 977ec681f3Smrg void *sharedContextPrivate); 987ec681f3Smrg 997ec681f3Smrg#endif 1007ec681f3Smrg 1017ec681f3Smrg/* vim: set sw=3 ts=8 sts=3 expandtab: */ 102