[gegl/samplers] sampler.c: / 8 -> >> 3 B/C always non negative	numerator
- From: Nicolas Robidoux <nrobidoux src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gegl/samplers] sampler.c: / 8 -> >> 3 B/C always non negative	numerator
- Date: Thu, 30 Jun 2011 14:02:13 +0000 (UTC)
commit cb1d563224ab9f5a20d61b5ebf3a65c295edbfa2
Author: Nicolas Robidoux <nicolas robidoux gmail com>
Date:   Thu Jun 30 09:32:08 2011 -0400
    sampler.c: / 8 -> >> 3 B/C always non negative numerator
 gegl/buffer/gegl-sampler.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gegl/buffer/gegl-sampler.c b/gegl/buffer/gegl-sampler.c
index 24a1de9..3a2f491 100644
--- a/gegl/buffer/gegl-sampler.c
+++ b/gegl/buffer/gegl-sampler.c
@@ -277,10 +277,10 @@ gegl_sampler_get_ptr (GeglSampler *const sampler,
        */
       fetch_rectangle.x =
         x + sampler->context_rect[0].x
-        - ( maximum_width_and_height - sampler->context_rect[0].width  ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[0].width  ) >> 3;
       fetch_rectangle.y =
         y + sampler->context_rect[0].y
-        - ( maximum_width_and_height - sampler->context_rect[0].height ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[0].height ) >> 3;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
@@ -352,9 +352,9 @@ gegl_sampler_get_from_buffer (GeglSampler *const sampler,
       GeglRectangle fetch_rectangle;
 
       fetch_rectangle.x =
-        x - ( maximum_width_and_height - sampler->context_rect[0].width  ) / 8;
+        x - ( maximum_width_and_height - sampler->context_rect[0].width  ) >> 3;
       fetch_rectangle.y =
-        y - ( maximum_width_and_height - sampler->context_rect[0].height ) / 8;
+        y - ( maximum_width_and_height - sampler->context_rect[0].height ) >> 3;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
@@ -446,10 +446,10 @@ gegl_sampler_get_from_mipmap (GeglSampler *const sampler,
        */
       fetch_rectangle.x =
         x + sampler->context_rect[level].x
-        - ( maximum_width_and_height - sampler->context_rect[level].width  ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[level].width  ) >> 3;
       fetch_rectangle.y =
         y + sampler->context_rect[level].y
-        - ( maximum_width_and_height - sampler->context_rect[level].height ) / 8;
+        - ( maximum_width_and_height - sampler->context_rect[level].height ) >> 3;
 
       fetch_rectangle.width  = maximum_width_and_height;
       fetch_rectangle.height = maximum_width_and_height;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]