aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--samplecode/SampleClip.cpp7
-rw-r--r--src/effects/gradients/Sk4fLinearGradient.cpp6
-rw-r--r--tests/Float16Test.cpp4
3 files changed, 10 insertions, 7 deletions
diff --git a/samplecode/SampleClip.cpp b/samplecode/SampleClip.cpp
index 06bd717ece..984a6e5ba5 100644
--- a/samplecode/SampleClip.cpp
+++ b/samplecode/SampleClip.cpp
@@ -6,6 +6,7 @@
*/
#include "SampleCode.h"
+#include "SkAAClip.h"
#include "SkView.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
@@ -13,8 +14,8 @@
#include "SkPath.h"
#include "SkRandom.h"
-#define W 150
-#define H 200
+constexpr int W = 150;
+constexpr int H = 200;
static void show_text(SkCanvas* canvas, bool doAA) {
SkRandom rand;
@@ -101,8 +102,6 @@ static void show_thick(SkCanvas* canvas, bool doAA) {
typedef void (*CanvasProc)(SkCanvas*, bool);
-#include "SkAAClip.h"
-
class ClipView : public SampleView {
public:
ClipView() {
diff --git a/src/effects/gradients/Sk4fLinearGradient.cpp b/src/effects/gradients/Sk4fLinearGradient.cpp
index 3aebdfa49d..29d9088425 100644
--- a/src/effects/gradients/Sk4fLinearGradient.cpp
+++ b/src/effects/gradients/Sk4fLinearGradient.cpp
@@ -9,6 +9,8 @@
#include "Sk4x4f.h"
#include "SkXfermode.h"
+#include <cmath>
+
namespace {
template<DstType dstType, ApplyPremul premul>
@@ -117,7 +119,7 @@ LinearGradient4fContext::LinearGradient4fContext(const SkLinearGradient& shader,
: INHERITED(shader, rec) {
// Our fast path expects interval points to be monotonically increasing in x.
- const bool reverseIntervals = this->isFast() && signbit(fDstToPos.getScaleX());
+ const bool reverseIntervals = this->isFast() && std::signbit(fDstToPos.getScaleX());
this->buildIntervals(shader, rec, reverseIntervals);
SkASSERT(fIntervals.count() > 0);
@@ -315,7 +317,7 @@ public:
SkScalar currentAdvance() const {
SkASSERT(fAdvX >= 0);
- SkASSERT(fAdvX <= (fInterval->fP1 - fInterval->fP0) / fDx || !isfinite(fAdvX));
+ SkASSERT(fAdvX <= (fInterval->fP1 - fInterval->fP0) / fDx || !std::isfinite(fAdvX));
return fAdvX;
}
diff --git a/tests/Float16Test.cpp b/tests/Float16Test.cpp
index 99835686fa..64873c3fc8 100644
--- a/tests/Float16Test.cpp
+++ b/tests/Float16Test.cpp
@@ -14,6 +14,8 @@
#include "SkPM4f.h"
#include "SkRandom.h"
+#include <cmath>
+
static bool eq_within_half_float(float a, float b) {
const float kTolerance = 1.0f / (1 << (8 + 10));
@@ -100,7 +102,7 @@ DEF_TEST(SkFloatToHalf_finite_ftz, r) {
uint16_t alternate = expected;
if (is_denorm(expected)) {
// _finite_ftz() may flush denorms to zero, and happens to keep the sign bit.
- alternate = signbit(f) ? 0x8000 : 0x0000;
+ alternate = std::signbit(f) ? 0x8000 : 0x0000;
}
uint16_t actual = SkFloatToHalf_finite_ftz(Sk4f{f})[0];