@@ -114,7 +114,7 @@ void BM_DrawLine(benchmark::State& state,
114114 auto display_list = builder.Build ();
115115
116116 // We only want to time the actual rasterization.
117- for (auto _ : state) {
117+ for ([[maybe_unused]] auto _ : state) {
118118 display_list->RenderTo (canvas);
119119 canvas_provider->GetSurface ()->flushAndSubmit (true );
120120 }
@@ -162,7 +162,7 @@ void BM_DrawRect(benchmark::State& state,
162162 auto display_list = builder.Build ();
163163
164164 // We only want to time the actual rasterization.
165- for (auto _ : state) {
165+ for ([[maybe_unused]] auto _ : state) {
166166 display_list->RenderTo (canvas);
167167 canvas_provider->GetSurface ()->flushAndSubmit (true );
168168 }
@@ -207,7 +207,7 @@ void BM_DrawOval(benchmark::State& state,
207207 auto display_list = builder.Build ();
208208
209209 // We only want to time the actual rasterization.
210- for (auto _ : state) {
210+ for ([[maybe_unused]] auto _ : state) {
211211 display_list->RenderTo (canvas);
212212 canvas_provider->GetSurface ()->flushAndSubmit (true );
213213 }
@@ -254,7 +254,7 @@ void BM_DrawCircle(benchmark::State& state,
254254 auto display_list = builder.Build ();
255255
256256 // We only want to time the actual rasterization.
257- for (auto _ : state) {
257+ for ([[maybe_unused]] auto _ : state) {
258258 display_list->RenderTo (canvas);
259259 canvas_provider->GetSurface ()->flushAndSubmit (true );
260260 }
@@ -331,7 +331,7 @@ void BM_DrawRRect(benchmark::State& state,
331331 auto display_list = builder.Build ();
332332
333333 // We only want to time the actual rasterization.
334- for (auto _ : state) {
334+ for ([[maybe_unused]] auto _ : state) {
335335 display_list->RenderTo (canvas);
336336 canvas_provider->GetSurface ()->flushAndSubmit (true );
337337 }
@@ -412,7 +412,7 @@ void BM_DrawDRRect(benchmark::State& state,
412412 auto display_list = builder.Build ();
413413
414414 // We only want to time the actual rasterization.
415- for (auto _ : state) {
415+ for ([[maybe_unused]] auto _ : state) {
416416 display_list->RenderTo (canvas);
417417 canvas_provider->GetSurface ()->flushAndSubmit (true );
418418 }
@@ -464,7 +464,7 @@ void BM_DrawArc(benchmark::State& state,
464464 auto display_list = builder.Build ();
465465
466466 // We only want to time the actual rasterization.
467- for (auto _ : state) {
467+ for ([[maybe_unused]] auto _ : state) {
468468 display_list->RenderTo (canvas);
469469 canvas_provider->GetSurface ()->flushAndSubmit (true );
470470 }
@@ -482,7 +482,7 @@ std::vector<SkPoint> GetPolygonPoints(size_t n, SkPoint center, SkScalar r) {
482482 float angle;
483483 float full_circle = 2 .0f * M_PI;
484484 for (size_t i = 0 ; i < n; i++) {
485- angle = (full_circle / ( float )n) * ( float )i ;
485+ angle = (full_circle / static_cast < float >(n)) * static_cast < float >(i) ;
486486 x = center.x () + r * std::cosf (angle);
487487 y = center.y () + r * std::sinf (angle);
488488 points.push_back (SkPoint::Make (x, y));
@@ -666,7 +666,7 @@ void BM_DrawPath(benchmark::State& state,
666666 auto display_list = builder.Build ();
667667
668668 // We only want to time the actual rasterization.
669- for (auto _ : state) {
669+ for ([[maybe_unused]] auto _ : state) {
670670 display_list->RenderTo (canvas);
671671 canvas_provider->GetSurface ()->flushAndSubmit (true );
672672 }
@@ -709,12 +709,13 @@ sk_sp<SkVertices> GetTestVertices(SkPoint center,
709709 colors.push_back (SK_ColorCYAN);
710710 for (size_t i = 0 ; i <= outer_points.size (); i++) {
711711 vertices.push_back (outer_points[i % outer_points.size ()]);
712- if (i % 3 == 0 )
712+ if (i % 3 == 0 ) {
713713 colors.push_back (SK_ColorRED);
714- else if (i % 3 == 1 )
714+ } else if (i % 3 == 1 ) {
715715 colors.push_back (SK_ColorGREEN);
716- else
716+ } else {
717717 colors.push_back (SK_ColorBLUE);
718+ }
718719 }
719720 break ;
720721 case SkVertices::VertexMode::kTriangles_VertexMode :
@@ -810,7 +811,7 @@ void BM_DrawVertices(benchmark::State& state,
810811 auto display_list = builder.Build ();
811812
812813 // We only want to time the actual rasterization.
813- for (auto _ : state) {
814+ for ([[maybe_unused]] auto _ : state) {
814815 display_list->RenderTo (canvas);
815816 canvas_provider->GetSurface ()->flushAndSubmit (true );
816817 }
@@ -913,7 +914,7 @@ void BM_DrawPoints(benchmark::State& state,
913914
914915 auto display_list = builder.Build ();
915916
916- for (auto _ : state) {
917+ for ([[maybe_unused]] auto _ : state) {
917918 display_list->RenderTo (canvas);
918919 canvas_provider->GetSurface ()->flushAndSubmit (true );
919920 }
@@ -987,7 +988,7 @@ void BM_DrawImage(benchmark::State& state,
987988
988989 auto display_list = builder.Build ();
989990
990- for (auto _ : state) {
991+ for ([[maybe_unused]] auto _ : state) {
991992 display_list->RenderTo (canvas);
992993 canvas_provider->GetSurface ()->flushAndSubmit (true );
993994 }
@@ -1069,7 +1070,7 @@ void BM_DrawImageRect(benchmark::State& state,
10691070
10701071 auto display_list = builder.Build ();
10711072
1072- for (auto _ : state) {
1073+ for ([[maybe_unused]] auto _ : state) {
10731074 display_list->RenderTo (canvas);
10741075 canvas_provider->GetSurface ()->flushAndSubmit (true );
10751076 }
@@ -1153,7 +1154,7 @@ void BM_DrawImageNine(benchmark::State& state,
11531154
11541155 auto display_list = builder.Build ();
11551156
1156- for (auto _ : state) {
1157+ for ([[maybe_unused]] auto _ : state) {
11571158 display_list->RenderTo (canvas);
11581159 canvas_provider->GetSurface ()->flushAndSubmit (true );
11591160 }
@@ -1226,7 +1227,7 @@ void BM_DrawTextBlob(benchmark::State& state,
12261227
12271228 auto display_list = builder.Build ();
12281229
1229- for (auto _ : state) {
1230+ for ([[maybe_unused]] auto _ : state) {
12301231 display_list->RenderTo (canvas);
12311232 canvas_provider->GetSurface ()->flushAndSubmit (true );
12321233 }
@@ -1290,7 +1291,7 @@ void BM_DrawShadow(benchmark::State& state,
12901291 auto display_list = builder.Build ();
12911292
12921293 // We only want to time the actual rasterization.
1293- for (auto _ : state) {
1294+ for ([[maybe_unused]] auto _ : state) {
12941295 display_list->RenderTo (canvas);
12951296 canvas_provider->GetSurface ()->flushAndSubmit (true );
12961297 }
@@ -1343,7 +1344,7 @@ void BM_SaveLayer(benchmark::State& state,
13431344 auto display_list = builder.Build ();
13441345
13451346 // We only want to time the actual rasterization.
1346- for (auto _ : state) {
1347+ for ([[maybe_unused]] auto _ : state) {
13471348 display_list->RenderTo (canvas);
13481349 canvas_provider->GetSurface ()->flushAndSubmit (true );
13491350 }
0 commit comments