GrDriverBugWorkarounds.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef GrDriverBugWorkarounds_DEFINED
  8. #define GrDriverBugWorkarounds_DEFINED
  9. // External embedders of Skia can override this to use their own list
  10. // of workaround names.
  11. #ifdef SK_GPU_WORKAROUNDS_HEADER
  12. #include SK_GPU_WORKAROUNDS_HEADER
  13. #else
  14. // To regenerate this file, set gn arg "skia_generate_workarounds = true".
  15. // This is not rebuilt by default to avoid embedders having to have extra
  16. // build steps.
  17. #include "include/gpu/GrDriverBugWorkaroundsAutogen.h"
  18. #endif
  19. #include "include/core/SkTypes.h"
  20. #include <stdint.h>
  21. #include <vector>
  22. enum GrDriverBugWorkaroundType {
  23. #define GPU_OP(type, name) type,
  24. GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
  25. #undef GPU_OP
  26. NUMBER_OF_GPU_DRIVER_BUG_WORKAROUND_TYPES
  27. };
  28. class SK_API GrDriverBugWorkarounds {
  29. public:
  30. GrDriverBugWorkarounds();
  31. explicit GrDriverBugWorkarounds(const std::vector<int32_t>& workarounds);
  32. GrDriverBugWorkarounds& operator=(const GrDriverBugWorkarounds&) = default;
  33. // Turn on any workarounds listed in |workarounds| (but don't turn any off).
  34. void applyOverrides(const GrDriverBugWorkarounds& workarounds);
  35. ~GrDriverBugWorkarounds();
  36. #define GPU_OP(type, name) bool name = false;
  37. GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
  38. #undef GPU_OP
  39. };
  40. #endif