Flutter Engine
The Flutter Engine
Canvas_drawPoint_2.cpp
Go to the documentation of this file.
1// Copyright 2019 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(Canvas_drawPoint_2, 256, 256, false, 0) {
5void draw(SkCanvas* canvas) {
7 paint.setAntiAlias(true);
8 paint.setColor(0x80349a45);
10 paint.setStrokeWidth(100);
11 paint.setStrokeCap(SkPaint::kSquare_Cap);
12 canvas->scale(1, 1.2f);
13 canvas->drawPoint({64, 96}, paint);
14 canvas->scale(.6f, .8f);
15 paint.setColor(SK_ColorWHITE);
16 canvas->drawPoint(106, 120, paint);
17}
18} // END FIDDLE
REG_FIDDLE(Canvas_drawPoint_2, 256, 256, false, 0)
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition: aaclip.cpp:27
void drawPoint(SkScalar x, SkScalar y, const SkPaint &paint)
Definition: SkCanvas.cpp:2695
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
@ kSquare_Cap
adds square
Definition: SkPaint.h:336
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
const Paint & paint
Definition: color_source.cc:38