Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions
RepeatTileBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColorPriv.h"
#include "include/core/SkPaint.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/core/SkTileMode.h"
#include "tools/ToolUtils.h"

Go to the source code of this file.

Classes

class  RepeatTileBench
 

Functions

static void draw_into_bitmap (const SkBitmap &bm)
 

Function Documentation

◆ draw_into_bitmap()

static void draw_into_bitmap ( const SkBitmap bm)
static

Definition at line 17 of file RepeatTileBench.cpp.

17 {
18 const int w = bm.width();
19 const int h = bm.height();
20
21 SkCanvas canvas(bm);
22 SkPaint p;
23 p.setAntiAlias(true);
24 p.setColor(SK_ColorRED);
25 canvas.drawCircle(SkIntToScalar(w)/2, SkIntToScalar(h)/2,
26 SkIntToScalar(std::min(w, h))*3/8, p);
27
28 SkRect r;
30 p.setStyle(SkPaint::kStroke_Style);
31 p.setStrokeWidth(SkIntToScalar(4));
32 p.setColor(SK_ColorBLUE);
33 canvas.drawRect(r, p);
34}
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
#define SkIntToScalar(x)
Definition SkScalar.h:57
int width() const
Definition SkBitmap.h:149
int height() const
Definition SkBitmap.h:158
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
SkScalar w
SkScalar h
void setWH(float width, float height)
Definition SkRect.h:944