My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include <CtrlCore/CtrlCore.h>

#ifdef GUI_FB

NAMESPACE_UPP

/*
static void sRenderLine(SystemDraw& w, int x, int y, int dx, int dy, int cx, int cy, int len, byte pattern)
{
DLOG(len);
for(int i = 0; i < len; i++)
if((128 >> (i & 7)) & pattern)
w.DrawRect(x + dx * i, y + dy * i, cx, cy, Black);
DDUMP("~sRenderLine");
}

static void sRenderRect(SystemDraw& w, const Rect& r, int n, byte pattern)
{
sRenderLine(w, r.left, r.top, 1, 0, 1, n, r.GetWidth(), pattern);
sRenderLine(w, r.left, r.bottom - 1, 1, 0, 1, n, r.GetWidth(), pattern);
sRenderLine(w, r.left, r.top, 0, 1, n, 1, r.GetHeight(), pattern);
sRenderLine(w, r.right - 1, r.top, 0, 1, n, 1, r.GetHeight(), pattern);
}

void DrawDragRect(SystemDraw& w, const Rect& rect1, const Rect& rect2,
const Rect& clip, int n, Color color, uint64 pattern)
{
DLOG("@ DrawDragRect " << rect1 << " " << rect2 << ", clip: " << clip << ", pattern: " << pattern);
TIMING("DrawDrawRect");
w.Clip(clip);
w.Invert();
sRenderRect(w, rect1, n, (byte)pattern);
sRenderRect(w, rect2, n, (byte)pattern);
Ctrl::AddUpdate((rect1 | rect2).Offseted(w.GetOffset()));
// MemoryProfile mem;
// DDUMP(mem);
w.End();
}




static uint64 sGetAniPat(uint64 src, int pos)
{
uint64 out = 0;
pos &= 7;
for(int i = 8; --i >= 0;) {
byte sr = (byte)(src >> (8 * ((7 - i - pos) & 7)));
out = (out << 8) | (byte)((sr | (sr << 8)) >> pos);
}
return out;
}
*/


/*
Size GetScreenSize()
{
return ScreenInfo().GetPageSize();
}
*/

void DrawDragRect(Ctrl& q, const Rect& rect1, const Rect& rect2, const Rect& clip, int n,
Color color, int type, int animation)
{
q.DragRectDraw(rect1, rect2, clip, n, color, type, animation);
}

END_UPP_NAMESPACE

#endif

Change log

r4176 by cxl on Nov 16, 2011   Diff
.reference: Rainbow example (RM #158)
Go to: 
Project members, sign in to write a code review

Older revisions

All revisions of this file

File info

Size: 1804 bytes, 71 lines
Powered by Google Project Hosting