1*61046927SAndroid Build Coastguard Worker /* 2*61046927SAndroid Build Coastguard Worker * Mesa 3-D graphics library 3*61046927SAndroid Build Coastguard Worker * 4*61046927SAndroid Build Coastguard Worker * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. 5*61046927SAndroid Build Coastguard Worker * Copyright (C) 2009-2011 VMware, Inc. All Rights Reserved. 6*61046927SAndroid Build Coastguard Worker * 7*61046927SAndroid Build Coastguard Worker * Permission is hereby granted, free of charge, to any person obtaining a 8*61046927SAndroid Build Coastguard Worker * copy of this software and associated documentation files (the "Software"), 9*61046927SAndroid Build Coastguard Worker * to deal in the Software without restriction, including without limitation 10*61046927SAndroid Build Coastguard Worker * the rights to use, copy, modify, merge, publish, distribute, sublicense, 11*61046927SAndroid Build Coastguard Worker * and/or sell copies of the Software, and to permit persons to whom the 12*61046927SAndroid Build Coastguard Worker * Software is furnished to do so, subject to the following conditions: 13*61046927SAndroid Build Coastguard Worker * 14*61046927SAndroid Build Coastguard Worker * The above copyright notice and this permission notice shall be included 15*61046927SAndroid Build Coastguard Worker * in all copies or substantial portions of the Software. 16*61046927SAndroid Build Coastguard Worker * 17*61046927SAndroid Build Coastguard Worker * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18*61046927SAndroid Build Coastguard Worker * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19*61046927SAndroid Build Coastguard Worker * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20*61046927SAndroid Build Coastguard Worker * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 21*61046927SAndroid Build Coastguard Worker * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 22*61046927SAndroid Build Coastguard Worker * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23*61046927SAndroid Build Coastguard Worker * OTHER DEALINGS IN THE SOFTWARE. 24*61046927SAndroid Build Coastguard Worker */ 25*61046927SAndroid Build Coastguard Worker 26*61046927SAndroid Build Coastguard Worker 27*61046927SAndroid Build Coastguard Worker #ifndef PBO_H 28*61046927SAndroid Build Coastguard Worker #define PBO_H 29*61046927SAndroid Build Coastguard Worker 30*61046927SAndroid Build Coastguard Worker 31*61046927SAndroid Build Coastguard Worker #include "util/glheader.h" 32*61046927SAndroid Build Coastguard Worker 33*61046927SAndroid Build Coastguard Worker struct gl_context; 34*61046927SAndroid Build Coastguard Worker struct gl_pixelstore_attrib; 35*61046927SAndroid Build Coastguard Worker 36*61046927SAndroid Build Coastguard Worker extern GLboolean 37*61046927SAndroid Build Coastguard Worker _mesa_validate_pbo_access(GLuint dimensions, 38*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *pack, 39*61046927SAndroid Build Coastguard Worker GLsizei width, GLsizei height, GLsizei depth, 40*61046927SAndroid Build Coastguard Worker GLenum format, GLenum type, GLsizei clientMemSize, 41*61046927SAndroid Build Coastguard Worker const GLvoid *ptr); 42*61046927SAndroid Build Coastguard Worker 43*61046927SAndroid Build Coastguard Worker extern const GLvoid * 44*61046927SAndroid Build Coastguard Worker _mesa_map_pbo_source(struct gl_context *ctx, 45*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack, 46*61046927SAndroid Build Coastguard Worker const GLvoid *src); 47*61046927SAndroid Build Coastguard Worker 48*61046927SAndroid Build Coastguard Worker extern const GLvoid * 49*61046927SAndroid Build Coastguard Worker _mesa_map_validate_pbo_source(struct gl_context *ctx, 50*61046927SAndroid Build Coastguard Worker GLuint dimensions, 51*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack, 52*61046927SAndroid Build Coastguard Worker GLsizei width, GLsizei height, GLsizei depth, 53*61046927SAndroid Build Coastguard Worker GLenum format, GLenum type, GLsizei clientMemSize, 54*61046927SAndroid Build Coastguard Worker const GLvoid *ptr, const char *where); 55*61046927SAndroid Build Coastguard Worker 56*61046927SAndroid Build Coastguard Worker extern void 57*61046927SAndroid Build Coastguard Worker _mesa_unmap_pbo_source(struct gl_context *ctx, 58*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack); 59*61046927SAndroid Build Coastguard Worker 60*61046927SAndroid Build Coastguard Worker extern void * 61*61046927SAndroid Build Coastguard Worker _mesa_map_pbo_dest(struct gl_context *ctx, 62*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *pack, 63*61046927SAndroid Build Coastguard Worker GLvoid *dest); 64*61046927SAndroid Build Coastguard Worker 65*61046927SAndroid Build Coastguard Worker extern GLvoid * 66*61046927SAndroid Build Coastguard Worker _mesa_map_validate_pbo_dest(struct gl_context *ctx, 67*61046927SAndroid Build Coastguard Worker GLuint dimensions, 68*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack, 69*61046927SAndroid Build Coastguard Worker GLsizei width, GLsizei height, GLsizei depth, 70*61046927SAndroid Build Coastguard Worker GLenum format, GLenum type, GLsizei clientMemSize, 71*61046927SAndroid Build Coastguard Worker GLvoid *ptr, const char *where); 72*61046927SAndroid Build Coastguard Worker 73*61046927SAndroid Build Coastguard Worker extern void 74*61046927SAndroid Build Coastguard Worker _mesa_unmap_pbo_dest(struct gl_context *ctx, 75*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *pack); 76*61046927SAndroid Build Coastguard Worker 77*61046927SAndroid Build Coastguard Worker 78*61046927SAndroid Build Coastguard Worker extern const GLvoid * 79*61046927SAndroid Build Coastguard Worker _mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions, 80*61046927SAndroid Build Coastguard Worker GLsizei width, GLsizei height, GLsizei depth, 81*61046927SAndroid Build Coastguard Worker GLenum format, GLenum type, const GLvoid *pixels, 82*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack, 83*61046927SAndroid Build Coastguard Worker const char *funcName); 84*61046927SAndroid Build Coastguard Worker 85*61046927SAndroid Build Coastguard Worker extern const GLvoid * 86*61046927SAndroid Build Coastguard Worker _mesa_validate_pbo_compressed_teximage(struct gl_context *ctx, 87*61046927SAndroid Build Coastguard Worker GLuint dimensions, GLsizei imageSize, 88*61046927SAndroid Build Coastguard Worker const GLvoid *pixels, 89*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *packing, 90*61046927SAndroid Build Coastguard Worker const char *funcName); 91*61046927SAndroid Build Coastguard Worker 92*61046927SAndroid Build Coastguard Worker extern void 93*61046927SAndroid Build Coastguard Worker _mesa_unmap_teximage_pbo(struct gl_context *ctx, 94*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack); 95*61046927SAndroid Build Coastguard Worker 96*61046927SAndroid Build Coastguard Worker 97*61046927SAndroid Build Coastguard Worker extern bool 98*61046927SAndroid Build Coastguard Worker _mesa_validate_pbo_source(struct gl_context *ctx, GLuint dimensions, 99*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack, 100*61046927SAndroid Build Coastguard Worker GLsizei width, GLsizei height, GLsizei depth, 101*61046927SAndroid Build Coastguard Worker GLenum format, GLenum type, 102*61046927SAndroid Build Coastguard Worker GLsizei clientMemSize, 103*61046927SAndroid Build Coastguard Worker const GLvoid *ptr, const char *where); 104*61046927SAndroid Build Coastguard Worker 105*61046927SAndroid Build Coastguard Worker extern bool 106*61046927SAndroid Build Coastguard Worker _mesa_validate_pbo_source_compressed(struct gl_context *ctx, GLuint dimensions, 107*61046927SAndroid Build Coastguard Worker const struct gl_pixelstore_attrib *unpack, 108*61046927SAndroid Build Coastguard Worker GLsizei imageSize, const GLvoid *ptr, 109*61046927SAndroid Build Coastguard Worker const char *where); 110*61046927SAndroid Build Coastguard Worker 111*61046927SAndroid Build Coastguard Worker #endif 112