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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include <CtrlCore/CtrlCore.h>

#ifdef GUI_FB

NAMESPACE_UPP

#define LLOG(x) // LOG(x)
#define LTIMING(x) // RTIMING(x)

SystemDraw::SystemDraw()
: BufferPainter(Ctrl::framebuffer, Ctrl::renderingMode)
{
}

SystemDraw::~SystemDraw()
{
}


void SystemDraw::Push()
{
Point p = GetOffset();
offset.Add(p);
BufferPainter::BeginOp();
}

void SystemDraw::Pop()
{
if(offset.GetCount())
offset.Drop();
BufferPainter::EndOp();
}

Point SystemDraw::GetOffset() const
{
return offset.GetCount() ? offset.Top() : Point(0, 0);
}

void SystemDraw::BeginOp()
{
Push();
}

void SystemDraw::EndOp()
{
Pop();
}

void SystemDraw::OffsetOp(Point p)
{
Push();
offset.Top() += p;
Translate(p.x, p.y);
}

bool SystemDraw::ClipOp(const Rect& r)
{
Push();
RectPath(r);
Painter::Clip();
return true;
}

bool SystemDraw::ClipoffOp(const Rect& r)
{
Push();
offset.Top() += r.TopLeft();
RectPath(r);
Painter::Clip();
Translate(r.left, r.top);
return true;
}

bool SystemDraw::IsPaintingOp(const Rect& r) const
{
Rect rr = r + GetOffset();
for(int i = 0; i < Ctrl::invalid.GetCount(); i++)
if(Ctrl::invalid[i].Intersects(rr))
return true;
return true;
}

/*Rect SystemDraw::GetVirtualScreenArea()
{
GuiLock __;
}*/

/*
void BackDraw::Destroy()
{
GuiLock __;
}

void BackDraw::Create(SystemDraw& w, int cx, int cy) {
GuiLock __;
}

void BackDraw::Put(SystemDraw& w, int x, int y) {
GuiLock __;
}
*/

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: 1536 bytes, 105 lines
Powered by Google Project Hosting