Commit e6ba5376 authored by Justin Novosad's avatar Justin Novosad Committed by Commit Bot

Reset all GrContext state on Android in ScopedGpuRaster

This fixes rendering glitches in pages with videos in them
on Android WebView.  I do not yet understand why the GL state
is being changed without going through the gpu command buffer,
but this seems to be happening with Android WebView on pages
that have video elements.  This is a quick fix to resolve
A release-blocking regression.  Further investigation
will be a part of follow-up work: crbug.com/832810

BUG=826636

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: Id9b620ffcf74fd674d53a2eadc6efc932e9505d8
Reviewed-on: https://chromium-review.googlesource.com/1012517Reviewed-by: default avatardanakj <danakj@chromium.org>
Commit-Queue: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551039}
parent 106948b1
......@@ -3,7 +3,10 @@
// found in the LICENSE file.
#include "cc/raster/scoped_gpu_raster.h"
#include "build/build_config.h"
#include "components/viz/common/gpu/context_provider.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/gles2_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"
......@@ -30,12 +33,11 @@ void ScopedGpuRaster::BeginGpuRaster() {
// arguments even when tracing is disabled.
gl->TraceBeginCHROMIUM("ScopedGpuRaster", "GpuRasterization");
// TODO(junov): The following should not be necessary because state changes
// are supposed to be automatically tracked and handled by
// GLES2ImplementationWithGrContextSupport. Need to figure out what is
// dirtying the vertex attribute state without being detected.
#if defined(OS_ANDROID)
// TODO(crbug.com/832810): The following reset should not be necessary.
GrContext* gr_context = context_provider_->GrContext();
gr_context->resetContext(kVertex_GrGLBackendState);
gr_context->resetContext();
#endif
}
void ScopedGpuRaster::EndGpuRaster() {
......
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