Commit 844a7a92 authored by Vasiliy Telezhnikov's avatar Vasiliy Telezhnikov Committed by Commit Bot

GLRenderer: Reset VertexAttribArray after Skia

This CL fixes GLRenderer::RestoreGLState to DisableVertexAttribArray
that Skia might enabled and not used in GLRenderer.

Bug: 1021361
Change-Id: Ic7fab80058ebdea902dadc64edce647ede16517a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1917680Reviewed-by: default avatarJonathan Backer <backer@chromium.org>
Commit-Queue: Vasiliy Telezhnikov <vasilyt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715380}
parent cd449edd
......@@ -316,7 +316,7 @@ class GLRenderer::ScopedUseGrContext {
~ScopedUseGrContext() {
// Pass context control back to GLrenderer.
scoped_gpu_raster_ = nullptr;
renderer_->RestoreGLState();
renderer_->RestoreGLStateAfterSkia();
}
GrContext* context() const {
......@@ -3343,6 +3343,17 @@ void GLRenderer::ReinitializeGLState() {
RestoreGLState();
}
void GLRenderer::RestoreGLStateAfterSkia() {
// After using Skia we need to disable vertex attributes we don't use
int attribs_count = output_surface_->context_provider()
->ContextCapabilities()
.max_vertex_attribs;
for (int i = 0; i < attribs_count; i++)
gl_->DisableVertexAttribArray(i);
RestoreGLState();
}
void GLRenderer::RestoreGLState() {
// This restores the current GLRenderer state to the GL context.
bound_geometry_ = NO_BINDING;
......
......@@ -296,6 +296,7 @@ class VIZ_SERVICE_EXPORT GLRenderer : public DirectRenderer {
void ReinitializeGLState();
void RestoreGLState();
void RestoreGLStateAfterSkia();
// TODO(weiliangc): Once the overlay processor could schedule overlays, remove
// these functions.
......
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