blob: a1f27a3205ac28a7f278cc9f0c50f4f0b299b6f4 [file] [log] [blame]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001/*
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 "GrDriverBugWorkarounds.h"
9
10#include "SkTypes.h"
11
12GrDriverBugWorkarounds::GrDriverBugWorkarounds() = default;
13
14GrDriverBugWorkarounds::GrDriverBugWorkarounds(
15 const std::vector<int>& enabled_driver_bug_workarounds) {
16 for (auto id : enabled_driver_bug_workarounds) {
17 switch (id) {
18#define GPU_OP(type, name) \
19 case GrDriverBugWorkaroundType::type: \
20 name = true; \
21 break;
22
23 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
24#undef GPU_OP
25 default:
26 SK_ABORT("Not implemented");
27 break;
28 }
29 }
30}
31
Adrienne Walkerab7181d2018-05-14 14:02:03 -070032void GrDriverBugWorkarounds::applyOverrides(
33 const GrDriverBugWorkarounds& workarounds) {
34#define GPU_OP(type, name) \
35 name |= workarounds.name;
36
37 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
38#undef GPU_OP
39}
40
Adrienne Walker1df7cd82018-04-18 13:46:25 -070041GrDriverBugWorkarounds::~GrDriverBugWorkarounds() = default;