本文整理汇总了C++中LTIMING函数的典型用法代码示例。如果您正苦于以下问题:C++ LTIMING函数的具体用法?C++ LTIMING怎么用?C++ LTIMING使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LTIMING函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FTFace
FT_Face FTFace(Font fnt)
{
LTIMING("FTFace");
LLOG("FTFace " << fnt);
ONCELOCK {
ClearFtFaceCache();
}
FtFaceEntry be;
be = ft_cache[0];
for(int i = 0; i < FONTCACHE; i++) {
FtFaceEntry e = ft_cache[i];
if(i)
ft_cache[i] = be;
if(e.font == fnt && e.face) {
if(i)
ft_cache[0] = e;
LLOG("Found " << e.face);
return e.face;
}
be = e;
}
LTIMING("FTFace2");
if(be.face) {
LLOG("Removing " << be.font << " - " << (void *)be.face);
FT_Done_Face(be.face);
}
be.font = fnt;
be.face = CreateFTFace(be.font);
ft_cache[0] = be;
LLOG("Created " << be.face);
return be.face;
}
示例2: LTIMING
void Ctrl::RefreshFrame(const Rect& r) {
GuiLock __;
if(!IsOpen() || !IsVisible() || r.IsEmpty()) return;
LTIMING("RefreshFrame");
LLOG("RefreshRect " << Name() << ' ' << r);
#ifdef PLATFORM_WIN32
if(isdhctrl) {
InvalidateRect(((DHCtrl *)this)->GetHWND(), r, false);
return;
}
#endif
if(!top) {
if(InFrame())
parent->RefreshFrame(r + GetRect().TopLeft());
else
parent->Refresh(r + GetRect().TopLeft());
}
else {
LLOG("WndInvalidateRect: " << r << ' ' << Name());
LTIMING("RefreshFrame InvalidateRect");
WndInvalidateRect(r);
#ifdef PLATFORM_WIN32
LLOG("UpdateRect: " << GetWndUpdateRect() << ' ' << Name());
#endif
}
}
示例3: GetWin32Font
HFONT GetWin32Font(Font fnt, int angle)
{
LTIMING("GetWin32Font");
static HFontEntry cache[FONTCACHE];
ONCELOCK {
for(int i = 0; i < FONTCACHE; i++)
cache[i].font.Height(-30000);
}
HFontEntry be;
be = cache[0];
for(int i = 0; i < FONTCACHE; i++) {
HFontEntry e = cache[i];
if(i)
cache[i] = be;
if(e.font == fnt && e.angle == angle) {
if(i)
cache[0] = e;
return e.hfont;
}
be = e;
}
LTIMING("GetWin32Font2");
if(be.hfont)
DeleteObject(be.hfont);
be.font = fnt;
be.angle = angle;
#ifdef PLATFORM_WINCE
LOGFONT lfnt;
Zero(lfnt);
lfnt.lfHeight = fnt.GetHeight() ? -abs(fnt.GetHeight()) : -12;
lfnt.lfWeight = fnt.IsBold() ? FW_BOLD : FW_NORMAL;
lfnt.lfItalic = fnt.IsItalic();
lfnt.lfUnderline = fnt.IsUnderline();
lfnt.lfStrikeOut = fnt.IsStrikeout();
wcscpy(lfnt.lfFaceName, ToSystemCharset(fnt.GetFaceName()));
be.hfont = CreateFontIndirect(&lfnt);
#else
be.hfont = CreateFont(
fnt.GetHeight() ? -abs(fnt.GetHeight()) : -12,
fnt.GetWidth(), angle, angle, fnt.IsBold() ? FW_BOLD : FW_NORMAL,
fnt.IsItalic(), fnt.IsUnderline(), fnt.IsStrikeout(),
fnt.GetFace() == Font::SYMBOL ? SYMBOL_CHARSET : DEFAULT_CHARSET,
fnt.IsTrueTypeOnly() ? OUT_TT_ONLY_PRECIS : OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS,
fnt.IsNonAntiAliased() ? NONANTIALIASED_QUALITY : DEFAULT_QUALITY,
DEFAULT_PITCH|FF_DONTCARE,
fnt.GetFaceName()
);
#endif
cache[0] = be;
return be.hfont;
}
示例4: DoQualify
bool DoQualify(ScopeInfo& nf, const String& type, const String& usings, String& qt)
{
LTIMING("Qualify");
int q = nf.cache.Find(type);
if(q >= 0) {
qt = nf.cache[q];
return true;
}
LTIMING("Qualify0");
if(!Qualify0(nf, type, usings, qt))
return false;
nf.cache.Add(type, qt);
return true;
}
示例5: GetIncludePath
String GetIncludePath(const String& s, const String& filedir)
{
LTIMING("GetIncludePath");
String key;
key << s << "#" << filedir;
int q = sIncludePath.Find(key);
if(q >= 0)
return sIncludePath[q];
LTIMING("GetIncludePath 2");
String p = GetIncludePath0(s, filedir);
sIncludePath.Add(key, p);
LLOG("GetIncludePath " << s << " " << filedir << ": " << p);
return p;
}
示例6: LTIMING
Value Compiler::ExeLink::Eval(ExeContext& x) const
{
LTIMING("ExeLink");
Vector<Value> v;
v.SetCount(arg.GetCount());
for(int i = 0; i < arg.GetCount(); i++) {
LTIMING("arg eval");
v[i] = arg[i]->Eval(x);
}
StringBuffer r;
r << "\"";
MakeLink(r, *part, v);
r << "\"";
return Raw(r);
}
示例7: White
void SDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Color ink, int n, const int *dx)
{
sMakeTextGlyph g;
g.font = font;
g.color = White();
g.angle = angle;
g.draw = this;
for(int i = 0; i < n; i++) {
g.chr = text[i];
LTIMING("Paint glyph");
if(font.GetHeight() > 200) {
int bn = font[g.chr] + font.GetLineHeight();
for(g.yy = 0; g.yy < bn; g.yy += 32) {
Image m;
if(paintonly)
m = MakeImagePaintOnly(g);
else
m = MakeImage(g);
Point h = m.GetHotSpot();
SysDrawImageOp(x - h.x, y + g.yy - h.y, m, m.GetSize(), ink);
}
}
else {
g.yy = Null;
Image m;
if(paintonly)
m = MakeImagePaintOnly(g);
else
m = MakeImage(g);
Point h = m.GetHotSpot();
SysDrawImageOp(x - h.x, y - h.y, m, m.GetSize(), ink);
}
x += dx ? *dx++ : font[g.chr];
}
}
示例8: Begin
bool SystemDraw::ClipOp(const Rect& r)
{
GuiLock __;
Begin();
LTIMING("Clip");
return IntersectClip(r);
}
示例9: LLOG
void Ctrl::ScrollView(const Rect& _r, int dx, int dy)
{
GuiLock __;
LLOG("ScrollView " << _r << " " << dx << " " << dy);
if(IsFullRefresh() || !IsVisible())
return;
Size vsz = GetSize();
dx = sgn(dx) * min(abs(dx), vsz.cx);
dy = sgn(dy) * min(abs(dy), vsz.cy);
Rect r = _r & vsz;
LLOG("ScrollView2 " << r << " " << dx << " " << dy);
Ctrl *w;
for(w = this; w->parent; w = w->parent)
if(w->InFrame()) {
Refresh();
return;
}
if(!w || !w->top) return;
Rect view = InFrame() ? GetView() : GetClippedView();
Rect sr = (r + view.TopLeft()) & view;
sr += GetScreenRect().TopLeft() - w->GetScreenRect().TopLeft();
if(w->AddScroll(sr, dx, dy))
Refresh();
else {
LTIMING("ScrollCtrls1");
Top *top = GetTopCtrl()->top;
for(Ctrl *q = GetFirstChild(); q; q = q->GetNext())
if(q->InView())
ScrollCtrl(top, q, r, q->GetRect(), dx, dy);
if(parent)
for(Ctrl *q = parent->GetFirstChild(); q; q = q->GetNext())
if(q->InView() && q != this)
ScrollCtrl(top, q, r, q->GetScreenRect() - GetScreenView().TopLeft(), dx, dy);
}
}
示例10: IncludesFile
bool IncludesFile(const String& parent_path, const String& header_path)
{
LTIMING("IncludesFile");
int pi = sSrcFile.Find(parent_path);
int i = sSrcFile.Find(header_path);
return pi >= 0 && i >= 0 && sIncludes.Find(MAKEQWORD(pi, i)) >= 0;
}
示例11: White
void SDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Color ink, int n, const int *dx)
{
sMakeTextGlyph g;
g.font = font;
g.color = White();
g.angle = angle;
g.draw = this;
for(int i = 0; i < n; i++) {
g.chr = text[i];
LTIMING("Paint glyph");
if(font.GetHeight() > 200) {
Point at(font[g.chr], font.GetLineHeight());
int n = at.x + at.y;
Size bandsz(2 * n, 32);
for(int yy = 0; yy < n; yy += bandsz.cy) {
Image m = RenderGlyph(Point(0, -yy), angle, g.chr, font, White(), bandsz);
SysDrawImageOp(x, y + yy, m, m.GetSize(), ink);
}
}
else {
Image m = MakeImage(g);
Point h = m.GetHotSpot();
SysDrawImageOp(x - h.x, y - h.y, m, m.GetSize(), ink);
}
x += dx ? *dx++ : font[g.chr];
}
}
示例12: GetIncludePath0
String GetIncludePath0(const char *s, const char *filedir)
{
LTIMING("GetIncludePath0");
while(IsSpace(*s))
s++;
int type = *s;
if(type == '<' || type == '\"' || type == '?') {
s++;
String name;
if(type == '<') type = '>';
while(*s != '\r' && *s != '\n') {
if(*s == type) {
if(type == '\"') {
String fn = NormalizeSourcePath(name, filedir);
if(FileExists(fn))
return fn;
}
String p = GetFileOnPath(name, GetIncludePath(), false);
if(p.GetCount())
return NormalizeSourcePath(p);
return Null;
}
name.Cat(*s++);
}
}
return Null;
}
示例13: LTIMING
void Navigator::Scope()
{
LTIMING("FINALIZE");
litem.Clear();
nest_item.Clear();
linefo.Clear();
bool all = scope.GetCursor() <= 0;
String sc = scope.GetKey();
for(int i = 0; i < gitem.GetCount(); i++) {
String grp = gitem.GetKey(i);
int kind = KIND_NEST;
if(*grp == '\xff')
kind = KIND_FILE;
if(all) {
NavItem& m = nest_item.Add();
m.kind = kind;
m.type = FormatNest(grp);
litem.Add(&m);
}
else
if(grp != sc)
continue;
const Vector<NavItem *>& ia = gitem[i];
for(int i = 0; i < ia.GetCount(); i++) {
NavItem *m = ia[i];
for(int j = 0; j < m->linefo.GetCount(); j++)
linefo.GetAdd(m->linefo[j].file).Add(m->linefo[j].line, litem.GetCount());
litem.Add(m);
}
}
list.Clear();
list.SetVirtualCount(litem.GetCount());
}
示例14: SyncTopicFile
void SyncTopicFile(const RichText& text, const String& link, const String& path, const String& title)
{
LLOG("Scanning topic " << link);
LTIMING("Scanning topic");
ClearLinkRef(link);
ScanTopicIterator sti;
sti.link = link;
text.Iterate(sti);
TopicInfo& ti = topic_info().GetPut(link);
ti.title = title;
ti.path = path;
ti.time = FileGetTime(path);
ti.words = sti.words.PickKeys();
FileOut out(TopicCacheName(path));
out << tdx_version << "\n";
out << title << '\n';
for(int i = 0; i < sti.ref.GetCount(); i++)
out << sti.ref[i] << '\n';
out << '\n';
const Index<String>& ws = TopicWords();
for(int i = 0; i < ti.words.GetCount(); i++)
out << ws[ti.words[i]] << '\n';
}
示例15: LTIMING
void sOptimizedRectRenderer::Flush()
{
LTIMING("RectFlush");
if(!IsNull(cr)) {
w.DrawRect(cr, color);
cr = Null;
}
}