aboutsummaryrefslogtreecommitdiffstats
path: root/samplecode/SampleQuadStroker.cpp
diff options
context:
space:
mode:
authorCary Clark <caryclark@skia.org>2017-11-08 11:44:31 -0500
committerRavi Mistry <rmistry@google.com>2017-11-08 18:25:17 +0000
commitdf429f3beac1c191289ba1e3bd918bf84df57bf5 (patch)
tree65f7f049b218ef8984d054524c05dd3fcea392a3 /samplecode/SampleQuadStroker.cpp
parent21ad53fd8839af82bcb11da6ab3e256ee7752f2b (diff)
downloadplatform_external_skqp-df429f3beac1c191289ba1e3bd918bf84df57bf5.tar.gz
platform_external_skqp-df429f3beac1c191289ba1e3bd918bf84df57bf5.tar.bz2
platform_external_skqp-df429f3beac1c191289ba1e3bd918bf84df57bf5.zip
move parts of SkPoint to SkPointPriv
Move specialized SkPoint methods to SkPointPriv. Use constexpr and inline initialization where possible. R=reed@google.com,bsalomon@google.com Bug: skia: 6898 Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338 Reviewed-on: https://skia-review.googlesource.com/68700 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
Diffstat (limited to 'samplecode/SampleQuadStroker.cpp')
-rw-r--r--samplecode/SampleQuadStroker.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/samplecode/SampleQuadStroker.cpp b/samplecode/SampleQuadStroker.cpp
index ea5f97fa2a..fa45d6eb0d 100644
--- a/samplecode/SampleQuadStroker.cpp
+++ b/samplecode/SampleQuadStroker.cpp
@@ -11,6 +11,7 @@
#include "SkCanvas.h"
#include "SkGeometry.h"
#include "SkPathMeasure.h"
+#include "SkPointPriv.h"
#include "SkRandom.h"
#include "SkRRect.h"
#include "SkColorPriv.h"
@@ -313,7 +314,7 @@ protected:
for (SkScalar dist = 0; dist <= total; dist += delta) {
if (meas.getPosTan(dist, &pos, &tan)) {
tan.scale(radius);
- tan.rotateCCW();
+ SkPointPriv::RotateCCW(&tan);
canvas->drawLine(pos.x() + tan.x(), pos.y() + tan.y(),
pos.x() - tan.x(), pos.y() - tan.y(), paint);
if (0 == index % 10) {
@@ -375,7 +376,7 @@ protected:
return;
}
tan.setLength(radius);
- tan.rotateCCW();
+ SkPointPriv::RotateCCW(&tan);
canvas->drawLine(pos.x() + tan.x(), pos.y() + tan.y(),
pos.x() - tan.x(), pos.y() - tan.y(), paint);
if (0 == index % 10) {
@@ -556,8 +557,8 @@ protected:
before.setLength(fRadius);
after.setLength(fRadius);
SkVector beforeCCW, afterCCW;
- before.rotateCCW(&beforeCCW);
- after.rotateCCW(&afterCCW);
+ SkPointPriv::RotateCCW(before, &beforeCCW);
+ SkPointPriv::RotateCCW(after, &afterCCW);
beforeCCW += pts[0];
afterCCW += pts[2];
*center = beforeCCW;
@@ -566,8 +567,8 @@ protected:
return true;
}
SkVector beforeCW, afterCW;
- before.rotateCW(&beforeCW);
- after.rotateCW(&afterCW);
+ SkPointPriv::RotateCW(before, &beforeCW);
+ SkPointPriv::RotateCW(after, &afterCW);
beforeCW += pts[0];
afterCW += pts[2];
*center = beforeCW;