diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-28 10:56:35 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-04-28 11:16:58 (GMT) |
commit | af9d20680c91f587f4791aa68f3a8b03d3a42be0 (patch) | |
tree | 427dff65738b96b08839d6c2cd65feea64ae7f52 /src/gui/painting | |
parent | ee9455ed2a83084692d969c398ecb91bcd4fc33a (diff) | |
download | Qt-af9d20680c91f587f4791aa68f3a8b03d3a42be0.zip Qt-af9d20680c91f587f4791aa68f3a8b03d3a42be0.tar.gz Qt-af9d20680c91f587f4791aa68f3a8b03d3a42be0.tar.bz2 |
Fixed off-by-one in radial gradient color table index computation.
Clamp to GRADIENT_COLOR_TABLE-1, not GRADIENT_COLOR_TABLE-2. Fixes
visible error in gradients.qps
Reviewed-by: Kim Motoyoshi Kalland <kim.kalland@nokia.com>
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h index e93d736..fa6ad0b 100644 --- a/src/gui/painting/qdrawhelper_p.h +++ b/src/gui/painting/qdrawhelper_p.h @@ -507,11 +507,9 @@ public: const typename Simd::Float32x4 v_dr = Simd::v_dup(op->radial.dr); const typename Simd::Float32x4 v_min = Simd::v_dup(0.0f); - const typename Simd::Float32x4 v_max = Simd::v_dup(GRADIENT_STOPTABLE_SIZE-1.5f); + const typename Simd::Float32x4 v_max = Simd::v_dup(float(GRADIENT_STOPTABLE_SIZE-1)); const typename Simd::Float32x4 v_half = Simd::v_dup(0.5f); - const typename Simd::Float32x4 v_table_size_minus_one = Simd::v_dup(float(GRADIENT_STOPTABLE_SIZE-1)); - const typename Simd::Int32x4 v_repeat_mask = Simd::v_dup(~(uint(0xffffff) << GRADIENT_STOPTABLE_SIZE_SHIFT)); const typename Simd::Int32x4 v_reflect_mask = Simd::v_dup(~(uint(0xffffff) << (GRADIENT_STOPTABLE_SIZE_SHIFT+1))); @@ -524,7 +522,7 @@ public: typename Simd::Vect_buffer_i v_buffer_mask; \ v_buffer_mask.v = Simd::v_greaterOrEqual(det_vec.v, v_min); \ const typename Simd::Float32x4 v_index_local = Simd::v_sub(Simd::v_sqrt(Simd::v_max(v_min, det_vec.v)), b_vec.v); \ - const typename Simd::Float32x4 v_index = Simd::v_add(Simd::v_mul(v_index_local, v_table_size_minus_one), v_half); \ + const typename Simd::Float32x4 v_index = Simd::v_add(Simd::v_mul(v_index_local, v_max), v_half); \ v_buffer_mask.v = Simd::v_and(v_buffer_mask.v, Simd::v_greaterOrEqual(Simd::v_add(v_r0, Simd::v_mul(v_dr, v_index_local)), v_min)); \ typename Simd::Vect_buffer_i index_vec; #define FETCH_RADIAL_LOOP_CLAMP_REPEAT \ |