~ubuntu-branches/ubuntu/precise/xorg-server/precise-updates

« back to all changes in this revision

Viewing changes to miext/rootless/rootless.h

Tags: 2:1.10.1-2
* Build xserver-xorg-core-udeb on hurd-i386.  Thanks, Samuel Thibault!
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
 
69
69
    PixmapPtr pixmap;
70
70
 
71
 
#ifdef ROOTLESS_TRACK_DAMAGE
72
 
    RegionRec damage;
73
 
#endif
74
 
 
75
71
    unsigned int is_drawing :1; // Currently drawing?
76
72
    unsigned int is_reorder_pending :1;
77
73
    unsigned int is_offscreen :1;
80
76
 
81
77
 
82
78
/* Offset for screen-local to global coordinate transforms */
83
 
#ifdef ROOTLESS_GLOBAL_COORDS
84
79
extern int rootlessGlobalOffsetX;
85
80
extern int rootlessGlobalOffsetY;
86
 
#endif
87
81
 
88
82
/* The minimum number of bytes or pixels for which to use the
89
83
   implementation's accelerated functions. */
90
84
extern unsigned int rootless_CopyBytes_threshold;
91
 
extern unsigned int rootless_FillBytes_threshold;
92
 
extern unsigned int rootless_CompositePixels_threshold;
93
85
extern unsigned int rootless_CopyWindow_threshold;
94
86
 
95
 
/* Operations used by CompositePixels */
96
 
enum rl_composite_op_enum {
97
 
    RL_COMPOSITE_SRC = 0,
98
 
    RL_COMPOSITE_OVER,
99
 
};
100
 
 
101
 
/* Data formats for depth field and composite functions */
102
 
enum rl_depth_enum {
103
 
    RL_DEPTH_NIL = 0,                   /* null source when compositing */
104
 
    RL_DEPTH_ARGB8888,
105
 
    RL_DEPTH_RGB555,
106
 
    RL_DEPTH_A8,                        /* for masks when compositing */
107
 
    RL_DEPTH_INDEX8,
108
 
};
109
 
 
110
 
/* Macro to form the composite function for CompositePixels */
111
 
#define RL_COMPOSITE_FUNCTION(op, src_depth, mask_depth, dest_depth) \
112
 
    (((op) << 24) | ((src_depth) << 16) \
113
 
     | ((mask_depth) << 8) | ((dest_depth) << 0))
114
 
 
115
87
/* Gravity for window contents during resizing */
116
88
enum rl_gravity_enum {
117
89
    RL_GRAVITY_NONE             = 0,    /* no gravity, fill everything */
134
106
 *              initialized before calling except for pFrame->wid, which
135
107
 *              is set by this function.
136
108
 *  pScreen     Screen on which to place the new frame
137
 
 *  newX, newY  Position of the frame. These will be identical to pFrame-x,
138
 
 *              pFrame->y unless ROOTLESS_GLOBAL_COORDS is set.
 
109
 *  newX, newY  Position of the frame.
139
110
 *  pNewShape   Shape for the frame (in frame-local coordinates). NULL for
140
111
 *              unshaped frames.
141
112
 */
227
198
 *  is started again.
228
199
 *
229
200
 *  wid         Frame id
230
 
 *  flush       Flush drawing updates for this frame to the screen. This
231
 
 *              will always be FALSE if ROOTLESS_TRACK_DAMAGE is set.
 
201
 *  flush       Flush drawing updates for this frame to the screen.
232
202
 */
233
203
typedef void (*RootlessStopDrawingProc)
234
204
    (RootlessFrameID wid, Bool flush);
239
209
 *
240
210
 *  wid         Frame id
241
211
 *  pDamage     Region containing all the changed pixels in frame-lcoal
242
 
 *              coordinates. This is clipped to the window's clip. This
243
 
