OLD | NEW |
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 "GrContext.h" | |
10 #include "sk_tool_utils.h" | 9 #include "sk_tool_utils.h" |
11 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
12 #include "SkImage.h" | 11 #include "SkImage.h" |
13 #include "SkSurface.h" | 12 #include "SkSurface.h" |
14 | 13 |
| 14 #if SK_SUPPORT_GPU |
| 15 |
| 16 #include "GrContext.h" |
| 17 |
15 /** These benchmarks were designed to measure changes to GrResourceCache's repla
cement policy */ | 18 /** These benchmarks were designed to measure changes to GrResourceCache's repla
cement policy */ |
16 | 19 |
17 ////////////////////////////////////////////////////////////////////////////// | 20 ////////////////////////////////////////////////////////////////////////////// |
18 | 21 |
19 // The width/height of the images to draw. The small size underestimates the val
ue of a good | 22 // The width/height of the images to draw. The small size underestimates the val
ue of a good |
20 // replacement strategy since the texture uploads are quite small. However, the
effects are still | 23 // replacement strategy since the texture uploads are quite small. However, the
effects are still |
21 // significant and this lets the benchmarks complete a lot faster, especially on
mobile. | 24 // significant and this lets the benchmarks complete a lot faster, especially on
mobile. |
22 static constexpr int kS = 25; | 25 static constexpr int kS = 25; |
23 | 26 |
24 static void make_images(sk_sp<SkImage> imgs[], int cnt) { | 27 static void make_images(sk_sp<SkImage> imgs[], int cnt) { |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 Mode fMode; | 251 Mode fMode; |
249 sk_sp<SkImage> fImages[kMaxImagesToDraw]; | 252 sk_sp<SkImage> fImages[kMaxImagesToDraw]; |
250 size_t fOldBytes; | 253 size_t fOldBytes; |
251 int fOldCount; | 254 int fOldCount; |
252 | 255 |
253 typedef Benchmark INHERITED; | 256 typedef Benchmark INHERITED; |
254 }; | 257 }; |
255 | 258 |
256 DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench:
:Mode::kPingPong); ) | 259 DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench:
:Mode::kPingPong); ) |
257 DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench:
:Mode::kFlipFlop); ) | 260 DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench:
:Mode::kFlipFlop); ) |
| 261 |
| 262 #endif |
OLD | NEW |