make point array methods private
Moved method are not used by chromium, google3,
or android.
SkPoint::setRectIFan isn't used or tested at all.
SkPoint::setRectFan and SkPoint::setRectTriStrip
are only used internally.
These routines pretend that a SkPoint is part
of an array of points. Since that's kind of an
odd contract to make public, and because they
aren't used outside of Skia, relegate them to
a priv file.
R=bsalomon@google.com,reed@google.com
Bug: skia: 6898
Change-Id: I5ec2eb47799f6fd4b2994da962b1fa69ce659931
Reviewed-on: https://skia-review.googlesource.com/68121
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 045f3fe..7316a79 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -19,6 +19,7 @@
#include "SkColorPriv.h"
#include "SkGeometry.h"
#include "SkPoint3.h"
+#include "SkPointPriv.h"
#include "effects/GrBezierEffect.h"
#include "ops/GrMeshDrawOp.h"
@@ -93,7 +94,7 @@
return;
}
SkRect rect = this->rect();
- pts[0].setRectTriStrip(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vertexStride);
+ SkPointPriv::SetRectTriStrip(pts, rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vertexStride);
helper.recordDraw(target, this->gp(), this->makePipeline(target));
}
@@ -268,8 +269,8 @@
return;
}
SkRect rect = this->rect();
- verts[0].fPosition.setRectTriStrip(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom,
- sizeof(Vertex));
+ SkPointPriv::SetRectTriStrip(&verts[0].fPosition, rect.fLeft, rect.fTop, rect.fRight,
+ rect.fBottom, sizeof(Vertex));
for (int v = 0; v < 4; ++v) {
SkPoint3 pt3 = {verts[v].fPosition.x(), verts[v].fPosition.y(), 1.f};
fKLM.mapHomogeneousPoints((SkPoint3* ) verts[v].fKLM, &pt3, 1);
@@ -482,8 +483,8 @@
return;
}
SkRect rect = this->rect();
- verts[0].fPosition.setRectTriStrip(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom,
- sizeof(Vertex));
+ SkPointPriv::SetRectTriStrip(&verts[0].fPosition, rect.fLeft, rect.fTop, rect.fRight,
+ rect.fBottom, sizeof(Vertex));
fDevToUV.apply<4, sizeof(Vertex), sizeof(SkPoint)>(verts);
helper.recordDraw(target, this->gp(), this->makePipeline(target));
}
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 16fad46..fc4b8c0 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -19,6 +19,7 @@
#include "GrTest.h"
#include "SkColorPriv.h"
#include "SkGeometry.h"
+#include "SkPointPriv.h"
#include "SkTLList.h"
#include "effects/GrConvexPolyEffect.h"
#include "ops/GrMeshDrawOp.h"
@@ -85,7 +86,7 @@
return;
}
- verts->setRectTriStrip(fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom,
+ SkPointPriv::SetRectTriStrip(verts, fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom,
sizeof(SkPoint));
helper.recordDraw(