diff options
author | halcanary <halcanary@google.com> | 2016-03-29 09:03:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-29 09:03:53 -0700 |
commit | 9d524f22bfde5dc3dc8f48e1be39bdebd3bb0304 (patch) | |
tree | fc75ea6f8bc83b552d9ac9c9b4ac0d5a967ee5ac /bench | |
parent | e577693b3be06d90c824538e7eac0b25b0e02a99 (diff) |
Style bikeshed - remove extraneous whitespace
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002
Review URL: https://codereview.chromium.org/1842753002
Diffstat (limited to 'bench')
35 files changed, 39 insertions, 69 deletions
diff --git a/bench/BigPathBench.cpp b/bench/BigPathBench.cpp index f39fd73693..a2f3ae0133 100644 --- a/bench/BigPathBench.cpp +++ b/bench/BigPathBench.cpp @@ -84,4 +84,3 @@ DEF_BENCH( return new BigPathBench(kRight_Align, false); ) DEF_BENCH( return new BigPathBench(kLeft_Align, true); ) DEF_BENCH( return new BigPathBench(kMiddle_Align, true); ) DEF_BENCH( return new BigPathBench(kRight_Align, true); ) - diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp index 7211ae256a..789a725e11 100644 --- a/bench/BitmapRectBench.cpp +++ b/bench/BitmapRectBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/BlurBench.cpp b/bench/BlurBench.cpp index 29f0dfd1f3..58f9e89ffa 100644 --- a/bench/BlurBench.cpp +++ b/bench/BlurBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/BlurImageFilterBench.cpp b/bench/BlurImageFilterBench.cpp index f0a7a8eea0..2407a44d14 100644 --- a/bench/BlurImageFilterBench.cpp +++ b/bench/BlurImageFilterBench.cpp @@ -23,7 +23,7 @@ #define BLUR_SIGMA_LARGE 10.0f #define BLUR_SIGMA_HUGE 80.0f - + // When 'cropped' is set we apply a cropRect to the blurImageFilter. The crop rect is an inset of // the source's natural dimensions. This is intended to exercise blurring a larger source bitmap // to a smaller destination bitmap. diff --git a/bench/BlurRectBench.cpp b/bench/BlurRectBench.cpp index 53cf2da1b5..774bafaf27 100644 --- a/bench/BlurRectBench.cpp +++ b/bench/BlurRectBench.cpp @@ -92,7 +92,7 @@ protected: SkMask mask; if (!SkBlurMask::BlurRect(SkBlurMask::ConvertRadiusToSigma(this->radius()), &mask, r, kNormal_SkBlurStyle)) { - return; + return; } SkMask::FreeImage(mask.fImage); } diff --git a/bench/DashBench.cpp b/bench/DashBench.cpp index 43db54c092..ba1d66a42e 100644 --- a/bench/DashBench.cpp +++ b/bench/DashBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/FSRectBench.cpp b/bench/FSRectBench.cpp index cd9a36bab9..2d5abc21cd 100644 --- a/bench/FSRectBench.cpp +++ b/bench/FSRectBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/GMBench.cpp b/bench/GMBench.cpp index 57f0d3c519..57b2316530 100644 --- a/bench/GMBench.cpp +++ b/bench/GMBench.cpp @@ -34,4 +34,3 @@ SkIPoint GMBench::onGetSize() { SkISize size = fGM->getISize(); return SkIPoint::Make(size.fWidth, size.fHeight); } - diff --git a/bench/GeometryBench.cpp b/bench/GeometryBench.cpp index d93578e45f..50985de764 100644 --- a/bench/GeometryBench.cpp +++ b/bench/GeometryBench.cpp @@ -97,7 +97,7 @@ protected: class GeoRectBench_Intersects : public GeoRectBench { public: GeoRectBench_Intersects() : GeoRectBench("rect_Intersects") {} - + protected: void onDraw(int loops, SkCanvas* canvas) override { for (int outer = 0; outer < loops; ++outer) { @@ -113,7 +113,7 @@ protected: class GeoRectBench_sort : public GeoRectBench { public: GeoRectBench_sort() : GeoRectBench("rect_sort") {} - + protected: void onDraw(int loops, SkCanvas* canvas) override { for (int outer = 0; outer < loops; ++outer) { @@ -243,4 +243,3 @@ protected: } }; DEF_BENCH( return new ChopCubicAt; ) - diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp index bc38035183..890bc96004 100644 --- a/bench/GrResourceCacheBench.cpp +++ b/bench/GrResourceCacheBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/GradientBench.cpp b/bench/GradientBench.cpp index 21ebdce7ab..1685c52089 100644 --- a/bench/GradientBench.cpp +++ b/bench/GradientBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/MatrixBench.cpp b/bench/MatrixBench.cpp index 5e62eac660..a185fec589 100644 --- a/bench/MatrixBench.cpp +++ b/bench/MatrixBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * @@ -298,4 +297,3 @@ DEF_BENCH( return new MapPointsMatrixBench("mappoints_identity", SkMatrix::I()); DEF_BENCH( return new MapPointsMatrixBench("mappoints_trans", make_trans()); ) DEF_BENCH( return new MapPointsMatrixBench("mappoints_scale", make_scale()); ) DEF_BENCH( return new MapPointsMatrixBench("mappoints_affine", make_afine()); ) - diff --git a/bench/MemoryBench.cpp b/bench/MemoryBench.cpp index cd9afe4634..b775793ead 100644 --- a/bench/MemoryBench.cpp +++ b/bench/MemoryBench.cpp @@ -55,4 +55,3 @@ private: DEF_BENCH( return new ChunkAllocBench(64); ) DEF_BENCH( return new ChunkAllocBench(8*1024); ) - diff --git a/bench/MutexBench.cpp b/bench/MutexBench.cpp index d1d014d939..27ebee5a77 100644 --- a/bench/MutexBench.cpp +++ b/bench/MutexBench.cpp @@ -65,4 +65,3 @@ DEF_BENCH( return new MutexBench<SkSharedMutex>(SkString("SkSharedMutex")); ) DEF_BENCH( return new MutexBench<SkMutex>(SkString("SkMutex")); ) DEF_BENCH( return new MutexBench<SkSpinlock>(SkString("SkSpinlock")); ) DEF_BENCH( return new SharedBench; ) - diff --git a/bench/PatchBench.cpp b/bench/PatchBench.cpp index 5d7451a0c4..80d5ce0db1 100644 --- a/bench/PatchBench.cpp +++ b/bench/PatchBench.cpp @@ -12,11 +12,11 @@ #include "SkString.h" /** - * This bench measures the rendering time of the call SkCanvas::drawPatch with different types of - * input patches (regular case, with loops, a square, with a big difference between "parallel" - * sides). This bench also tests the different combination of optional parameters for the function + * This bench measures the rendering time of the call SkCanvas::drawPatch with different types of + * input patches (regular case, with loops, a square, with a big difference between "parallel" + * sides). This bench also tests the different combination of optional parameters for the function * (passing texture coordinates and colors, only textures coordinates, only colors or none). - * Finally, it applies a scale to test if the size affects the rendering time. + * Finally, it applies a scale to test if the size affects the rendering time. */ class PatchBench : public Benchmark { diff --git a/bench/PatchGridBench.cpp b/bench/PatchGridBench.cpp index 83e2932edc..db7865bb3b 100644 --- a/bench/PatchGridBench.cpp +++ b/bench/PatchGridBench.cpp @@ -13,34 +13,34 @@ #include "SkString.h" /** - * This bench measures the rendering time of a gridof patches. - * This bench also tests the different combination of optional parameters for the function + * This bench measures the rendering time of a gridof patches. + * This bench also tests the different combination of optional parameters for the function * (passing texture coordinates and colors, only textures coordinates, only colors or none). * Finally, it also has 3 possible sizes small, medium and big to test if the size of the patches - * in the grid affects time. + * in the grid affects time. */ class PatchGridBench : public Benchmark { - + public: - + enum Size { kSmall_Size, kMedium_Size, kBig_Size }; - + enum VertexMode { kNone_VertexMode, kColors_VertexMode, kTexCoords_VertexMode, kBoth_VertexMode }; - + PatchGridBench(Size size, VertexMode vertexMode) : fVertexMode(vertexMode) , fSize(size) { } - + void setScale(SkCanvas* canvas){ switch (fSize) { case kSmall_Size: @@ -54,7 +54,7 @@ public: break; } } - + void setGrid() { SkPoint vertices[4][5] = { {{50,50}, {150,50}, {250,50},{350,50},{450,50}}, @@ -62,28 +62,28 @@ public: {{50,250}, {150,250}, {250,250},{350,250},{450,250}}, {{100,300}, {150,350}, {250,350},{350,350},{450,350}} }; - + SkColor cornerColors[4][5] = { {SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE}, {SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED}, {SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE}, {SK_ColorRED, SK_ColorBLUE, SK_ColorRED, SK_ColorBLUE, SK_ColorRED}, }; - + SkPoint texCoords[4][5] = { {{0.0f,0.0f}, {1.0f,0.0f}, {2.0f,0.0f}, {3.0f,0.0f}, {4.0f,0.0f}}, {{0.0f,1.0f}, {1.0f,1.0f}, {2.0f,1.0f}, {3.0f,1.0f}, {4.0f,1.0f}}, {{0.0f,2.0f}, {1.0f,2.0f}, {2.0f,2.0f}, {3.0f,2.0f}, {4.0f,2.0f}}, {{0.0f,3.0f}, {1.0f,3.0f}, {2.0f,3.0f}, {3.0f,3.0f}, {4.0f,3.0f}}, }; - + SkPoint hrzCtrl[4][8] = { {{75,30},{125,45},{175,70},{225,20},{275,50},{325,50},{375,5},{425,90}}, {{75,150},{125,150},{175,150},{225,150},{275,150},{325,150},{375,150},{425,150}}, {{75,250},{125,250},{175,250},{225,250},{275,200},{325,150},{375,250},{425,250}}, {{75,350},{125,350},{175,350},{225,350},{275,350},{325,350},{375,350},{425,350}} }; - + SkPoint vrtCtrl[6][5] = { {{50,75},{150,75},{250,75},{350,75},{450,75}}, {{50,125},{150,125},{250,125},{350,125},{450,125}}, @@ -92,43 +92,43 @@ public: {{50,275},{150,275},{250,275},{350,275},{400,305}}, {{50,325},{150,325},{250,325},{350,325},{450,325}} }; - + static const int kRows = 3; static const int kCols = 4; - + fGrid.reset(kRows, kCols, SkPatchGrid::kColors_VertexType, nullptr); for (int i = 0; i < kRows; i++) { for (int j = 0; j < kCols; j++) { SkPoint points[12]; - + //set corners points[SkPatchUtils::kTopP0_CubicCtrlPts] = vertices[i][j]; points[SkPatchUtils::kTopP3_CubicCtrlPts] = vertices[i][j + 1]; points[SkPatchUtils::kBottomP0_CubicCtrlPts] = vertices[i + 1][j]; points[SkPatchUtils::kBottomP3_CubicCtrlPts] = vertices[i + 1][j + 1]; - + points[SkPatchUtils::kTopP1_CubicCtrlPts] = hrzCtrl[i][j * 2]; points[SkPatchUtils::kTopP2_CubicCtrlPts] = hrzCtrl[i][j * 2 + 1]; points[SkPatchUtils::kBottomP1_CubicCtrlPts] = hrzCtrl[i + 1][j * 2]; points[SkPatchUtils::kBottomP2_CubicCtrlPts] = hrzCtrl[i + 1][j * 2 + 1]; - + points[SkPatchUtils::kLeftP1_CubicCtrlPts] = vrtCtrl[i * 2][j]; points[SkPatchUtils::kLeftP2_CubicCtrlPts] = vrtCtrl[i * 2 + 1][j]; points[SkPatchUtils::kRightP1_CubicCtrlPts] = vrtCtrl[i * 2][j + 1]; points[SkPatchUtils::kRightP2_CubicCtrlPts] = vrtCtrl[i * 2 + 1][j + 1]; - + SkColor colors[4]; colors[0] = cornerColors[i][j]; colors[1] = cornerColors[i][j + 1]; colors[3] = cornerColors[i + 1][j]; colors[2] = cornerColors[i + 1][j + 1]; - + SkPoint texs[4]; texs[0] = texCoords[i][j]; texs[1] = texCoords[i][j + 1]; texs[3] = texCoords[i + 1][j]; texs[2] = texCoords[i + 1][j + 1]; - + switch (fVertexMode) { case kNone_VertexMode: fGrid.setPatch(j, i, points, nullptr, nullptr); @@ -148,7 +148,7 @@ public: } } } - + // override this method to change the shader sk_sp<SkShader> createShader() { const SkColor colors[] = { @@ -156,7 +156,7 @@ public: SK_ColorMAGENTA, SK_ColorBLUE, SK_ColorYELLOW, }; const SkPoint pts[] = { { 200.f / 4.f, 0.f }, { 3.f * 200.f / 4, 200.f } }; - + return SkGradientShader::MakeLinear(pts, colors, nullptr, SK_ARRAY_COUNT(colors), SkShader::kMirror_TileMode); } @@ -180,7 +180,7 @@ protected: default: break; } - + SkString size; switch (fSize) { case kSmall_Size: @@ -198,7 +198,7 @@ protected: fName.printf("patch_grid_%s_%s", vertexMode.c_str(), size.c_str()); return fName.c_str(); } - + void onDelayedSetup() override { this->setGrid(); switch (fVertexMode) { @@ -225,7 +225,7 @@ protected: SkPatchGrid fGrid; VertexMode fVertexMode; Size fSize; - + typedef Benchmark INHERITED; }; diff --git a/bench/PathIterBench.cpp b/bench/PathIterBench.cpp index 5a8727feb5..cf93b5d503 100644 --- a/bench/PathIterBench.cpp +++ b/bench/PathIterBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/ReadPixBench.cpp b/bench/ReadPixBench.cpp index 7df5260dcc..b1061a1cde 100644 --- a/bench/ReadPixBench.cpp +++ b/bench/ReadPixBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/bench/RectBench.cpp b/bench/RectBench.cpp index 5bd5640eea..edd5ac7de2 100644 --- a/bench/RectBench.cpp +++ b/bench/RectBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/RectanizerBench.cpp b/bench/RectanizerBench.cpp index 9b7e3ae4e6..5bc6f11b6f 100644 --- a/bench/RectanizerBench.cpp +++ b/bench/RectanizerBench.cpp @@ -41,7 +41,7 @@ public: kSmallPow2_RectType }; - RectanizerBench(RectanizerType rectanizerType, RectType rectType) + RectanizerBench(RectanizerType rectanizerType, RectType rectType) : fName("rectanizer_") , fRectanizerType(rectanizerType) , fRectType(rectType) { diff --git a/bench/RegionBench.cpp b/bench/RegionBench.cpp index 8554569e3d..f73a88889f 100644 --- a/bench/RegionBench.cpp +++ b/bench/RegionBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/RepeatTileBench.cpp b/bench/RepeatTileBench.cpp index 452c2c0079..33e91780d9 100644 --- a/bench/RepeatTileBench.cpp +++ b/bench/RepeatTileBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/RotatedRectBench.cpp b/bench/RotatedRectBench.cpp index 5ae0b1b97e..23e044330c 100644 --- a/bench/RotatedRectBench.cpp +++ b/bench/RotatedRectBench.cpp @@ -13,7 +13,7 @@ /** This benchmark tests rendering rotated rectangles. It can optionally apply AA and/or change the paint color between each rect in different ways using the ColorType enum. The xfermode used can - be specified as well. + be specified as well. */ enum ColorType { diff --git a/bench/ScalarBench.cpp b/bench/ScalarBench.cpp index 0048c6e771..9d3b0ec277 100644 --- a/bench/ScalarBench.cpp +++ b/bench/ScalarBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/ShapesBench.cpp b/bench/ShapesBench.cpp index 2266cc381b..a658c453d1 100644 --- a/bench/ShapesBench.cpp +++ b/bench/ShapesBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2016 Google Inc. * diff --git a/bench/SkLinearBitmapPipelineBench.cpp b/bench/SkLinearBitmapPipelineBench.cpp index 7ab29f699e..f111aeea9e 100644 --- a/bench/SkLinearBitmapPipelineBench.cpp +++ b/bench/SkLinearBitmapPipelineBench.cpp @@ -342,5 +342,3 @@ DEF_BENCH(return new SkBitmapFPGeneral( DEF_BENCH(return new SkBitmapFPOrigShader( srcSize, kLinear_SkColorProfileType, mR, true, SkShader::kRepeat_TileMode, SkShader::kRepeat_TileMode);) - - diff --git a/bench/TextBench.cpp b/bench/TextBench.cpp index f2d7bd3968..04f824c700 100644 --- a/bench/TextBench.cpp +++ b/bench/TextBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2011 Google Inc. * diff --git a/bench/TextBlobBench.cpp b/bench/TextBlobBench.cpp index 6d5a88f318..a350e7b4c4 100644 --- a/bench/TextBlobBench.cpp +++ b/bench/TextBlobBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2015 Google Inc. * diff --git a/bench/TileBench.cpp b/bench/TileBench.cpp index 47e79c78d4..3093016f72 100644 --- a/bench/TileBench.cpp +++ b/bench/TileBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/TopoSortBench.cpp b/bench/TopoSortBench.cpp index 3fa1c0ff97..8a8ec66a61 100644 --- a/bench/TopoSortBench.cpp +++ b/bench/TopoSortBench.cpp @@ -76,4 +76,3 @@ private: /////////////////////////////////////////////////////////////////////////////// DEF_BENCH( return new TopoSortBench(); ) - diff --git a/bench/WriterBench.cpp b/bench/WriterBench.cpp index 115ffc1d42..78c5d8b485 100644 --- a/bench/WriterBench.cpp +++ b/bench/WriterBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2012 The Android Open Source Project * diff --git a/bench/Xfer4fBench.cpp b/bench/Xfer4fBench.cpp index bc234a7edb..ab04476cf2 100644 --- a/bench/Xfer4fBench.cpp +++ b/bench/Xfer4fBench.cpp @@ -22,7 +22,7 @@ public: , fFlags(flags & ~USE_AA) { fXfer.reset(SkXfermode::Create(mode)); - + fProc1 = SkXfermode::GetD32Proc(fXfer, fFlags | SkXfermode::kSrcIsSingle_D32Flag); fProcN = SkXfermode::GetD32Proc(fXfer, fFlags); fName.printf("xfer4f_%s_%s_%c_%s_%s", @@ -37,7 +37,7 @@ public: fDst[i] = 0; fAAStorage[i] = i * 255 / (N - 1); } - + if (flags & USE_AA) { fAA = fAAStorage; } else { diff --git a/bench/XferU64Bench.cpp b/bench/XferU64Bench.cpp index a57ba60ec1..90aa328b40 100644 --- a/bench/XferU64Bench.cpp +++ b/bench/XferU64Bench.cpp @@ -37,7 +37,7 @@ public: fDst[i] = 0; fAAStorage[i] = i * 255 / (N - 1); } - + if (flags & USE_AA) { fAA = fAAStorage; } else { diff --git a/bench/XfermodeBench.cpp b/bench/XfermodeBench.cpp index f407c594a9..9eae7cef6c 100644 --- a/bench/XfermodeBench.cpp +++ b/bench/XfermodeBench.cpp @@ -1,4 +1,3 @@ - /* * Copyright 2013 Google Inc. * diff --git a/bench/nanobenchAndroid.cpp b/bench/nanobenchAndroid.cpp index 7a166d45a0..cb6f09d654 100644 --- a/bench/nanobenchAndroid.cpp +++ b/bench/nanobenchAndroid.cpp @@ -49,5 +49,3 @@ bool HWUITarget::init(SkImageInfo info, Benchmark* bench) { bool HWUITarget::capturePixels(SkBitmap* bmp) { return this->renderer.capturePixels(bmp); } - - |