+ // find how far towards the origin of the blur we are going to
+ // wander for each of the 4 corners of our tile, expanding the
+ // render description for each of them if necessary
+ int x, y;
+ for(y=0,pos[1]=tl[1];y<h;y+=(h-1),pos[1]+=ph*(h-1))
+ for(x=0,pos[0]=tl[0];x<w;x+=(w-1),pos[0]+=pw*(w-1))
+ rect.expand((pos-origin)*(1.0f-size) + origin);
+
+ // round out to the nearest pixel
+ Point tmp_surface_tl = Point(tl[0] - pw*(int((tl[0]-rect.get_min()[0])/pw+1-1e-6)),
+ tl[1] - ph*(int((tl[1]-rect.get_max()[1])/ph+1-1e-6)));
+ Point tmp_surface_br = Point(br[0] + pw*(int((rect.get_max()[0]-br[0])/pw+2-1e-6)),
+ br[1] + ph*(int((rect.get_min()[1]-br[1])/ph+2-1e-6)));
+
+ // round to nearest integer width and height (should be very
+ // nearly whole numbers already, but don't want to round 5.99999
+ // down to 5)
+ int tmp_surface_width = int((tmp_surface_br[0]-tmp_surface_tl[0])/pw + 0.5);
+ int tmp_surface_height = int((tmp_surface_br[1]-tmp_surface_tl[1])/ph + 0.5);
+
+ RendDesc desc(renddesc);
+ desc.clear_flags();
+ desc.set_wh(tmp_surface_width,tmp_surface_height);
+ desc.set_tl(tmp_surface_tl);
+ desc.set_br(tmp_surface_br);
+
+ // render the layers beneath us
+ if(!context.accelerated_render(&tmp_surface,quality,desc,cb))
+ return false;