[cogl/wip/rib/master-next: 12/44] spans: only iterate spans within start-end range
- From: Robert Bragg <rbragg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/rib/master-next: 12/44] spans: only iterate spans within start-end range
- Date: Fri, 28 Oct 2011 14:14:50 +0000 (UTC)
commit 8687fc7b23f2db8c0ca765746794104d28421636
Author: Robert Bragg <robert linux intel com>
Date: Tue Oct 11 10:16:54 2011 +0100
spans: only iterate spans within start-end range
To save users of the api having to manually check if each iterated span
intersects the region of interest we now guarantee that any span
iterated implicitly intersects the region of interest.
cogl/cogl-spans.c | 3 +++
cogl/cogl-texture-2d-sliced.c | 22 ----------------------
2 files changed, 3 insertions(+), 22 deletions(-)
---
diff --git a/cogl/cogl-spans.c b/cogl/cogl-spans.c
index 4a3f0a8..bf72274 100644
--- a/cogl/cogl-spans.c
+++ b/cogl/cogl-spans.c
@@ -107,6 +107,9 @@ _cogl_span_iter_begin (CoglSpanIter *iter,
/* Update intersection */
_cogl_span_iter_update (iter);
+
+ while (iter->next_pos <= iter->cover_start)
+ _cogl_span_iter_next (iter);
}
void
diff --git a/cogl/cogl-texture-2d-sliced.c b/cogl/cogl-texture-2d-sliced.c
index 0484a04..8d922ec 100644
--- a/cogl/cogl-texture-2d-sliced.c
+++ b/cogl/cogl-texture-2d-sliced.c
@@ -146,10 +146,6 @@ _cogl_texture_2d_sliced_foreach_sub_texture_in_region (
float slice_ty1;
float slice_ty2;
- /* Discard slices out of rectangle early */
- if (!iter_y.intersects)
- continue;
-
if (iter_y.flipped)
{
y_intersect_start = iter_y.intersect_end;
@@ -181,10 +177,6 @@ _cogl_texture_2d_sliced_foreach_sub_texture_in_region (
float slice_tx2;
CoglTexture2D *slice_tex;
- /* Discard slices out of rectangle early */
- if (!iter_x.intersects)
- continue;
-
if (iter_x.flipped)
{
x_intersect_start = iter_x.intersect_end;
@@ -510,13 +502,6 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
_cogl_span_iter_next (&y_iter),
source_y += inter_h )
{
- /* Discard slices out of the subregion early */
- if (!y_iter.intersects)
- {
- inter_h = 0;
- continue;
- }
-
y_span = &g_array_index (tex_2ds->slice_y_spans, CoglSpan,
y_iter.index);
@@ -535,13 +520,6 @@ _cogl_texture_2d_sliced_upload_subregion_to_gl (CoglTexture2DSliced *tex_2ds,
{
int slice_num;
- /* Discard slices out of the subregion early */
- if (!x_iter.intersects)
- {
- inter_w = 0;
- continue;
- }
-
x_span = &g_array_index (tex_2ds->slice_x_spans, CoglSpan,
x_iter.index);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]