public:
InterpBench(void* param, const char name[]) : INHERITED(param) {
fName.printf("interp_%s", name);
- fFx = 3.3;
- fDx = 0.1257;
+ fFx = 3.3f;
+ fDx = 0.1257f;
}
virtual void performTest(int16_t dst[], float x, float dx, int count) = 0;
#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkPaint.h"
-#include "SkRefCnt.h"
#include "SkSize.h"
#include "SkString.h"
#include "SkTRegistry.h"
#include "gl/SkDebugGLContext.h"
#include "SkPicture.h"
#include "SkStream.h"
-#include "SkRefCnt.h"
static bool gForceBWtext;
center.set(SkIntToScalar(dim.width())/2, SkIntToScalar(dim.height())/2);
SkScalar radius = SkIntToScalar(dim.width())/2;
const SkColor colors[] = { 0x7f7f7f7f, 0x7f7f7f7f, 0xb2000000 };
- const SkScalar pos[] = { SkFloatToScalar(0.0),
- SkFloatToScalar(0.35),
- SkFloatToScalar(1.0) };
+ const SkScalar pos[] = { SkFloatToScalar(0.0f),
+ SkFloatToScalar(0.35f),
+ SkFloatToScalar(1.0f) };
SkShader* shader =
SkGradientShader::CreateRadial(center, radius, colors,
pos, SK_ARRAY_COUNT(pos),
* @param height height of rectangle to write in pixels.
* @param config the pixel config of the source buffer
* @param buffer memory to read pixels from
- * @param rowBytes number of bytes bewtween consecutive rows. Zero
+ * @param rowBytes number of bytes between consecutive rows. Zero
* means rows are tightly packed.
*/
void writePixels(int left, int top, int width, int height,
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(SkIntToScalar(50 + i * 230),
SkIntToScalar(20));
- rotate_about(canvas, i * 5, x, y * 10);
+ rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
{
SkPaint p;
fEnd[kPrevX] = -lr;
fEnd[kPrevY] = -ud;
fEnd[kNextX] = fEnd[kNextY] = 0;
- SkScalar blend[] = {0.8, 0.0, 0.0, 1.0};
+ SkScalar blend[] = {0.8f, 0.0f, 0.0f, 1.0f};
fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend);
fInterp.setKeyFrame(1, SkTime::GetMSecs()+500, fEnd, blend);
}
#include "SkDeviceProfile.h"
-#define DEFAULT_GAMMAEXP 2.2
-#define DEFAULT_CONTRASTSCALE 0.5
+#define DEFAULT_GAMMAEXP 2.2f
+#define DEFAULT_CONTRASTSCALE 0.5f
#define DEFAULT_LCDCONFIG SkDeviceProfile::kNone_LCDConfig
#define DEFAULT_FONTHINTLEVEL SkDeviceProfile::kSlight_FontHintLevel
// Test precision of rotation in common cases
int common_angles[] = { 0, 90, -90, 180, -180, 270, -270, 360, -360 };
for (int i = 0; i < 9; ++i) {
- rot.setRotateDegreesAbout(0, 0, -1, common_angles[i]);
+ rot.setRotateDegreesAbout(0, 0, -1, SkIntToScalar(common_angles[i]));
SkMatrix rot3x3 = rot;
REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
static void check_close(skiatest::Reporter* reporter, const SkPath& path) {
for (int i = 0; i < 2; ++i) {
- SkPath::Iter iter(path, (bool)i);
+ SkPath::Iter iter(path, SkToBool(i));
SkPoint mv;
SkPoint pts[4];
SkPath::Verb v;
do {
nextVerb = static_cast<SkPath::Verb>((rand.nextU() >> 16) % SkPath::kDone_Verb);
} while (lastWasClose && nextVerb == SkPath::kClose_Verb);
- int numRequiredPts;
switch (nextVerb) {
case SkPath::kMove_Verb:
expectedPts[numPoints] = randomPts[(rand.nextU() >> 16) % 25];