Commit 70ac8913 authored by Khushal Sagar's avatar Khushal Sagar Committed by Commit Bot

gpu: Add tracing for flush workaround on mac.

R=kbr@chromium.org

Bug: 1070464
Change-Id: Ia7a5b82e9aae126b1a6860224879b7638940102e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2154374
Auto-Submit: Khushal <khushalsagar@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#760175}
parent fb262587
...@@ -399,6 +399,7 @@ class RasterDecoderImpl final : public RasterDecoder, ...@@ -399,6 +399,7 @@ class RasterDecoderImpl final : public RasterDecoder,
// macOS OpenGL driver. // macOS OpenGL driver.
// https://crbug.com/906453 // https://crbug.com/906453
if (!flush_workaround_disabled_for_test_) { if (!flush_workaround_disabled_for_test_) {
TRACE_EVENT0("gpu", "RasterDecoderImpl::FlushToWorkAroundMacCrashes");
if (gr_context()) if (gr_context())
gr_context()->flush(); gr_context()->flush();
api()->glFlushFn(); api()->glFlushFn();
......
...@@ -272,6 +272,7 @@ void GLContext::DestroyBackpressureFences() { ...@@ -272,6 +272,7 @@ void GLContext::DestroyBackpressureFences() {
void GLContext::FlushForDriverCrashWorkaround() { void GLContext::FlushForDriverCrashWorkaround() {
if (!IsCurrent(nullptr)) if (!IsCurrent(nullptr))
return; return;
TRACE_EVENT0("gpu", "GLContext::FlushForDriverCrashWorkaround");
glFlush(); glFlush();
} }
#endif #endif
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "ui/gl/gl_bindings.h" #include "ui/gl/gl_bindings.h"
#include "ui/gl/gl_implementation.h" #include "ui/gl/gl_implementation.h"
...@@ -158,9 +159,17 @@ GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> bind_with_flush_on_mac( ...@@ -158,9 +159,17 @@ GrGLFunction<R GR_GL_FUNCTION_TYPE(Args...)> bind_with_flush_on_mac(
// Conditional may be optimized out because droppable_call is set at compile // Conditional may be optimized out because droppable_call is set at compile
// time. // time.
if (!droppable_call || !HasInitializedNullDrawGLBindings()) { if (!droppable_call || !HasInitializedNullDrawGLBindings()) {
glFlush(); {
TRACE_EVENT0(
"gpu", "CreateGrGLInterface - bind_with_flush_on_mac - beforefunc")
glFlush();
}
func(args...); func(args...);
glFlush(); {
TRACE_EVENT0("gpu",
"CreateGrGLInterface - bind_with_flush_on_mac - afterfunc")
glFlush();
}
} }
}; };
#else #else
......
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