Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1047)

Unified Diff: android_webview/browser/aw_render_thread_context_provider.cc

Issue 2850713002: aw: Hook up gpu client tracing (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/browser/aw_render_thread_context_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/browser/aw_render_thread_context_provider.cc
diff --git a/android_webview/browser/aw_render_thread_context_provider.cc b/android_webview/browser/aw_render_thread_context_provider.cc
index 563bce645e62410116bdd81e8381e7dad44bfa0f..a3ed6c8d22578281e1f9febe15c8b11ed9fee0b8 100644
--- a/android_webview/browser/aw_render_thread_context_provider.cc
+++ b/android_webview/browser/aw_render_thread_context_provider.cc
@@ -6,12 +6,15 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
+#include "base/command_line.h"
#include "base/lazy_instance.h"
#include "base/trace_event/trace_event.h"
#include "cc/output/context_cache_controller.h"
#include "cc/output/managed_memory_policy.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
+#include "gpu/command_buffer/client/gles2_trace_implementation.h"
+#include "gpu/command_buffer/client/gpu_switches.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/ipc/gl_in_process_context.h"
#include "gpu/skia_bindings/gl_bindings_skia_cmd_buffer.h"
@@ -69,6 +72,14 @@ AwRenderThreadContextProvider::AwRenderThreadContextProvider(
context_->GetImplementation()->SetLostContextCallback(base::Bind(
&AwRenderThreadContextProvider::OnLostContext, base::Unretained(this)));
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGpuClientTracing)) {
+ // This wraps the real GLES2Implementation and we should always use this
+ // instead when it's present.
+ trace_impl_.reset(new gpu::gles2::GLES2TraceImplementation(
+ context_->GetImplementation()));
+ }
+
cache_controller_.reset(
new cc::ContextCacheController(context_->GetImplementation(), nullptr));
}
@@ -98,7 +109,8 @@ gpu::Capabilities AwRenderThreadContextProvider::ContextCapabilities() {
gpu::gles2::GLES2Interface* AwRenderThreadContextProvider::ContextGL() {
DCHECK(main_thread_checker_.CalledOnValidThread());
-
+ if (trace_impl_)
+ return trace_impl_.get();
return context_->GetImplementation();
}
« no previous file with comments | « android_webview/browser/aw_render_thread_context_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698