New bitmap method SetRGBConversionFunction which can be used to
[tangerine.git] / rom / intuition / beginrefresh.c
blobdb5cccdd52128baa1ed0efd566da526b0139f9c9
1 /*
2 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
4 $Id$
5 */
7 #include <proto/layers.h>
8 #include <proto/graphics.h>
9 #include "intuition_intern.h"
10 #include "inputhandler_actions.h"
11 #include "inputhandler_support.h"
13 #ifdef SKINS
14 # include "renderwindowframe.h"
15 #endif
17 /*****************************************************************************
19 NAME */
20 #include <proto/intuition.h>
22 AROS_LH1(void, BeginRefresh,
24 /* SYNOPSIS */
25 AROS_LHA(struct Window *, window, A0),
27 /* LOCATION */
28 struct IntuitionBase *, IntuitionBase, 59, Intuition)
30 /* FUNCTION
32 INPUTS
34 RESULT
36 NOTES
38 EXAMPLE
40 BUGS
42 SEE ALSO
44 INTERNALS
46 *****************************************************************************/
48 AROS_LIBFUNC_INIT
49 AROS_LIBBASE_EXT_DECL(struct IntuitionBase *,IntuitionBase)
51 ULONG mode = NO_DOUBLEBUFFER;
53 #ifdef BEGINUPDATEGADGETREFRESH
54 BOOL gadgetrefresh = FALSE;
55 #endif
57 DEBUG_REFRESH(dprintf("BeginRefresh: Window 0x%lx\n", window));
59 SANITY_CHECK(window)
61 //jDc: makes sure we've got 1 refresing window at a time
62 LockLayerInfo(&window->WScreen->LayerInfo);
64 /* Find out whether it's a GimmeZeroZero window with an extra layer to lock */
65 if (BLAYER(window))
66 LockLayer(0, BLAYER(window));
68 /* jDc: in actual implementation border layer is created as the 1st one. this means it's added to
69 ** screens layer semaphore list at the end (layers use AddTail), so here we also need to lock it
70 ** as 1st one, otherwise we run into a deadlock with LockLayers() !!!
73 LockLayer(0, WLAYER(window));
75 /* jDc: in current opaque implementation the damaged regions are added to
76 ** window's internal damage list and matched against actual damage here
79 if (IW(window)->specialflags & SPFLAG_WANTBUFFER) mode = DOUBLEBUFFER;
81 /* I don't think I ever have to update the BorderRPort's layer */
82 if (FALSE == BeginUpdate(WLAYER(window)))
84 EndUpdate(WLAYER(window), FALSE);
86 //dprintf("%s :BeginUpdate returned FALSE!->Aborting BeginUpdate()\n",__FUNCTION__);
87 return;
90 /* jDc: because with opaque move window borders/gadgets are not refreshed to
91 ** speed things up we do this here - this reduces cpu time spent in inputhandler
94 /* let the user know that we're currently doing a refresh */
95 AROS_ATOMIC_OR(window->Flags, WFLG_WINDOWREFRESH);
97 AROS_LIBFUNC_EXIT
98 } /* BeginRefresh */