blob: 69024530b06f095f9db2c37bc3fc7b7f8767ae70 [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
Mike Kleinc0bd9f92019-04-23 12:05:21 -05008#include "include/gpu/GrDriverBugWorkarounds.h"
Adrienne Walker1df7cd82018-04-18 13:46:25 -07009
Mike Kleinc0bd9f92019-04-23 12:05:21 -050010#include "include/core/SkTypes.h"
Adrienne Walker1df7cd82018-04-18 13:46:25 -070011
12GrDriverBugWorkarounds::GrDriverBugWorkarounds() = default;
Ben Wagnere990fcc2020-03-27 17:10:35 -040013GrDriverBugWorkarounds::GrDriverBugWorkarounds(const GrDriverBugWorkarounds&) = default;
14GrDriverBugWorkarounds& GrDriverBugWorkarounds::operator=(const GrDriverBugWorkarounds&) = default;
15GrDriverBugWorkarounds::~GrDriverBugWorkarounds() = default;
Adrienne Walker1df7cd82018-04-18 13:46:25 -070016
17GrDriverBugWorkarounds::GrDriverBugWorkarounds(
18 const std::vector<int>& enabled_driver_bug_workarounds) {
19 for (auto id : enabled_driver_bug_workarounds) {
20 switch (id) {
21#define GPU_OP(type, name) \
22 case GrDriverBugWorkaroundType::type: \
23 name = true; \
24 break;
25
26 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
27#undef GPU_OP
28 default:
29 SK_ABORT("Not implemented");
30 break;
31 }
32 }
33}
34
Adrienne Walkerab7181d2018-05-14 14:02:03 -070035void GrDriverBugWorkarounds::applyOverrides(
36 const GrDriverBugWorkarounds& workarounds) {
37#define GPU_OP(type, name) \
38 name |= workarounds.name;
39
40 GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
41#undef GPU_OP
42}