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

Unified Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 1963263002: Fix Mac resize, delete more Mac code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase 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/common/gpu/client/context_provider_command_buffer.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/client/context_provider_command_buffer.cc
diff --git a/content/common/gpu/client/context_provider_command_buffer.cc b/content/common/gpu/client/context_provider_command_buffer.cc
index 8bc3a03ad3c4a8e2db58be8e38a5594233e1873d..da664d68a69111cea3486bc7e483e76718143954 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -14,6 +14,7 @@
#include "base/callback_helpers.h"
#include "base/command_line.h"
#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.h"
#include "cc/output/managed_memory_policy.h"
#include "content/common/gpu/client/command_buffer_metrics.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
@@ -145,9 +146,14 @@ bool ContextProviderCommandBuffer::BindToCurrentThread() {
// This command buffer is a client-side proxy to the command buffer in the
// GPU process.
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner =
+ default_task_runner_;
+ if (!task_runner)
+ task_runner = base::ThreadTaskRunnerHandle::Get();
command_buffer_ = channel_->CreateCommandBuffer(
surface_handle_, gfx::Size(), shared_command_buffer, stream_id_,
- stream_priority_, serialized_attributes, active_url_, gpu_preference_);
+ stream_priority_, serialized_attributes, active_url_, gpu_preference_,
+ std::move(task_runner));
// The command buffer takes ownership of the |channel_|, so no need to keep
// a reference around here.
channel_ = nullptr;
@@ -283,6 +289,12 @@ void ContextProviderCommandBuffer::SetupLock() {
command_buffer_->SetLock(&context_lock_);
}
+void ContextProviderCommandBuffer::SetDefaultTaskRunner(
+ scoped_refptr<base::SingleThreadTaskRunner> default_task_runner) {
+ DCHECK(!bind_succeeded_);
+ default_task_runner_ = std::move(default_task_runner);
+}
+
base::Lock* ContextProviderCommandBuffer::GetLock() {
return &context_lock_;
}
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698