pixmapstr.h (4325B)
1 /*********************************************************** 2 3 Copyright 1987, 1998 The Open Group 4 5 Permission to use, copy, modify, distribute, and sell this software and its 6 documentation for any purpose is hereby granted without fee, provided that 7 the above copyright notice appear in all copies and that both that 8 copyright notice and this permission notice appear in supporting 9 documentation. 10 11 The above copyright notice and this permission notice shall be included in 12 all copies or substantial portions of the Software. 13 14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 18 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 19 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 20 21 Except as contained in this notice, the name of The Open Group shall not be 22 used in advertising or otherwise to promote the sale, use or other dealings 23 in this Software without prior written authorization from The Open Group. 24 25 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 26 27 All Rights Reserved 28 29 Permission to use, copy, modify, and distribute this software and its 30 documentation for any purpose and without fee is hereby granted, 31 provided that the above copyright notice appear in all copies and that 32 both that copyright notice and this permission notice appear in 33 supporting documentation, and that the name of Digital not be 34 used in advertising or publicity pertaining to distribution of the 35 software without specific, written prior permission. 36 37 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 38 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 39 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 40 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 41 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 42 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 43 SOFTWARE. 44 45 ******************************************************************/ 46 47 #ifndef PIXMAPSTRUCT_H 48 #define PIXMAPSTRUCT_H 49 #include "pixmap.h" 50 #include "screenint.h" 51 #include "regionstr.h" 52 #include "privates.h" 53 #include "damage.h" 54 #include <X11/extensions/randr.h> 55 #include "picturestr.h" 56 57 typedef struct _Drawable { 58 unsigned char type; /* DRAWABLE_<type> */ 59 unsigned char class; /* specific to type */ 60 unsigned char depth; 61 unsigned char bitsPerPixel; 62 XID id; /* resource id */ 63 short x; /* window: screen absolute, pixmap: 0 */ 64 short y; /* window: screen absolute, pixmap: 0 */ 65 unsigned short width; 66 unsigned short height; 67 ScreenPtr pScreen; 68 unsigned long serialNumber; 69 } DrawableRec; 70 71 /* 72 * PIXMAP -- device dependent 73 */ 74 75 typedef struct _Pixmap { 76 DrawableRec drawable; 77 PrivateRec *devPrivates; 78 int refcnt; 79 int devKind; /* This is the pitch of the pixmap, typically width*bpp/8. */ 80 DevUnion devPrivate; /* When !NULL, devPrivate.ptr points to the raw pixel data. */ 81 #ifdef COMPOSITE 82 short screen_x; 83 short screen_y; 84 #endif 85 unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */ 86 87 PixmapPtr primary_pixmap; /* pointer to primary copy of pixmap for pixmap sharing */ 88 } PixmapRec; 89 90 typedef struct _PixmapDirtyUpdate { 91 DrawablePtr src; /* Root window / shared pixmap */ 92 PixmapPtr secondary_dst; /* Shared / scanout pixmap */ 93 int x, y; 94 DamagePtr damage; 95 struct xorg_list ent; 96 int dst_x, dst_y; 97 Rotation rotation; 98 PictTransform transform; 99 struct pixman_f_transform f_transform, f_inverse; 100 } PixmapDirtyUpdateRec; 101 102 static inline void 103 PixmapBox(BoxPtr box, PixmapPtr pixmap) 104 { 105 box->x1 = 0; 106 box->x2 = pixmap->drawable.width; 107 108 box->y1 = 0; 109 box->y2 = pixmap->drawable.height; 110 } 111 112 113 static inline void 114 PixmapRegionInit(RegionPtr region, PixmapPtr pixmap) 115 { 116 BoxRec box; 117 118 PixmapBox(&box, pixmap); 119 RegionInit(region, &box, 1); 120 } 121 122 #endif /* PIXMAPSTRUCT_H */