Path: blob/21.2-virgl/src/gallium/frontends/dri/dri_drawable.h
4565 views
/**************************************************************************1*2* Copyright 2009, VMware, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef DRI_DRAWABLE_H28#define DRI_DRAWABLE_H2930#include "pipe/p_compiler.h"31#include "pipe/p_format.h"32#include "frontend/api.h"3334struct pipe_surface;35struct st_framebuffer;36struct dri_context;3738struct dri_drawable39{40struct st_framebuffer_iface base;41struct st_visual stvis;4243struct dri_screen *screen;4445/* dri */46__DRIdrawable *dPriv;47__DRIscreen *sPriv;4849__DRIbuffer old[__DRI_BUFFER_COUNT];50unsigned old_num;51unsigned old_w;52unsigned old_h;5354struct pipe_box *damage_rects;55unsigned int num_damage_rects;5657struct pipe_resource *textures[ST_ATTACHMENT_COUNT];58struct pipe_resource *msaa_textures[ST_ATTACHMENT_COUNT];59unsigned int texture_mask, texture_stamp;6061struct pipe_fence_handle *throttle_fence;62bool flushing; /* prevents recursion in dri_flush */6364/* hooks filled in by dri2 & drisw */65void (*allocate_textures)(struct dri_context *ctx,66struct dri_drawable *drawable,67const enum st_attachment_type *statts,68unsigned count);6970void (*update_drawable_info)(struct dri_drawable *drawable);7172bool (*flush_frontbuffer)(struct dri_context *ctx,73struct dri_drawable *drawable,74enum st_attachment_type statt);7576void (*update_tex_buffer)(struct dri_drawable *drawable,77struct dri_context *ctx,78struct pipe_resource *res);79void (*flush_swapbuffers)(struct dri_context *ctx,80struct dri_drawable *drawable);81};8283static inline struct dri_drawable *84dri_drawable(__DRIdrawable * driDrawPriv)85{86return (struct dri_drawable *) (driDrawPriv)87? driDrawPriv->driverPrivate : NULL;88}8990/***********************************************************************91* dri_drawable.c92*/93bool94dri_create_buffer(__DRIscreen * sPriv,95__DRIdrawable * dPriv,96const struct gl_config * visual, bool isPixmap);9798void dri_destroy_buffer(__DRIdrawable * dPriv);99100void101dri_drawable_get_format(struct dri_drawable *drawable,102enum st_attachment_type statt,103enum pipe_format *format,104unsigned *bind);105106void107dri_pipe_blit(struct pipe_context *pipe,108struct pipe_resource *dst,109struct pipe_resource *src);110111void112dri_flush(__DRIcontext *cPriv,113__DRIdrawable *dPriv,114unsigned flags,115enum __DRI2throttleReason reason);116117extern const __DRItexBufferExtension driTexBufferExtension;118extern const __DRI2throttleExtension dri2ThrottleExtension;119#endif120121/* vim: set sw=3 ts=8 sts=3 expandtab: */122123124