0

renamed uppertile to compositetile (makes more sense)

This reverts commit d4c6e40d59, and
re-applies it with a renamed uppertile.
This commit is contained in:
Aaron Griffith
2011-12-12 15:15:36 -05:00
parent 4b622b1333
commit cc95799d1a
2 changed files with 14 additions and 14 deletions

View File

@@ -353,13 +353,13 @@ class RenderNode(object):
self.print_statusline(0, total, level, True)
# Same deal as above. _apply_render_uppertile adds tiles in batch
# Same deal as above. _apply_render_compositetile adds tiles in batch
# to the worker pool and yields result objects that return the
# number of tiles rendered.
#
# XXX Some quadtrees may not have tiles at this zoom level if we're
# not assuming they all have the same depth!!
for result in self._apply_render_uppertile(pool, zoom,batch_size):
for result in self._apply_render_compositetile(pool, zoom,batch_size):
results.append(result)
# every second drain some of the queue
timestamp2 = time.time()
@@ -389,7 +389,7 @@ class RenderNode(object):
# Do the final one right here:
for q in quadtrees:
q.render_uppertile(os.path.join(q.destdir, q.tiledir), "base")
q.render_compositetile(os.path.join(q.destdir, q.tiledir), "base")
def _get_dirty_tiles(self, procs):
"""Returns two items:
@@ -489,8 +489,8 @@ class RenderNode(object):
if len(batch):
yield pool.apply_async(func=render_worldtile_batch, args= [batch])
def _apply_render_uppertile(self, pool, zoom,batch_size):
"""Same as _apply_render_worltiles but for the uppertile routine.
def _apply_render_compositetile(self, pool, zoom,batch_size):
"""Same as _apply_render_worltiles but for the compositetile routine.
Returns an iterator that yields result objects from tasks that have
been applied to the pool.
"""
@@ -500,7 +500,7 @@ class RenderNode(object):
batch = []
jobcount = 0
# roundrobin add tiles to a batch job (thus they should all roughly work on similar chunks)
iterables = [q.get_uppertiles(zoom) for q in self.quadtrees if zoom <= q.p]
iterables = [q.get_compositetiles(zoom) for q in self.quadtrees if zoom <= q.p]
for job in util.roundrobin(iterables):
# fixup so the worker knows which quadtree this is
job[0] = job[0]._render_index
@@ -509,11 +509,11 @@ class RenderNode(object):
jobcount += 1
if jobcount >= batch_size:
jobcount = 0
yield pool.apply_async(func=render_uppertile_batch, args= [batch])
yield pool.apply_async(func=render_compositetile_batch, args= [batch])
batch = []
if jobcount > 0:
yield pool.apply_async(func=render_uppertile_batch, args= [batch])
yield pool.apply_async(func=render_compositetile_batch, args= [batch])
########################################################################################
@@ -542,7 +542,7 @@ def render_worldtile_batch(batch):
return count
@catch_keyboardinterrupt
def render_uppertile_batch(batch):
def render_compositetile_batch(batch):
global child_rendernode
rendernode = child_rendernode
count = 0
@@ -551,7 +551,7 @@ def render_uppertile_batch(batch):
count += 1
quadtree = rendernode.quadtrees[job[0]]
dest = quadtree.full_tiledir+os.sep+job[1]
quadtree.render_uppertile(dest=dest,name=job[2])
quadtree.render_compositetile(dest=dest,name=job[2])
return count
@catch_keyboardinterrupt