Fix up arguments passed to pipeline.
authorMike Klein <mtklein@chromium.org>
Tue, 15 Nov 2016 15:31:38 +0000 (10:31 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Tue, 15 Nov 2016 17:57:33 +0000 (17:57 +0000)
  - Add half to (x,y) to get pixel centers.
  - The x updates were just totally wrong...

BUG=skia:

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4794
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Change-Id: I314489a74b54e2b88f12dd35896452ac0b9718f3
Reviewed-on: https://skia-review.googlesource.com/4794
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>

src/opts/SkRasterPipeline_opts.h

index dbdd00d498da3182d66b68c2eae2457c923a7da2..1ca43225a328ea10d47899849043f666e34a87eb 100644 (file)
@@ -683,13 +683,12 @@ namespace SK_OPTS_NS {
                 SkNf v;  // Fastest to start uninitialized.
 
                 float dx[] = { 0,1,2,3,4,5,6,7 };
-                SkNf X = SkNf(x),
-                     Y = SkNf(y),
-                     DX = SkNf::Load(dx);
+                SkNf X = SkNf(x) + SkNf::Load(dx) + 0.5f,
+                     Y = SkNf(y) + 0.5f;
 
                 while (n >= N) {
                     fBodyStart(fBody, x, v,v,v,v, X,Y,v,v);
-                    X += DX;
+                    X += (float)N;
                     x += N;
                     n -= N;
                 }