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

Unified Diff: content/renderer/render_thread_impl.cc

Issue 1949023005: gpu: Add flag for enabling asynchronous worker context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « content/renderer/pepper/ppb_graphics_3d_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.cc
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index dc7816243edad78236b0114e406143c2b3969251..a7576b278a25ee452e86d646098dc7c90e127f36 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -402,7 +402,9 @@ void StringToUintVector(const std::string& str, std::vector<unsigned>* vector) {
scoped_refptr<ContextProviderCommandBuffer> CreateOffscreenContext(
scoped_refptr<gpu::GpuChannelHost> gpu_channel_host,
- command_buffer_metrics::ContextType type) {
+ command_buffer_metrics::ContextType type,
+ int32_t stream_id,
+ gpu::GpuStreamPriority stream_priority) {
DCHECK(gpu_channel_host);
// This is used to create a few different offscreen contexts:
// - The shared main thread context (offscreen) used by blink for canvas.
@@ -417,13 +419,13 @@ scoped_refptr<ContextProviderCommandBuffer> CreateOffscreenContext(
attributes.sample_buffers = 0;
attributes.bind_generates_resource = false;
attributes.lose_context_when_out_of_memory = true;
- constexpr bool automatic_flushes = false;
+ const bool automatic_flushes = false;
return make_scoped_refptr(new ContextProviderCommandBuffer(
base::WrapUnique(new WebGraphicsContext3DCommandBufferImpl(
gpu::kNullSurfaceHandle,
GURL("chrome://gpu/RenderThreadImpl::CreateOffscreenContext"),
std::move(gpu_channel_host), gfx::PreferIntegratedGpu,
- automatic_flushes)),
+ automatic_flushes, stream_id, stream_priority)),
gpu::SharedMemoryLimits(), attributes, nullptr, type));
}
@@ -1448,7 +1450,8 @@ RenderThreadImpl::SharedMainThreadContextProvider() {
shared_main_thread_contexts_ = CreateOffscreenContext(
std::move(gpu_channel_host),
- command_buffer_metrics::RENDERER_MAINTHREAD_CONTEXT);
+ command_buffer_metrics::RENDERER_MAINTHREAD_CONTEXT,
+ gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL);
if (!shared_main_thread_contexts_->BindToCurrentThread())
shared_main_thread_contexts_ = nullptr;
return shared_main_thread_contexts_;
@@ -1945,9 +1948,18 @@ RenderThreadImpl::SharedWorkerContextProvider() {
return shared_worker_context_provider_;
}
+ int32_t stream_id = gpu::GPU_STREAM_DEFAULT;
+ gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL;
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableGpuAsyncWorkerContext)) {
piman 2016/05/04 21:45:06 For this to work, you need to propagate the flag t
+ stream_id = gpu_channel_host->GenerateStreamID();
+ stream_priority = gpu::GpuStreamPriority::LOW;
+ }
+
shared_worker_context_provider_ =
CreateOffscreenContext(std::move(gpu_channel_host),
- command_buffer_metrics::RENDER_WORKER_CONTEXT);
+ command_buffer_metrics::RENDER_WORKER_CONTEXT,
+ stream_id, stream_priority);
if (!shared_worker_context_provider_->BindToCurrentThread())
shared_worker_context_provider_ = nullptr;
if (shared_worker_context_provider_)
« no previous file with comments | « content/renderer/pepper/ppb_graphics_3d_impl.cc ('k') | content/renderer/render_widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698