+ glDrawElements(GL_LINES, (last_index-first_index)*2, GL_UNSIGNED_INT, (GLvoid*)(2*first_index*sizeof(uint32_t)));
+}
+
+
+
+/**
+ * Render Path (shading)
+ */
+void PathRenderer::RenderUsingCPU(const Objects & objects, const View & view, const CPURenderTarget & target, unsigned first_obj_id, unsigned last_obj_id)
+{
+ if (!view.ShowingObjectBounds() && !view.PerformingShading())
+ return;
+
+ for (unsigned i = 0; i < m_indexes.size(); ++i)
+ {
+ if (m_indexes[i] < first_obj_id) continue;
+ if (m_indexes[i] >= last_obj_id) continue;
+
+
+ Rect bounds(CPURenderBounds(objects.bounds[m_indexes[i]], view, target));
+ PixelBounds pix_bounds(bounds);
+ pix_bounds.x-=1;
+ pix_bounds.w+=2;
+ pix_bounds.y-=1;
+ pix_bounds.h+=2;
+ const Path & path = objects.paths[objects.data_indices[m_indexes[i]]];
+ if (path.m_fill.a == 0 || !view.PerformingShading())
+ continue;
+
+
+ pair<int64_t,int64_t> top(CPUPointLocation(path.m_top, view, target));
+ pair<int64_t,int64_t> bottom(CPUPointLocation(path.m_bottom, view, target));
+ pair<int64_t,int64_t> left(CPUPointLocation(path.m_left, view, target));
+ pair<int64_t,int64_t> right(CPUPointLocation(path.m_right, view, target));
+ FloodFillOnCPU(top.first, top.second+1, pix_bounds, target, path.m_fill);
+ FloodFillOnCPU(bottom.first, bottom.second-1, pix_bounds, target, path.m_fill);
+ FloodFillOnCPU(left.first+1, left.second, pix_bounds, target, path.m_fill);
+ FloodFillOnCPU(right.first-1, right.second, pix_bounds, target, path.m_fill);
+
+ if (view.ShowingObjectBounds())
+ {
+ Colour c(0,0,1,1);
+ RenderLineOnCPU(top.first, top.second, bottom.first, bottom.second, target, c);
+ RenderLineOnCPU(left.first, left.second, right.first, right.second, target, c);
+ ObjectRenderer::RenderLineOnCPU(pix_bounds.x, pix_bounds.y, pix_bounds.x+pix_bounds.w, pix_bounds.y, target, c);
+ ObjectRenderer::RenderLineOnCPU(pix_bounds.x, pix_bounds.y+pix_bounds.h, pix_bounds.x+pix_bounds.w, pix_bounds.y+pix_bounds.h, target, c);
+ ObjectRenderer::RenderLineOnCPU(pix_bounds.x, pix_bounds.y, pix_bounds.x, pix_bounds.y+pix_bounds.h, target, c);
+ ObjectRenderer::RenderLineOnCPU(pix_bounds.x+pix_bounds.w, pix_bounds.y, pix_bounds.x+pix_bounds.w, pix_bounds.y+pix_bounds.h, target, c);
+ }
+
+
+ }