Adrienne Walker | 1df7cd8 | 2018-04-18 13:46:25 -0700 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef GrDriverBugWorkarounds_DEFINED |
| 9 | #define GrDriverBugWorkarounds_DEFINED |
| 10 | |
| 11 | // External embedders of Skia can override this to use their own list |
| 12 | // of workaround names. |
| 13 | #ifdef SK_GPU_WORKAROUNDS_HEADER |
| 14 | #include SK_GPU_WORKAROUNDS_HEADER |
| 15 | #else |
| 16 | // To regenerate this file, set gn arg "skia_generate_workarounds = true". |
| 17 | // This is not rebuilt by default to avoid embedders having to have extra |
| 18 | // build steps. |
| 19 | #include "GrDriverBugWorkaroundsAutogen.h" |
| 20 | #endif |
| 21 | |
| 22 | #include <stdint.h> |
| 23 | #include <vector> |
| 24 | |
| 25 | enum GrDriverBugWorkaroundType { |
| 26 | #define GPU_OP(type, name) type, |
| 27 | GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 28 | #undef GPU_OP |
| 29 | NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES |
| 30 | }; |
| 31 | |
| 32 | class GrDriverBugWorkarounds { |
| 33 | public: |
| 34 | GrDriverBugWorkarounds(); |
| 35 | explicit GrDriverBugWorkarounds(const std::vector<int32_t>& workarounds); |
| 36 | |
| 37 | ~GrDriverBugWorkarounds(); |
| 38 | |
| 39 | #define GPU_OP(type, name) bool name = false; |
| 40 | GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) |
| 41 | #undef GPU_OP |
| 42 | }; |
| 43 | |
| 44 | #endif |