aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--samplecode/SampleAnimBlur.cpp2
-rw-r--r--samplecode/SampleEffects.cpp9
-rw-r--r--samplecode/SampleFontScalerTest.cpp9
-rw-r--r--src/core/SkCanvas.cpp2
-rw-r--r--src/gpu/GrAAHairLinePathRenderer.cpp6
-rw-r--r--src/gpu/GrDrawState.h1
-rw-r--r--src/gpu/GrTesselatedPathRenderer.cpp8
7 files changed, 24 insertions, 13 deletions
diff --git a/samplecode/SampleAnimBlur.cpp b/samplecode/SampleAnimBlur.cpp
index 7f077e63e7..cada0cda77 100644
--- a/samplecode/SampleAnimBlur.cpp
+++ b/samplecode/SampleAnimBlur.cpp
@@ -45,7 +45,7 @@ protected:
};
SkRandom random;
- for (int i = 0; i < SK_ARRAY_COUNT(gStyles); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(gStyles); ++i) {
SkMaskFilter* mf = SkBlurMaskFilter::Create(blurRadius,
gStyles[i],
SkBlurMaskFilter::kHighQuality_BlurFlag);
diff --git a/samplecode/SampleEffects.cpp b/samplecode/SampleEffects.cpp
index bf83bae97e..9aab94af7e 100644
--- a/samplecode/SampleEffects.cpp
+++ b/samplecode/SampleEffects.cpp
@@ -19,10 +19,11 @@
static void test_edgeclipper() {
SkPoint pts[] = {
- { -8.38822452e+21f, -7.69721471e+19f },
- { 1.57645875e+23f, 1.44634003e+21f },
- { 1.61519691e+23f, 1.48208059e+21f },
- { 3.13963584e+23f, 2.88057438e+21f }
+ { SkFloatToScalar(-8.38822452e+21f),
+ SkFloatToScalar(-7.69721471e+19f) },
+ { SkFloatToScalar(1.57645875e+23f), SkFloatToScalar(1.44634003e+21f) },
+ { SkFloatToScalar(1.61519691e+23f), SkFloatToScalar(1.48208059e+21f) },
+ { SkFloatToScalar(3.13963584e+23f), SkFloatToScalar(2.88057438e+21f) }
};
SkRect clip = { 0, 0, 300, 200 };
diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp
index 83f962ecac..e6321deb3c 100644
--- a/samplecode/SampleFontScalerTest.cpp
+++ b/samplecode/SampleFontScalerTest.cpp
@@ -77,9 +77,12 @@ protected:
if (false) {
SkPoint pts[4];
pts[0].set(1.61061274e+09f, 6291456);
- pts[1].set(-7.18397061e+15f, -1.53091184e+13f);
- pts[2].set(-1.30077315e+16f, -2.77196141e+13f);
- pts[3].set(-1.30077315e+16f, -2.77196162e+13f);
+ pts[1].set(SkFloatToScalar(-7.18397061e+15f),
+ SkFloatToScalar(-1.53091184e+13f));
+ pts[2].set(SkFloatToScalar(-1.30077315e+16f),
+ SkFloatToScalar(-2.77196141e+13f));
+ pts[3].set(SkFloatToScalar(-1.30077315e+16f),
+ SkFloatToScalar(-2.77196162e+13f));
SkPath path;
path.moveTo(pts[0]);
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index fc308d4058..af55958361 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -1214,7 +1214,7 @@ void SkCanvas::replayClips(ClipVisitor* visitor) const {
SkClipStack::B2FIter iter(fClipStack);
const SkClipStack::B2FIter::Clip* clip;
- SkRect empty = {};
+ SkRect empty = { 0, 0, 0, 0 };
while ((clip = iter.next()) != NULL) {
if (clip->fPath) {
visitor->clipPath(*clip->fPath, clip->fOp, clip->fDoAA);
diff --git a/src/gpu/GrAAHairLinePathRenderer.cpp b/src/gpu/GrAAHairLinePathRenderer.cpp
index 66dbe8c870..701bf3a08d 100644
--- a/src/gpu/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/GrAAHairLinePathRenderer.cpp
@@ -164,7 +164,7 @@ int num_quad_subdivs(const SkPoint p[3]) {
// maybe different when do this using gpu (geo or tess shaders)
static const SkScalar gSubdivTol = 175 * SK_Scalar1;
- if (dsqd <= gSubdivTol*gSubdivTol) {
+ if (dsqd <= SkScalarMul(gSubdivTol, gSubdivTol)) {
return 0;
} else {
// subdividing the quad reduces d by 4. so we want x = log4(d/tol)
@@ -177,7 +177,9 @@ int num_quad_subdivs(const SkPoint p[3]) {
log = GrMin(GrMax(0, log), kMaxSub);
return log;
#else
- SkScalar log = SkScalarLog(SkScalarDiv(dsqd,gSubdivTol*gSubdivTol));
+ SkScalar log = SkScalarLog(
+ SkScalarDiv(dsqd,
+ SkScalarMul(gSubdivTol, gSubdivTol)));
static const SkScalar conv = SkScalarInvert(SkScalarLog(2));
log = SkScalarMul(log, conv);
return GrMin(GrMax(0, SkScalarCeilToInt(log)),kMaxSub);
diff --git a/src/gpu/GrDrawState.h b/src/gpu/GrDrawState.h
index 12c8861104..e5c30b6086 100644
--- a/src/gpu/GrDrawState.h
+++ b/src/gpu/GrDrawState.h
@@ -460,6 +460,7 @@ public:
AutoRenderTargetRestore() : fDrawState(NULL), fSavedTarget(NULL) {}
AutoRenderTargetRestore(GrDrawState* ds, GrRenderTarget* newTarget) {
fDrawState = NULL;
+ fSavedTarget = NULL;
this->set(ds, newTarget);
}
~AutoRenderTargetRestore() { this->set(NULL, NULL); }
diff --git a/src/gpu/GrTesselatedPathRenderer.cpp b/src/gpu/GrTesselatedPathRenderer.cpp
index 23074d908e..5920ae143b 100644
--- a/src/gpu/GrTesselatedPathRenderer.cpp
+++ b/src/gpu/GrTesselatedPathRenderer.cpp
@@ -43,8 +43,12 @@ static inline GrDrawState::Edge computeEdge(const GrPoint& p,
static inline GrPoint sanitizePoint(const GrPoint& pt) {
GrPoint r;
- r.fX = SkScalarPin(pt.fX, -kMaxVertexValue, kMaxVertexValue);
- r.fY = SkScalarPin(pt.fY, -kMaxVertexValue, kMaxVertexValue);
+ r.fX = SkScalarPin(pt.fX,
+ SkFloatToScalar(-kMaxVertexValue),
+ SkFloatToScalar(kMaxVertexValue));
+ r.fY = SkScalarPin(pt.fY,
+ SkFloatToScalar(-kMaxVertexValue),
+ SkFloatToScalar(kMaxVertexValue));
return r;
}