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;
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;
95
/* Operations used by CompositePixels */
96
enum rl_composite_op_enum {
101
/* Data formats for depth field and composite functions */
103
RL_DEPTH_NIL = 0, /* null source when compositing */
106
RL_DEPTH_A8, /* for masks when compositing */
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))
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.
227
198
* is started again.
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.
233
203
typedef void (*RootlessStopDrawingProc)
234
204
(RootlessFrameID wid, Bool flush);
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.
245
214
typedef void (*RootlessUpdateRegionProc)
246
215
(RootlessFrameID wid, RegionPtr pDamage);
249
218
* Mark damaged rectangles as requiring redisplay to screen.
250
* This will only be called if ROOTLESS_TRACK_DAMAGE is not set.
253
221
* nrects Number of damaged rectangles
302
270
void *dst, unsigned int dstRowBytes);
305
* Fill memory with 32-bit pattern. (Optional)
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
313
typedef void (*RootlessFillBytesProc)
314
(unsigned int width, unsigned int height, unsigned int value,
315
void *dst, unsigned int dstRowBytes);
318
* Composite pixels from source and mask to destination. (Optional)
320
* width, height Size of area to composite to in pizels
321
* function Composite function built with RL_COMPOSITE_FUNCTION
323
* srcRowBytes Width of source in bytes (Passing NULL means source
326
* maskRowBytes Width of mask in bytes
327
* dst Destination data
328
* dstRowBytes Width of destination in bytes
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.
334
* An X11 error code is returned.
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]);
343
273
* Copy area in frame to another part of frame. (Optional)
374
304
RootlessStartDrawingProc StartDrawing;
375
305
RootlessStopDrawingProc StopDrawing;
376
306
RootlessUpdateRegionProc UpdateRegion;
377
#ifndef ROOTLESS_TRACK_DAMAGE
378
307
RootlessDamageRectsProc DamageRects;
381
309
/* Optional frame functions */
382
310
RootlessSwitchWindowProc SwitchWindow;
387
315
/* Optional acceleration functions */
388
316
RootlessCopyBytesProc CopyBytes;
389
RootlessFillBytesProc FillBytes;
390
RootlessCompositePixelsProc CompositePixels;
391
317
RootlessCopyWindowProc CopyWindow;
392
318
} RootlessFrameProcsRec, *RootlessFrameProcsPtr;
398
324
Bool RootlessInit(ScreenPtr pScreen, RootlessFrameProcsPtr procs);
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.
405
Bool RootlessAccelInit(ScreenPtr pScreen);
408
327
* Return the frame ID for the physical window displaying the given window.
410
329
* create If true and the window has no frame, attempt to create one
427
346
* Finish drawing to a window's backing buffer.
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.
432
350
void RootlessStopDrawing(WindowPtr pWindow, Bool flush);