Index: content/browser/renderer_host/render_widget_host_impl.cc |
diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc |
index 344032a75a8f43b2137907f525dbea883cdd3a7c..0f1679322793109f4b0bb3e05c8698f1eaaf5405 100644 |
--- a/content/browser/renderer_host/render_widget_host_impl.cc |
+++ b/content/browser/renderer_host/render_widget_host_impl.cc |
@@ -60,6 +60,8 @@ |
#include "content/public/common/content_switches.h" |
#include "content/public/common/result_codes.h" |
#include "content/public/common/web_preferences.h" |
+#include "gpu/GLES2/gl2extchromium.h" |
+#include "gpu/command_buffer/service/gpu_switches.h" |
#include "skia/ext/image_operations.h" |
#include "skia/ext/platform_canvas.h" |
#include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
@@ -186,6 +188,7 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
allow_privileged_mouse_lock_(false), |
has_touch_handler_(false), |
last_input_number_(static_cast<int64>(GetProcess()->GetID()) << 32), |
+ subscribe_uniform_enabled_(false), |
next_browser_snapshot_id_(1), |
browser_composite_latency_history_(kBrowserCompositeLatencyHistorySize), |
weak_factory_(this) { |
@@ -234,6 +237,10 @@ RenderWidgetHostImpl::RenderWidgetHostImpl(RenderWidgetHostDelegate* delegate, |
base::Bind(&RenderWidgetHostImpl::RendererIsUnresponsive, |
weak_factory_.GetWeakPtr()))); |
} |
+ |
+ subscribe_uniform_enabled_ = |
+ base::CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableSubscribeUniformExtension); |
} |
RenderWidgetHostImpl::~RenderWidgetHostImpl() { |
@@ -899,6 +906,21 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( |
input_router_->SendMouseEvent(MouseEventWithLatencyInfo(mouse_event, |
latency_info)); |
+ |
+ // Pass mouse state to gpu service if the subscribe uniform |
+ // extension is enabled. |
+ // TODO(orglofch): Only pass mouse information if one of the GL Contexts |
+ // is subscribed to GL_MOUSE_POSITION_CHROMIUM |
+ if (subscribe_uniform_enabled_) { |
+ gpu::ValueState state; |
+ state.int_value[0] = mouse_event.x; |
+ state.int_value[1] = mouse_event.y; |
+ GpuProcessHost::SendOnIO( |
+ GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
+ CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, |
+ new GpuMsg_UpdateValueState( |
+ process_->GetID(), GL_MOUSE_POSITION_CHROMIUM, state)); |
+ } |
} |
void RenderWidgetHostImpl::OnPointerEventActivate() { |