@@ -27,26 +27,12 @@ class SkRegionAdapter {
27
27
SkRegion region_;
28
28
};
29
29
30
- class DlRegion2Adapter {
30
+ class DlRegionAdapter {
31
31
public:
32
32
void addRect (const SkIRect& rect) { rects_.push_back (rect); }
33
33
34
34
std::vector<SkIRect> getRects () {
35
- flutter::DlRegion2 region;
36
- region.addRects (std::move (rects_));
37
- return region.getRects (false );
38
- }
39
-
40
- private:
41
- std::vector<SkIRect> rects_;
42
- };
43
-
44
- class DlRegionSortedAdapter {
45
- public:
46
- void addRect (const SkIRect& rect) { rects_.push_back (rect); }
47
-
48
- std::vector<SkIRect> getRects () {
49
- flutter::DlRegionSorted region;
35
+ flutter::DlRegion region;
50
36
region.addRects (std::move (rects_));
51
37
return region.getRects (false );
52
38
}
@@ -84,51 +70,23 @@ static void BM_RegionBenchmarkSkRegion(benchmark::State& state, int maxSize) {
84
70
}
85
71
86
72
static void BM_RegionBenchmarkDlRegion (benchmark::State& state, int maxSize) {
87
- RunRegionBenchmark<DlRegion>(state, maxSize);
88
- }
89
-
90
- static void BM_RegionBenchmarkDlRegionSorted (benchmark::State& state,
91
- int maxSize) {
92
- RunRegionBenchmark<DlRegionSortedAdapter>(state, maxSize);
93
- }
94
-
95
- static void BM_RegionBenchmarkDlRegion2 (benchmark::State& state, int maxSize) {
96
- RunRegionBenchmark<DlRegion2Adapter>(state, maxSize);
73
+ RunRegionBenchmark<DlRegionAdapter>(state, maxSize);
97
74
}
98
75
99
76
BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion, Tiny, 30 )
100
77
->Unit (benchmark::kMicrosecond );
101
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion2, Tiny, 30 )
102
- ->Unit (benchmark::kMicrosecond );
103
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegionSorted, Tiny, 30 )
104
- ->Unit (benchmark::kMicrosecond );
105
78
BENCHMARK_CAPTURE (BM_RegionBenchmarkSkRegion, Tiny, 30 )
106
79
->Unit (benchmark::kMicrosecond );
107
-
108
80
BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion, Small, 100 )
109
81
->Unit (benchmark::kMicrosecond );
110
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion2, Small, 100 )
111
- ->Unit (benchmark::kMicrosecond );
112
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegionSorted, Small, 100 )
113
- ->Unit (benchmark::kMicrosecond );
114
82
BENCHMARK_CAPTURE (BM_RegionBenchmarkSkRegion, Small, 100 )
115
83
->Unit (benchmark::kMicrosecond );
116
-
117
84
BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion, Medium, 400 )
118
85
->Unit (benchmark::kMicrosecond );
119
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion2, Medium, 400 )
120
- ->Unit (benchmark::kMicrosecond );
121
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegionSorted, Medium, 400 )
122
- ->Unit (benchmark::kMicrosecond );
123
86
BENCHMARK_CAPTURE (BM_RegionBenchmarkSkRegion, Medium, 400 )
124
87
->Unit (benchmark::kMicrosecond );
125
-
126
88
BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion, Large, 1500 )
127
89
->Unit (benchmark::kMicrosecond );
128
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegion2, Large, 1500 )
129
- ->Unit (benchmark::kMicrosecond );
130
- BENCHMARK_CAPTURE (BM_RegionBenchmarkDlRegionSorted, Large, 1500 )
131
- ->Unit (benchmark::kMicrosecond );
132
90
BENCHMARK_CAPTURE (BM_RegionBenchmarkSkRegion, Large, 1500 )
133
91
->Unit (benchmark::kMicrosecond );
134
92
0 commit comments