Commit 980f3891 authored by Justin Novosad's avatar Justin Novosad Committed by Commit Bot

Add missing GL extension check in SharedContextRateLimiter

This bug was unmasked by this CL that re-enabled overdraw
optimizations in GPU-accelerated 2D canvas:
https://chromium-review.googlesource.com/c/chromium/src/+/800750

Crash happens on configuration that do not support the sync query
extension.

BUG=791608

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2
Change-Id: I0da7be2f305d61881ba57d999329de2864d68ca5
Reviewed-on: https://chromium-review.googlesource.com/806678Reviewed-by: default avatarOlivia Lai <xlai@chromium.org>
Commit-Queue: Justin Novosad <junov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521466}
parent a9634625
......@@ -46,9 +46,8 @@ void SharedContextRateLimiter::Tick() {
return;
queries_.push_back(0);
if (can_use_sync_queries_)
gl->GenQueriesEXT(1, &queries_.back());
if (can_use_sync_queries_) {
gl->GenQueriesEXT(1, &queries_.back());
gl->BeginQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM, queries_.back());
gl->EndQueryEXT(GL_COMMANDS_COMPLETED_CHROMIUM);
}
......@@ -70,7 +69,8 @@ void SharedContextRateLimiter::Reset() {
return;
gpu::gles2::GLES2Interface* gl = context_provider_->ContextGL();
if (gl && gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) {
if (can_use_sync_queries_ && gl &&
gl->GetGraphicsResetStatusKHR() == GL_NO_ERROR) {
while (queries_.size() > 0) {
gl->DeleteQueriesEXT(1, &queries_.front());
queries_.pop_front();
......
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