2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
8 #include <aros/libcall.h>
9 #include <graphics/clip.h>
10 #include <exec/types.h>
11 #include <proto/exec.h>
12 #include <graphics/layers.h>
13 #include <proto/graphics.h>
14 #include <proto/layers.h>
15 #include "layers_intern.h"
16 #include "basicfuncs.h"
18 /*****************************************************************************
22 AROS_LH1(LONG
, BeginUpdate
,
25 AROS_LHA(struct Layer
*, l
, A0
),
28 struct LayersBase
*, LayersBase
, 13, Layers
)
31 Converts the damage list to ClipRects and exchanges the
32 two lists for faster redrawing. This routine allows a
33 faster update of the display as it will only be rendered
35 This routine will automatically lock the layer to prevent
42 TRUE if damage list conversion was successful
43 FALSE if list could not be converted.
57 27-11-96 digulla automatically created from
58 layers_lib.fd and clib/layers_protos.h
60 *****************************************************************************/
63 AROS_LIBBASE_EXT_DECL(struct LayersBase
*,LayersBase
)
65 struct Region
*damage_region
, *visible_damage_region
;
67 ** Convert the list of regionrectangles in the damage list
68 ** to a cliprect list.
77 damage_region
= AndRegionRegionND(l
->ClipRegion
, l
->DamageList
);
79 damage_region
= CopyRegion(l
->DamageList
);
81 /* The DamageList is in layer coords. So convert it to screen coords */
83 _TranslateRect(&damage_region
->bounds
, l
->bounds
.MinX
, l
->bounds
.MinY
);
85 AndRectRegion(damage_region
, &l
->bounds
);
87 visible_damage_region
= AndRegionRegionND(l
->VisibleRegion
, damage_region
);
88 AndRegionRegion(l
->visibleshape
, visible_damage_region
);
92 _TranslateRect(&visible_damage_region
->bounds
, -l
->bounds
.MinX
, -l
->bounds
.MinY
);
93 AndRegionRegion(l
->shaperegion
, visible_damage_region
);
94 _TranslateRect(&visible_damage_region
->bounds
, l
->bounds
.MinX
, l
->bounds
.MinY
);
97 l
->ClipRect
= _CreateClipRectsFromRegion(visible_damage_region
,
103 if (IS_SMARTREFRESH(l
))
105 _CopyClipRectsToClipRects(l
,
117 DisposeRegion(damage_region
);
118 DisposeRegion(visible_damage_region
);
121 ** Must not set flag before InstallClipRegion!!! Keep this order!!!
123 l
-> Flags
|= LAYERUPDATING
;