Index: content/browser/gpu/gpu_process_host.h |
diff --git a/content/browser/gpu/gpu_process_host.h b/content/browser/gpu/gpu_process_host.h |
index 145cdcccc2b9c16bfcb637e445f0cc141b1b7360..dde6213e2d53b40a48d4a91cc5db262c1ea9ec11 100644 |
--- a/content/browser/gpu/gpu_process_host.h |
+++ b/content/browser/gpu/gpu_process_host.h |
@@ -23,6 +23,7 @@ |
#include "content/public/browser/browser_child_process_host_delegate.h" |
#include "content/public/browser/gpu_data_manager.h" |
#include "gpu/command_buffer/common/constants.h" |
+#include "gpu/command_buffer/common/value_state.h" |
#include "gpu/config/gpu_info.h" |
#include "ipc/ipc_sender.h" |
#include "ipc/message_filter.h" |
@@ -86,6 +87,9 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, |
CauseForGpuLaunch cause, |
IPC::Message* message); |
+ CONTENT_EXPORT static void SendUpdateValueStateOnIO( |
Tom Sepez
2014/12/04 22:08:10
nit: I'd prefer if this were named SendUpdateValue
orglofch
2014/12/04 23:37:10
Done.
|
+ int client_id, unsigned int target, const gpu::ValueState& state); |
+ |
CONTENT_EXPORT static void RegisterGpuMainThreadFactory( |
GpuMainThreadFactoryFunction create); |
@@ -142,6 +146,10 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, |
void EndFrameSubscription(int surface_id); |
void LoadedShader(const std::string& key, const std::string& data); |
+ void SendUpdateValueState(int client_id, |
+ unsigned int target, |
+ const gpu::ValueState& state); |
+ |
private: |
static bool ValidateHost(GpuProcessHost* host); |
@@ -179,6 +187,8 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, |
void OnDestroyChannel(int32 client_id); |
void OnCacheShader(int32 client_id, const std::string& key, |
const std::string& shader); |
+ void OnAddSubscription(unsigned int target); |
+ void OnRemoveSubscription(unsigned int target); |
bool LaunchGpuProcess(const std::string& channel_id); |
@@ -276,6 +286,12 @@ class GpuProcessHost : public BrowserChildProcessHostDelegate, |
SurfaceRefMap; |
SurfaceRefMap surface_refs_; |
+ // This is a set of all subscription targets valuebuffers in the GPU process |
+ // are currently subscribed too. Used to prevent sending unnecessary |
+ // ValueState updates. |
+ typedef base::hash_set<unsigned int> SubscriptionSet; |
+ SubscriptionSet subscription_set_; |
+ |
DISALLOW_COPY_AND_ASSIGN(GpuProcessHost); |
}; |