aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2010-10-18 15:24:50 +0000
committerArmin Rigo <arigo@tunes.org>2010-10-18 15:24:50 +0000
commit19a9f27fafa10c0cae33c1b1461c48589dbdc2c9 (patch)
tree5bd2008d62fcd34083c03f4632fe5d286a50428a /dotviewer
parentmerge the jitffi branch: it provides a new jit-friendly rlib.libffi module, (diff)
downloadpypy-19a9f27fafa10c0cae33c1b1461c48589dbdc2c9.tar.gz
pypy-19a9f27fafa10c0cae33c1b1461c48589dbdc2c9.tar.bz2
pypy-19a9f27fafa10c0cae33c1b1461c48589dbdc2c9.zip
Merge branch/rsre-jit: put the JIT hints in the rsre module.
Requires small extensions in the JIT: - "green fields": the ability to write 'foo.bar' in the list of greens in the JitDriver, where 'foo' is written in the list of reds. - the ability to only write jitdriver.jit_merge_point(), without any jitdriver.can_enter_jit(). In that case the jit_merge_point() plays both roles. The difference with putting explicitly a can_enter_jit() just before is that such a can_enter_jit() is not seen unless we are closing a loop; in particular, it does not work if we have no loop at all.
Diffstat (limited to 'dotviewer')
-rw-r--r--dotviewer/drawgraph.py49
1 files changed, 36 insertions, 13 deletions
diff --git a/dotviewer/drawgraph.py b/dotviewer/drawgraph.py
index db19d85920..c688688a71 100644
--- a/dotviewer/drawgraph.py
+++ b/dotviewer/drawgraph.py
@@ -423,20 +423,43 @@ class GraphRenderer:
else:
for line in lines:
raw_line = line.replace('\\l','').replace('\r','') or ' '
- img = TextSnippet(self, raw_line, (0, 0, 0), bgcolor)
- w, h = img.get_size()
- if w>wmax: wmax = w
- if raw_line.strip():
- if line.endswith('\\l'):
- def cmd(img=img, y=hmax):
- img.draw(xleft, ytop+y)
- elif line.endswith('\r'):
- def cmd(img=img, y=hmax, w=w):
- img.draw(xright-w, ytop+y)
- else:
- def cmd(img=img, y=hmax, w=w):
- img.draw(xcenter-w//2, ytop+y)
+ if '\f' in raw_line: # grayed out parts of the line
+ imgs = []
+ graytext = True
+ h = 16
+ w_total = 0
+ for linepart in raw_line.split('\f'):
+ graytext = not graytext
+ if not linepart.strip():
+ continue
+ if graytext:
+ fgcolor = (128, 160, 160)
+ else:
+ fgcolor = (0, 0, 0)
+ img = TextSnippet(self, linepart, fgcolor, bgcolor)
+ imgs.append((w_total, img))
+ w, h = img.get_size()
+ w_total += w
+ if w_total > wmax: wmax = w_total
+ def cmd(imgs=imgs, y=hmax):
+ for x, img in imgs:
+ img.draw(xleft+x, ytop+y)
commands.append(cmd)
+ else:
+ img = TextSnippet(self, raw_line, (0, 0, 0), bgcolor)
+ w, h = img.get_size()
+ if w>wmax: wmax = w
+ if raw_line.strip():
+ if line.endswith('\\l'):
+ def cmd(img=img, y=hmax):
+ img.draw(xleft, ytop+y)
+ elif line.endswith('\r'):
+ def cmd(img=img, y=hmax, w=w):
+ img.draw(xright-w, ytop+y)
+ else:
+ def cmd(img=img, y=hmax, w=w):
+ img.draw(xcenter-w//2, ytop+y)
+ commands.append(cmd)
hmax += h
#hmax += 8