Commit b664cd6e authored by Adrienne Walker's avatar Adrienne Walker Committed by Commit Bot

gpu: Set Skia workarounds from Chrome workarounds

Bug: 829614
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: Ia776792f78d23d2d9536de200de7135e1c4fee9a
Reviewed-on: https://chromium-review.googlesource.com/1067515Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Reviewed-by: default avatarZhenyao Mo <zmo@chromium.org>
Commit-Queue: enne <enne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#560352}
parent 60a1663c
...@@ -957,7 +957,10 @@ ContextResult RasterDecoderImpl::Initialize( ...@@ -957,7 +957,10 @@ ContextResult RasterDecoderImpl::Initialize(
} }
if (supports_oop_raster_) { if (supports_oop_raster_) {
gr_context_ = GrContext::MakeGL(std::move(interface)); GrContextOptions options;
options.fDriverBugWorkarounds =
GrDriverBugWorkarounds(workarounds().ToIntSet());
gr_context_ = GrContext::MakeGL(std::move(interface), options);
if (gr_context_) { if (gr_context_) {
// TODO(enne): This cache is for this decoder only and each decoder has // TODO(enne): This cache is for this decoder only and each decoder has
// its own cache. This is pretty unfortunate. This really needs to be // its own cache. This is pretty unfortunate. This really needs to be
......
...@@ -65,6 +65,16 @@ GpuDriverBugWorkarounds::GpuDriverBugWorkarounds( ...@@ -65,6 +65,16 @@ GpuDriverBugWorkarounds::GpuDriverBugWorkarounds(
GpuDriverBugWorkarounds::~GpuDriverBugWorkarounds() = default; GpuDriverBugWorkarounds::~GpuDriverBugWorkarounds() = default;
std::vector<int32_t> GpuDriverBugWorkarounds::ToIntSet() const {
std::vector<int32_t> result;
#define GPU_OP(type, name) \
if (name) \
result.push_back(type);
GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
#undef GPU_OP
return result;
}
void GpuDriverBugWorkarounds::Append(const GpuDriverBugWorkarounds& extra) { void GpuDriverBugWorkarounds::Append(const GpuDriverBugWorkarounds& extra) {
#define GPU_OP(type, name) name |= extra.name; #define GPU_OP(type, name) name |= extra.name;
GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
......
...@@ -31,6 +31,8 @@ class GPU_EXPORT GpuDriverBugWorkarounds { ...@@ -31,6 +31,8 @@ class GPU_EXPORT GpuDriverBugWorkarounds {
// zero, then the other is applied. // zero, then the other is applied.
void Append(const GpuDriverBugWorkarounds& extra); void Append(const GpuDriverBugWorkarounds& extra);
std::vector<int32_t> ToIntSet() const;
#define GPU_OP(type, name) bool name = false; #define GPU_OP(type, name) bool name = false;
GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP) GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
#undef GPU_OP #undef GPU_OP
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment