Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Side by Side Diff: bench/DrawLatticeBench.cpp

Issue 2305433002: Add option to skip rects to drawImageLattice() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: numRectsToDraw() Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gm/lattice.cpp » ('j') | include/core/SkCanvas.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Benchmark.h" 8 #include "Benchmark.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkRect.h" 10 #include "SkRect.h"
11 #include "SkString.h" 11 #include "SkString.h"
12 12
13 class DrawLatticeBench : public Benchmark { 13 class DrawLatticeBench : public Benchmark {
14 public: 14 public:
15 DrawLatticeBench(int* xDivs, int xCount, int* yDivs, int yCount, const SkISi ze& srcSize, 15 DrawLatticeBench(int* xDivs, int xCount, int* yDivs, int yCount, const SkISi ze& srcSize,
16 const SkRect& dst, const char* desc) 16 const SkRect& dst, const char* desc)
17 : fSrcSize(srcSize) 17 : fSrcSize(srcSize)
18 , fDst(dst) 18 , fDst(dst)
19 { 19 {
20 fLattice.fXDivs = xDivs; 20 fLattice.fXDivs = xDivs;
21 fLattice.fXCount = xCount; 21 fLattice.fXCount = xCount;
22 fLattice.fYDivs = yDivs; 22 fLattice.fYDivs = yDivs;
23 fLattice.fYCount = yCount; 23 fLattice.fYCount = yCount;
24 fLattice.fFlags = nullptr;
25 fLattice.fFlagCount = 0;
24 26
25 fName = SkStringPrintf("DrawLattice_%s", desc); 27 fName = SkStringPrintf("DrawLattice_%s", desc);
26 } 28 }
27 29
28 const char* onGetName() override { 30 const char* onGetName() override {
29 return fName.c_str(); 31 return fName.c_str();
30 } 32 }
31 33
32 SkIPoint onGetSize() override { 34 SkIPoint onGetSize() override {
33 return SkIPoint::Make(1000, 1000); 35 return SkIPoint::Make(1000, 1000);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 SkRect::MakeWH(500.0f, 500.0f), "Src100_Ds t500_Rects9");) 67 SkRect::MakeWH(500.0f, 500.0f), "Src100_Ds t500_Rects9");)
66 DEF_BENCH(return new DrawLatticeBench(gDivs9, 2, gDivs9, 2, SkISize::Make(100, 1 00), 68 DEF_BENCH(return new DrawLatticeBench(gDivs9, 2, gDivs9, 2, SkISize::Make(100, 1 00),
67 SkRect::MakeWH(1000.0f, 1000.0f), "Src100_ Dst1000_Rects9");) 69 SkRect::MakeWH(1000.0f, 1000.0f), "Src100_ Dst1000_Rects9");)
68 static int gDivs15[4] = { 15, 45, 55, 85, }; 70 static int gDivs15[4] = { 15, 45, 55, 85, };
69 DEF_BENCH(return new DrawLatticeBench(gDivs15, 4, gDivs15, 4, SkISize::Make(100, 100), 71 DEF_BENCH(return new DrawLatticeBench(gDivs15, 4, gDivs15, 4, SkISize::Make(100, 100),
70 SkRect::MakeWH(250.0f, 250.0f), "Src100_Ds t250_Rects15");) 72 SkRect::MakeWH(250.0f, 250.0f), "Src100_Ds t250_Rects15");)
71 DEF_BENCH(return new DrawLatticeBench(gDivs15, 4, gDivs15, 4, SkISize::Make(100, 100), 73 DEF_BENCH(return new DrawLatticeBench(gDivs15, 4, gDivs15, 4, SkISize::Make(100, 100),
72 SkRect::MakeWH(500.0f, 500.0f), "Src100_Ds t500_Rects15");) 74 SkRect::MakeWH(500.0f, 500.0f), "Src100_Ds t500_Rects15");)
73 DEF_BENCH(return new DrawLatticeBench(gDivs15, 4, gDivs15, 4, SkISize::Make(100, 100), 75 DEF_BENCH(return new DrawLatticeBench(gDivs15, 4, gDivs15, 4, SkISize::Make(100, 100),
74 SkRect::MakeWH(1000.0f, 1000.0f), "Src100_ Dst1000_Rects15");) 76 SkRect::MakeWH(1000.0f, 1000.0f), "Src100_ Dst1000_Rects15");)
OLDNEW
« no previous file with comments | « no previous file | gm/lattice.cpp » ('j') | include/core/SkCanvas.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698