From a4b351053662f4db4a165117cb18555dc4fabd33 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 24 Oct 2003 06:16:46 +0000 Subject: Initial working version -- added DamageDestroy and damage objects --- AUTHORS | 0 COPYING | 22 +++++++++ ChangeLog | 14 ++++++ INSTALL | 8 +++ Makefile.am | 37 ++++++++++++++ NEWS | 0 README | 10 ++++ autogen.sh | 3 ++ configure.ac | 35 +++++++++++++ damageext.pc.in | 9 ++++ damageproto.h | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ damagewire.h | 57 ++++++++++++++++++++++ protocol | 72 +++++++++++++++------------ 13 files changed, 385 insertions(+), 31 deletions(-) create mode 100644 AUTHORS create mode 100644 COPYING create mode 100644 INSTALL create mode 100644 Makefile.am create mode 100644 NEWS create mode 100644 README create mode 100755 autogen.sh create mode 100644 configure.ac create mode 100644 damageext.pc.in create mode 100644 damageproto.h create mode 100644 damagewire.h diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..e69de29 diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..830e297 --- /dev/null +++ b/COPYING @@ -0,0 +1,22 @@ +$Id: COPYING,v 1.1 2003-10-24 06:16:46 keithp Exp $ + +Copyright © 2001,2003 Keith Packard + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Keith Packard not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Keith Packard makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + diff --git a/ChangeLog b/ChangeLog index ceab7d9..a325eaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2003-10-23 Keith Packard + + * COPYING: + * INSTALL: + * Makefile.am: + * README: + * autogen.sh: + * configure.ac: + * damageext.pc.in: + * damageproto.h: + * damagewire.h: + * protocol: + Initial working version -- added DamageDestroy and damage objects + 2003-10-18 Keith Packard +#include +#include + +#define Window CARD32 +#define Drawable CARD32 +#define Font CARD32 +#define Pixmap CARD32 +#define Cursor CARD32 +#define Colormap CARD32 +#define GContext CARD32 +#define Atom CARD32 +#define VisualID CARD32 +#define Time CARD32 +#define KeyCode CARD8 +#define KeySym CARD32 +#define Picture CARD32 +#define Region CARD32 +#define Damage CARD32 + +/************** Version 0 ******************/ + +typedef struct { + CARD8 reqType; + CARD8 damageReqType; + CARD16 length B16; +} xDamageReq; + +/* + * requests and replies + */ + +typedef struct { + CARD8 reqType; + CARD8 damageReqType; + CARD16 length B16; + CARD32 majorVersion B32; + CARD32 minorVersion B32; +} xDamageQueryVersionReq; + +#define sz_xDamageQueryVersionReq 12 + +typedef struct { + BYTE type; /* X_Reply */ + BYTE pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 majorVersion B32; + CARD32 minorVersion B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; +} xDamageQueryVersionReply; + +#define sz_xDamageQueryVersionReply 32 + +typedef struct { + CARD8 reqType; + CARD8 damageReqType; + CARD16 length B16; + Damage damage B32; + Drawable drawable B32; + CARD8 level; + CARD8 pad1; + CARD16 pad2 B16; +} xDamageCreateReq; + +#define sz_xDamageCreateReq 16 + +typedef struct { + CARD8 reqType; + CARD8 damageReqType; + CARD16 length B16; + Damage damage B32; +} xDamageDestroyReq; + +#define sz_xDamageDestroyReq 8 + +typedef struct { + CARD8 reqType; + CARD8 damageReqType; + CARD16 length B16; + Damage damage B32; + Region repair B32; + Region parts B32; +} xDamageSubtractReq; + +#define sz_xDamageSubtractReq 16 + +/* Events */ + +#define DamageNotifyMore 0x80 + +typedef struct { + CARD8 type; + CARD8 level; + CARD16 sequenceNumber B16; + Drawable drawable B32; + Damage damage B32; + Time timestamp B32; + xRectangle area; + xRectangle geometry; +} xDamageNotifyEvent; + +#undef Damage +#undef Region +#undef Picture +#undef Window +#undef Drawable +#undef Font +#undef Pixmap +#undef Cursor +#undef Colormap +#undef GContext +#undef Atom +#undef VisualID +#undef Time +#undef KeyCode +#undef KeySym + +#endif /* _DAMAGEPROTO_H_ */ diff --git a/damagewire.h b/damagewire.h new file mode 100644 index 0000000..c763420 --- /dev/null +++ b/damagewire.h @@ -0,0 +1,57 @@ +/* + * $Id: damagewire.h,v 1.1 2003-10-24 06:16:46 keithp Exp $ + * + * Copyright © 2003 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef _DAMAGEWIRE_H_ +#define _DAMAGEWIRE_H_ + +#define DAMAGE_NAME "DAMAGE" +#define DAMAGE_MAJOR 1 +#define DAMAGE_MINOR 0 + +/************* Version 1 ****************/ + +/* Constants */ +#define XDamageReportRawRectangles 0 +#define XDamageReportDeltaRectangles 1 +#define XDamageReportBoundingBox 2 +#define XDamageReportNonEmpty 3 + +/* Requests */ +#define X_DamageQueryVersion 0 +#define X_DamageCreate 1 +#define X_DamageDestroy 2 +#define X_DamageSubtract 3 + +#define XDamageNumberRequests (X_DamageSubtract + 1) + +/* Events */ +#define XDamageNotify 0 + +#define XDamageNumberEvents (XDamageNotify + 1) + +/* Errors */ +#define BadDamage 0 +#define XDamageNumberErrors (BadDamage + 1) + +#endif /* _DAMAGEWIRE_H_ */ diff --git a/protocol b/protocol index d3a6a29..661a1dd 100644 --- a/protocol +++ b/protocol @@ -1,4 +1,4 @@ - The XDAMAGE Extension + The DAMAGE Extension Version 0.0 2003-10-18 Keith Packard @@ -8,7 +8,7 @@ Monitoring the regions affected by rendering has wide-spread use, from VNC-like systems scraping the screen to screen magnifying applications -designed to aid users with limited visual acuity. The XDAMAGE extension is +designed to aid users with limited visual acuity. The DAMAGE extension is designed to make such applications reasonably efficient in the face of server-client latency. @@ -44,7 +44,7 @@ object drawn (line, string, rectangle) to be represented as a single rectangle and for the damage area of the operation to be the union of these rectangles. -The XDAMAGE extension allows applications to either receive the raw +The DAMAGE extension allows applications to either receive the raw rectangles as a stream of events, or to have them partially processed within the X server to reduce the amount of data transmitted as well as reduce the processing latency once the repaint operation has started. @@ -52,7 +52,7 @@ processing latency once the repaint operation has started. Damage to a window reflects both drawing within the window itself as well as drawing within any inferior window that affects pixels seen by IncludeInferiors rendering operations. To reduce the computational -complexity of this, the XDAMAGE extension allows the server to monitor all +complexity of this, the DAMAGE extension allows the server to monitor all rendering operations within the physical target pixel storage that fall within the bounds of the window. In a system with a single frame buffer holding all windows, this means that damage will accumulate for all @@ -64,42 +64,46 @@ contents. 4. Data types -The XDAMAGE extension creates no new datatypes itself, but does lean heavily -on the XFIXES extension region datatypes. +The "Damage" object holds any accumulated damage region and reflects the +relationship between the drawable selected for damage notification and the +drawable for which damage is tracked. 5. Errors -No new errors are included in the XDAMAGE extension. +Damage + A value for a DAMAGE argument does not name a defined DAMAGE. 6. Types + DAMAGE 32-bit value (top three bits guaranteed to be zero) + DamageReportLevel { DamageReportRawRectangles, DamageReportDeltaRectangles, DamageReportBoundingBox, DamageReportNonEmpty } - DamageReportRawRectangles + DamageReportRawRectangles Delivers DamageNotify events each time the screen is modified with rectangular bounds that circumscribe the damaged area. No attempt to compress out overlapping rectangles is made. - DamageReportDeltaRectangles + DamageReportDeltaRectangles Delivers DamageNotify events each time damage occurs which is not included in the damage region. The reported rectangles include only the changes to that area, not the raw damage data. - DamageReportBoundingBox + DamageReportBoundingBox Delivers DamageNotify events each time the bounding box enclosing the damage region increases in size. The reported rectangle encloses the entire damage region, not just the changes to that size. - DamageReportNonEmpty + DamageReportNonEmpty Delivers a single DamageNotify event each time the damage rectangle changes from empty to non-empty, and @@ -111,9 +115,15 @@ No new errors are included in the XDAMAGE extension. DamageNotify level: DamageReportLevel - window: Window + drawable: Drawable + damage: DAMAGE + more: Bool timestamp: Timestamp - damage: Rectangle + area: Rectangle + drawable-geometry: Rectangle + + 'more' indicates whether there are subsequent damage events + being delivered immediately as part of a larger damage region 8. Extension Initialization @@ -142,34 +152,34 @@ QueryVersion 9. Enable Monitoring -DamageMonitor +DamageCreate - window: Window + damage: DAMAGE + drawable: Drawable level: DamageReportLevel - damage_region: Region + + Creates a damage object to monitor changes to Drawable - The server establishes a damage monitor for window. 'region' - is used to hold the damage region when level is not - DamageReportRawRectangles, in which case it is ignored - and may be None. +DamageDestroy + damage: DAMAGE + + Destroys damage. DamageSubtract - window: window - damage_region: Region - repair_region: Region or None - parts_region: Region + damage: DAMAGE + repair: Region or None + parts: Region Synchronously modifies the regions in the following manner: - If repair_region is None: + If repair is None: - 1) parts_region = damage_region - 2) damage_region = + 1) parts = damage + 2) damage = Otherwise: - 1) parts_region = damage_region INTERSECT repair_region - 2) damage_region = damage_region - parts_region - - + 1) parts = damage INTERSECT repair + 2) damage = damage - parts + 3) Generate DamageNotify for remaining damage areas -- cgit v1.2.1