 *              will be NULL if ROOTLESS_TRACK_DAMAGE is not set.
 
212
 *              coordinates. This is clipped to the window's clip.
244
213
 */
245
214
typedef void (*RootlessUpdateRegionProc)
246
215
    (RootlessFrameID wid, RegionPtr pDamage);
247
216
 
248
217
/*
249
218
 * Mark damaged rectangles as requiring redisplay to screen.
250
 
 *  This will only be called if ROOTLESS_TRACK_DAMAGE is not set.
251
219
 *
252
220
 *  wid         Frame id
253
221
 *  nrects      Number of damaged rectangles
302
270
     void *dst, unsigned int dstRowBytes);
303
271
 
304
272
/*
305
 
 * Fill memory with 32-bit pattern. (Optional)
306
 
 *
307
 
 *  width       Bytes to fill per row
308
 
 *  height      Number of rows
309
 
 *  value       32-bit pattern to fill with
310
 
 *  dst         Destination data
311
 
 *  dstRowBytes Width of destination in bytes
312
 
 */
313
 
typedef void (*RootlessFillBytesProc)
314
 
    (unsigned int width, unsigned int height, unsigned int value,
315
 
     void *dst, unsigned int dstRowBytes);
316
 
 
317
 
/*
318
 
 * Composite pixels from source and mask to destination. (Optional)
319
 
 *
320
 
 *  width, height   Size of area to composite to in pizels
321
 
 *  function        Composite function built with RL_COMPOSITE_FUNCTION
322
 
 *  src             Source data
323
 
 *  srcRowBytes     Width of source in bytes (Passing NULL means source
324
 
 *                  is a single pixel.
325
 
 *  mask            Mask data
326
 
 *  maskRowBytes    Width of mask in bytes
327
 
 *  dst             Destination data
328
 
 *  dstRowBytes     Width of destination in bytes
329
 
 *
330
 
 *  For src and dst, the first element of the array is the color data. If
331
 
 *  the second element is non-null it implies there is alpha data (which
332
 
 *  may be meshed or planar). Data without alpha is assumed to be opaque.
333
 
 *
334
 
 *  An X11 error code is returned.
335
 
 */
336
 
typedef int (*RootlessCompositePixelsProc)
337
 
    (unsigned int width, unsigned int height, unsigned int function,
338
 
     void *src[2], unsigned int srcRowBytes[2],
339
 
     void *mask, unsigned int maskRowBytes,
340
 
     void *dst[2], unsigned int dstRowBytes[2]);
341
 
 
342
 
/*
343
273
 * Copy area in frame to another part of frame. (Optional)
344
274
 *
345
275
 *  wid         Frame id
374
304
    RootlessStartDrawingProc StartDrawing;
375
305
    RootlessStopDrawingProc StopDrawing;
376
306
    RootlessUpdateRegionProc UpdateRegion;
377
 
#ifndef ROOTLESS_TRACK_DAMAGE
378
307
    RootlessDamageRectsProc DamageRects;
379
 
#endif
380
308
 
381
309
    /* Optional frame functions */
382
310
    RootlessSwitchWindowProc SwitchWindow;
386
314
 
387
315
    /* Optional acceleration functions */
388
316
    RootlessCopyBytesProc CopyBytes;
389
 
    RootlessFillBytesProc FillBytes;
390
 
    RootlessCompositePixelsProc CompositePixels;
391
317
    RootlessCopyWindowProc CopyWindow;
392
318
} RootlessFrameProcsRec, *RootlessFrameProcsPtr;
393
319
 
398
324
Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs);
399
325
 
400
326
/*
401
 
 * Initialize acceleration for rootless mode on a given screen.
402
 
 *  Note: RootlessAccelInit() must be called before DamageSetup()
403
 
 *  and RootlessInit() must be called afterwards.
404
 
 */
405
 
Bool RootlessAccelInit(ScreenPtr pScreen);
406
 
 
407
 
/*
408
327
 * Return the frame ID for the physical window displaying the given window. 
409
328
 *
410
329
 *  create      If true and the window has no frame, attempt to create one
426
345
/*
427
346
 * Finish drawing to a window's backing buffer.
428
347
 *
429
 
 *  flush       If true and ROOTLESS_TRACK_DAMAGE is set, damaged areas
430
 
 *              are flushed to the screen.
 
348
 *  flush       If true, damaged areas are flushed to the screen.
431
349
 */
432
350
void RootlessStopDrawing(WindowPtr pWindow, Bool flush);
433
351