Commit 10b31235 authored by Jonathan Backer's avatar Jonathan Backer Committed by Commit Bot

Enable EGL timestamps

Presentation helper only picks up changes to the use of EGL timestamps
when we make current (GLSurfacePresentationHelper::OnMakeCurrent).
With virtual contexts we very rarely call MakeCurrent.

This CL adds a MakeCurrent on initialization to pick it up.

Change-Id: I2cc5429004e6f2d84782091464d0a90aa5d25ace
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1951581
Commit-Queue: Jonathan Backer <backer@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Auto-Submit: Jonathan Backer <backer@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#721772}
parent 802bfc88
......@@ -53,8 +53,6 @@ SkiaOutputDeviceGL::SkiaOutputDeviceGL(
// only update this for Android.
// This output device is never offscreen.
capabilities_.supports_surfaceless = gl_surface_->IsSurfaceless();
if (gl_surface_->SupportsSwapTimestamps())
gl_surface_->SetEnableSwapTimestamps();
#endif
}
......@@ -66,6 +64,14 @@ void SkiaOutputDeviceGL::Initialize(GrContext* gr_context,
DCHECK(gl_context);
gr_context_ = gr_context;
if (gl_surface_->SupportsSwapTimestamps()) {
gl_surface_->SetEnableSwapTimestamps();
// Changes to swap timestamp queries are only picked up when making current.
gl_context->ReleaseCurrent(nullptr);
gl_context->MakeCurrent(gl_surface_.get());
}
gl::CurrentGL* current_gl = gl_context->GetCurrentGL();
DCHECK(current_gl);
......
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