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

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

Issue 889063002: (not for commit) Create 2nd ContextProvider for Ganesh rasterization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
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 c836a99029e8db4cafb47b906c931f0c8c5e53b4..edd7696e5988338718183c14e4d89b941d18017a 100644
--- a/content/common/gpu/client/context_provider_command_buffer.cc
+++ b/content/common/gpu/client/context_provider_command_buffer.cc
@@ -79,14 +79,14 @@ WebGraphicsContext3DCommandBufferImpl*
ContextProviderCommandBuffer::WebContext3D() {
DCHECK(context3d_);
DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
return context3d_.get();
}
bool ContextProviderCommandBuffer::BindToCurrentThread() {
// This is called on the thread the context will be used.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
if (lost_context_callback_proxy_)
return true;
@@ -107,10 +107,15 @@ bool ContextProviderCommandBuffer::BindToCurrentThread() {
return true;
}
+void ContextProviderCommandBuffer::RebindToCurrentThread() {
+ context_thread_checker_.DetachFromThread();
+ context_thread_checker_.CalledOnValidThread();
+}
+
gpu::gles2::GLES2Interface* ContextProviderCommandBuffer::ContextGL() {
DCHECK(context3d_);
DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ // CHECK(context_thread_checker_.CalledOnValidThread());
return context3d_->GetImplementation();
}
@@ -121,7 +126,7 @@ gpu::ContextSupport* ContextProviderCommandBuffer::ContextSupport() {
class GrContext* ContextProviderCommandBuffer::GrContext() {
DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
return gr_context_->get();
@@ -134,35 +139,35 @@ class GrContext* ContextProviderCommandBuffer::GrContext() {
cc::ContextProvider::Capabilities
ContextProviderCommandBuffer::ContextCapabilities() {
DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
return capabilities_;
}
bool ContextProviderCommandBuffer::IsContextLost() {
DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
return context3d_->isContextLost();
}
void ContextProviderCommandBuffer::VerifyContexts() {
DCHECK(lost_context_callback_proxy_); // Is bound to thread.
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
if (context3d_->isContextLost())
OnLostContext();
}
void ContextProviderCommandBuffer::DeleteCachedResources() {
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
if (gr_context_)
gr_context_->FreeGpuResources();
}
void ContextProviderCommandBuffer::OnLostContext() {
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
{
base::AutoLock lock(main_thread_lock_);
if (destroyed_)
@@ -177,7 +182,7 @@ void ContextProviderCommandBuffer::OnLostContext() {
void ContextProviderCommandBuffer::OnMemoryAllocationChanged(
const gpu::MemoryAllocation& allocation) {
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
if (memory_policy_changed_callback_.is_null())
return;
@@ -206,7 +211,7 @@ bool ContextProviderCommandBuffer::DestroyedOnMainThread() {
void ContextProviderCommandBuffer::SetLostContextCallback(
const LostContextCallback& lost_context_callback) {
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
DCHECK(lost_context_callback_.is_null() ||
lost_context_callback.is_null());
lost_context_callback_ = lost_context_callback;
@@ -214,7 +219,7 @@ void ContextProviderCommandBuffer::SetLostContextCallback(
void ContextProviderCommandBuffer::SetMemoryPolicyChangedCallback(
const MemoryPolicyChangedCallback& memory_policy_changed_callback) {
- DCHECK(context_thread_checker_.CalledOnValidThread());
+ CHECK(context_thread_checker_.CalledOnValidThread());
DCHECK(memory_policy_changed_callback_.is_null() ||
memory_policy_changed_callback.is_null());
memory_policy_changed_callback_ = memory_policy_changed_callback;
« no previous file with comments | « content/common/gpu/client/context_provider_command_buffer.h ('k') | content/renderer/gpu/compositor_output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698