Debian Codegraph @

src/gpu/ganesh/GrDriverBugWorkarounds.cpp

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