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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 11434072: Send notification from GPU process to browser process of offscreen context creation and destruction… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Worked around stupid compilers. Created 8 years 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/browser/gpu/gpu_process_host.cc ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 61b1822058456b62359a74e8f2b150814c64c3ae..e2f1e1501f2e5d86ba90c53f6f6a77c72890a384 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -301,6 +301,12 @@ bool GpuCommandBufferStub::MakeCurrent() {
}
void GpuCommandBufferStub::Destroy() {
+ if (handle_.is_null() && !active_url_.is_empty()) {
+ GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
+ gpu_channel_manager->Send(new GpuHostMsg_DidDestroyOffscreenContext(
+ active_url_));
+ }
+
GetMemoryManager()->RemoveClient(this);
while (!sync_points_.empty())
@@ -507,6 +513,12 @@ void GpuCommandBufferStub::OnInitialize(
GpuCommandBufferMsg_Initialize::WriteReplyParams(reply_message, true);
Send(reply_message);
+
+ if (handle_.is_null() && !active_url_.is_empty()) {
+ GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
+ gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext(
+ active_url_));
+ }
}
void GpuCommandBufferStub::OnSetGetBuffer(
@@ -583,6 +595,13 @@ void GpuCommandBufferStub::OnParseError() {
route_id_, state.context_lost_reason);
msg->set_unblock(true);
Send(msg);
+
+ // Tell the browser about this context loss as well, so it can
+ // determine whether client APIs like WebGL need to be immediately
+ // blocked from automatically running.
+ GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager();
+ gpu_channel_manager->Send(new GpuHostMsg_DidLoseContext(
+ handle_.is_null(), state.context_lost_reason, active_url_));
}
void GpuCommandBufferStub::OnGetStateFast(IPC::Message* reply_message) {
« no previous file with comments | « content/browser/gpu/gpu_process_host.cc ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698