OLD | NEW |
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 944 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 fCurrentSubsetImage = 0; | 955 fCurrentSubsetImage = 0; |
956 fUseCodec++; | 956 fUseCodec++; |
957 } | 957 } |
958 | 958 |
959 // Run the BRDBenches | 959 // Run the BRDBenches |
960 // We will benchmark multiple BRD strategies. | 960 // We will benchmark multiple BRD strategies. |
961 static const struct { | 961 static const struct { |
962 SkBitmapRegionDecoderInterface::Strategy fStrategy; | 962 SkBitmapRegionDecoderInterface::Strategy fStrategy; |
963 const char* fName; | 963 const char* fName; |
964 } strategies[] = { | 964 } strategies[] = { |
965 { SkBitmapRegionDecoderInterface::kOriginal_Strategy, "BRD" }, | 965 { SkBitmapRegionDecoderInterface::kOriginal_Strategy, "BRD" }, |
966 { SkBitmapRegionDecoderInterface::kCanvas_Strategy, "BRD_canvas"
}, | 966 { SkBitmapRegionDecoderInterface::kCanvas_Strategy, "BRD_canvas
" }, |
| 967 { SkBitmapRegionDecoderInterface::kAndroidCodec_Strategy, "BRD_andro
id_codec" }, |
967 }; | 968 }; |
968 | 969 |
969 // We intend to create benchmarks that model the use cases in | 970 // We intend to create benchmarks that model the use cases in |
970 // android/libraries/social/tiledimage. In this library, an image is de
coded in 512x512 | 971 // android/libraries/social/tiledimage. In this library, an image is de
coded in 512x512 |
971 // tiles. The image can be translated freely, so the location of a tile
may be anywhere in | 972 // tiles. The image can be translated freely, so the location of a tile
may be anywhere in |
972 // the image. For that reason, we will benchmark decodes in five repres
entative locations | 973 // the image. For that reason, we will benchmark decodes in five repres
entative locations |
973 // in the image. Additionally, this use case utilizes power of two scal
ing, so we will | 974 // in the image. Additionally, this use case utilizes power of two scal
ing, so we will |
974 // test on power of two sample sizes. The output tile is always 512x512
, so, when a | 975 // test on power of two sample sizes. The output tile is always 512x512
, so, when a |
975 // sampleSize is used, the size of the subset that is decoded is always | 976 // sampleSize is used, the size of the subset that is decoded is always |
976 // (sampleSize*512)x(sampleSize*512). | 977 // (sampleSize*512)x(sampleSize*512). |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1364 | 1365 |
1365 return 0; | 1366 return 0; |
1366 } | 1367 } |
1367 | 1368 |
1368 #if !defined SK_BUILD_FOR_IOS | 1369 #if !defined SK_BUILD_FOR_IOS |
1369 int main(int argc, char** argv) { | 1370 int main(int argc, char** argv) { |
1370 SkCommandLineFlags::Parse(argc, argv); | 1371 SkCommandLineFlags::Parse(argc, argv); |
1371 return nanobench_main(); | 1372 return nanobench_main(); |
1372 } | 1373 } |
1373 #endif | 1374 #endif |
OLD | NEW |