GrDriverBugWorkarounds.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include "include/gpu/GrDriverBugWorkarounds.h"
  8. #include "include/core/SkTypes.h"
  9. GrDriverBugWorkarounds::GrDriverBugWorkarounds() = default;
  10. GrDriverBugWorkarounds::GrDriverBugWorkarounds(
  11. const std::vector<int>& enabled_driver_bug_workarounds) {
  12. for (auto id : enabled_driver_bug_workarounds) {
  13. switch (id) {
  14. #define GPU_OP(type, name) \
  15. case GrDriverBugWorkaroundType::type: \
  16. name = true; \
  17. break;
  18. GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
  19. #undef GPU_OP
  20. default:
  21. SK_ABORT("Not implemented");
  22. break;
  23. }
  24. }
  25. }
  26. void GrDriverBugWorkarounds::applyOverrides(
  27. const GrDriverBugWorkarounds& workarounds) {
  28. #define GPU_OP(type, name) \
  29. name |= workarounds.name;
  30. GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
  31. #undef GPU_OP
  32. }
  33. GrDriverBugWorkarounds::~GrDriverBugWorkarounds() = default;