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

Side by Side Diff: bench/nanobench.cpp

Issue 1417583009: Combine native sampling with sampling (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Work around missing initializer_list on mac Created 5 years, 1 month 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 | dm/DM.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2014 Google Inc. 2 * Copyright 2014 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 <ctype.h> 8 #include <ctype.h>
9 9
10 #include "nanobench.h" 10 #include "nanobench.h"
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 // in the image. Additionally, this use case utilizes power of two scal ing, so we will 971 // in the image. Additionally, this use case utilizes power of two scal ing, so we will
972 // test on power of two sample sizes. The output tile is always 512x512 , so, when a 972 // test on power of two sample sizes. The output tile is always 512x512 , so, when a
973 // sampleSize is used, the size of the subset that is decoded is always 973 // sampleSize is used, the size of the subset that is decoded is always
974 // (sampleSize*512)x(sampleSize*512). 974 // (sampleSize*512)x(sampleSize*512).
975 // There are a few good reasons to only test on power of two sample size s at this time: 975 // There are a few good reasons to only test on power of two sample size s at this time:
976 // JPEG decodes using kOriginal_Strategy are broken for non-powers o f two. 976 // JPEG decodes using kOriginal_Strategy are broken for non-powers o f two.
977 // skbug.com/4319 977 // skbug.com/4319
978 // All use cases we are aware of only scale by powers of two. 978 // All use cases we are aware of only scale by powers of two.
979 // PNG decodes use the indicated sampling strategy regardless of the sample size, so 979 // PNG decodes use the indicated sampling strategy regardless of the sample size, so
980 // these tests are sufficient to provide good coverage of our sc aling options. 980 // these tests are sufficient to provide good coverage of our sc aling options.
981 const uint32_t sampleSizes[] = { 1, 2, 4, 8, 16 }; 981 const uint32_t sampleSizes[] = { 1, 2, 4, 8, 16, 32, 64 };
982 const uint32_t minOutputSize = 512; 982 const uint32_t minOutputSize = 512;
983 while (fCurrentBRDImage < fImages.count()) { 983 while (fCurrentBRDImage < fImages.count()) {
984 while (fCurrentBRDStrategy < (int) SK_ARRAY_COUNT(strategies)) { 984 while (fCurrentBRDStrategy < (int) SK_ARRAY_COUNT(strategies)) {
985 fSourceType = "image"; 985 fSourceType = "image";
986 fBenchType = strategies[fCurrentBRDStrategy].fName; 986 fBenchType = strategies[fCurrentBRDStrategy].fName;
987 987
988 const SkString& path = fImages[fCurrentBRDImage]; 988 const SkString& path = fImages[fCurrentBRDImage];
989 const SkBitmapRegionDecoderInterface::Strategy strategy = 989 const SkBitmapRegionDecoderInterface::Strategy strategy =
990 strategies[fCurrentBRDStrategy].fStrategy; 990 strategies[fCurrentBRDStrategy].fStrategy;
991 991
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
1337 1337
1338 return 0; 1338 return 0;
1339 } 1339 }
1340 1340
1341 #if !defined SK_BUILD_FOR_IOS 1341 #if !defined SK_BUILD_FOR_IOS
1342 int main(int argc, char** argv) { 1342 int main(int argc, char** argv) {
1343 SkCommandLineFlags::Parse(argc, argv); 1343 SkCommandLineFlags::Parse(argc, argv);
1344 return nanobench_main(); 1344 return nanobench_main();
1345 } 1345 }
1346 #endif 1346 #endif
OLDNEW
« no previous file with comments | « no previous file | dm/DM.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698