Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Macros | Functions
RegionBench.cpp File Reference
#include "bench/Benchmark.h"
#include "include/core/SkRegion.h"
#include "include/core/SkString.h"
#include "src/base/SkRandom.h"

Go to the source code of this file.

Classes

class  RegionBench
 

Macros

#define SMALL   16
 

Functions

static bool union_proc (SkRegion &a, SkRegion &b)
 
static bool sect_proc (SkRegion &a, SkRegion &b)
 
static bool diff_proc (SkRegion &a, SkRegion &b)
 
static bool diffrect_proc (SkRegion &a, SkRegion &b)
 
static bool diffrectbig_proc (SkRegion &a, SkRegion &b)
 
static bool containsrect_proc (SkRegion &a, SkRegion &b)
 
static bool sectsrgn_proc (SkRegion &a, SkRegion &b)
 
static bool sectsrect_proc (SkRegion &a, SkRegion &b)
 
static bool containsxy_proc (SkRegion &a, SkRegion &b)
 

Macro Definition Documentation

◆ SMALL

#define SMALL   16

Definition at line 121 of file RegionBench.cpp.

Function Documentation

◆ containsrect_proc()

static bool containsrect_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 37 of file RegionBench.cpp.

37 {
38 SkIRect r = a.getBounds();
39 r.inset(r.width()/4, r.height()/4);
40 (void)a.contains(r);
41
42 r = b.getBounds();
43 r.inset(r.width()/4, r.height()/4);
44 return b.contains(r);
45}
static bool b
struct MyStruct a[10]
void inset(int32_t dx, int32_t dy)
Definition SkRect.h:411
constexpr int32_t height() const
Definition SkRect.h:165
constexpr int32_t width() const
Definition SkRect.h:158

◆ containsxy_proc()

static bool containsxy_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 57 of file RegionBench.cpp.

57 {
58 const SkIRect& r = a.getBounds();
59 const int dx = r.width() / 8;
60 const int dy = r.height() / 8;
61 for (int y = r.fTop; y < r.fBottom; y += dy) {
62 for (int x = r.fLeft; x < r.fRight; x += dx) {
63 (void)a.contains(x, y);
64 }
65 }
66 return true;
67}
double y
double x
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition SkRecords.h:208
int32_t fBottom
larger y-axis bounds
Definition SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition SkRect.h:34
int32_t fLeft
smaller x-axis bounds
Definition SkRect.h:33
int32_t fRight
larger x-axis bounds
Definition SkRect.h:35

◆ diff_proc()

static bool diff_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 22 of file RegionBench.cpp.

22 {
25}
@ kDifference_Op
target minus operand
Definition SkRegion.h:367
bool op(const SkIRect &rect, Op op)
Definition SkRegion.h:384
GAsyncResult * result

◆ diffrect_proc()

static bool diffrect_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 27 of file RegionBench.cpp.

27 {
29 return result.op(a, b.getBounds(), SkRegion::kDifference_Op);
30}

◆ diffrectbig_proc()

static bool diffrectbig_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 32 of file RegionBench.cpp.

32 {
34 return result.op(a, a.getBounds(), SkRegion::kDifference_Op);
35}

◆ sect_proc()

static bool sect_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 17 of file RegionBench.cpp.

17 {
20}
@ kIntersect_Op
target intersected with operand
Definition SkRegion.h:368

◆ sectsrect_proc()

static bool sectsrect_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 51 of file RegionBench.cpp.

51 {
52 SkIRect r = a.getBounds();
53 r.inset(r.width()/4, r.height()/4);
54 return a.intersects(r);
55}

◆ sectsrgn_proc()

static bool sectsrgn_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 47 of file RegionBench.cpp.

47 {
48 return a.intersects(b);
49}

◆ union_proc()

static bool union_proc ( SkRegion a,
SkRegion b 
)
static

Definition at line 12 of file RegionBench.cpp.

12 {
15}
@ kUnion_Op
target unioned with operand
Definition SkRegion.h:369