SkCanvas* rec = pict.beginRecording(100, offset + extents);
rec->drawColor(0xffff0000);
rec->save();
- SkRect r = {-extents, offset - extents, extents, offset + extents};
+ SkRect r = {
+ SkIntToScalar(-extents),
+ SkIntToScalar(offset - extents),
+ SkIntToScalar(extents),
+ SkIntToScalar(offset + extents)
+ };
SkPath p;
p.addRoundRect(r, 5, 5);
rec->clipPath(p, SkRegion::kIntersect_Op, true);
// Finally we play the part of that second picture that should be green into the canvas.
canvas->save();
- canvas->translate(extents / 2, -(offset - extents / 2));
+ canvas->translate(SkIntToScalar(extents / 2),
+ SkIntToScalar(-(offset - extents / 2)));
pict2.draw(canvas);
canvas->restore();
virtual SkISize onISize() { return make_isize(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
-
paint.setStyle(SkPaint::kFill_Style);
canvas->drawText("Normal Fill Text", 16, 0, 50, paint);
}
static void TestPath(skiatest::Reporter* reporter) {
- {
- SkSize size;
- size.fWidth = 3.4f;
- size.width();
- size = SkSize::Make(3,4);
- SkISize isize = SkISize::Make(3,4);
- }
-
SkTSize<SkScalar>::Make(3,4);
SkPath p, p2;