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

Unified Diff: content/renderer/gpu/gpu_channel_host.h

Issue 8233027: Support dynamic switching between integrated and discrete GPUs on Mac OS X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/renderer/gpu/gpu_channel_host.h
===================================================================
--- content/renderer/gpu/gpu_channel_host.h (revision 105158)
+++ content/renderer/gpu/gpu_channel_host.h (working copy)
@@ -21,6 +21,7 @@
#include "ipc/ipc_channel_handle.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_sync_channel.h"
+#include "ui/gfx/gl/gpu_preference.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/size.h"
@@ -80,7 +81,8 @@
CommandBufferProxy* share_group,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
- const GURL& active_url);
+ const GURL& active_url,
+ gfx::GpuPreference gpu_preference);
// Create and connect to a command buffer in the GPU process.
CommandBufferProxy* CreateOffscreenCommandBuffer(
@@ -88,7 +90,8 @@
CommandBufferProxy* share_group,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
- const GURL& active_url);
+ const GURL& active_url,
+ gfx::GpuPreference gpu_preference);
// Creates a video decoder in the GPU process.
// Returned pointer is owned by the CommandBufferProxy for |route_id|.
@@ -108,6 +111,20 @@
void AddRoute(int route_id, base::WeakPtr<IPC::Channel::Listener> listener);
void RemoveRoute(int route_id);
+ // Asks the GPU process whether the creation or destruction of the
+ // given command buffer on the given GPU will provoke a switch of
+ // the GPU from integrated to discrete or vice versa. This requires
+ // all of the GL contexts in the same share group in the GPU process
+ // to be dropped.
+ bool WillGpuSwitchOccur(bool is_creating_context,
+ gfx::GpuPreference gpu_preference);
+
+ // Forcibly close the channel on the GPU process side. This will
+ // cause all command buffers on this side to soon afterward start
+ // registering lost contexts. It also has the side effect of setting
+ // the state on this side to lost.
+ void ForciblyCloseChannel();
+
private:
// An shim class for working with listeners between threads.
// It is used to post a task to the thread that owns the listener,

Powered by Google App Engine
This is Rietveld 408576698