diff options
author | brianosman <brianosman@google.com> | 2016-09-15 08:33:02 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-15 08:33:02 -0700 |
commit | 9f1f6e2c28066c7d7ff26727ce7d7504c7d032bd (patch) | |
tree | 8fba8eb6c2b512d1e89b1085a62564ec22cd8dab | |
parent | 0973a371ecb55a97d84d18c236df6180bca41e6d (diff) |
More NoGPU compile fixes
I can now build 'most' with skia_gpu=0 on my machine.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2340133003
Review-Url: https://codereview.chromium.org/2340133003
-rw-r--r-- | bench/ImageCacheBudgetBench.cpp | 7 | ||||
-rw-r--r-- | bench/nanobench.cpp | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/bench/ImageCacheBudgetBench.cpp b/bench/ImageCacheBudgetBench.cpp index 32804bae13..11b4c50968 100644 --- a/bench/ImageCacheBudgetBench.cpp +++ b/bench/ImageCacheBudgetBench.cpp @@ -6,12 +6,15 @@ */ #include "Benchmark.h" -#include "GrContext.h" #include "sk_tool_utils.h" #include "SkCanvas.h" #include "SkImage.h" #include "SkSurface.h" +#if SK_SUPPORT_GPU + +#include "GrContext.h" + /** These benchmarks were designed to measure changes to GrResourceCache's replacement policy */ ////////////////////////////////////////////////////////////////////////////// @@ -255,3 +258,5 @@ private: DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench::Mode::kPingPong); ) DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench::Mode::kFlipFlop); ) + +#endif diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp index ca403f50de..5db5137ffd 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -483,6 +483,12 @@ void create_configs(SkTArray<Config>* configs) { } } +// disable warning : switch statement contains default but no 'case' labels +#if defined _WIN32 +#pragma warning ( push ) +#pragma warning ( disable : 4065 ) +#endif + // If bench is enabled for config, returns a Target* for it, otherwise nullptr. static Target* is_enabled(Benchmark* bench, const Config& config) { if (!bench->isSuitableFor(config.backend)) { @@ -517,6 +523,10 @@ static Target* is_enabled(Benchmark* bench, const Config& config) { return target; } +#if defined _WIN32 +#pragma warning ( pop ) +#endif + static bool valid_brd_bench(sk_sp<SkData> encoded, SkColorType colorType, uint32_t sampleSize, uint32_t minOutputSize, int* width, int* height) { SkAutoTDelete<SkBitmapRegionDecoder> brd( |