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

Unified Diff: content/browser/renderer_host/render_widget_host_impl.cc

Issue 634313002: Add mouse input forwarding to gpu service (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add Security Test Created 6 years, 1 month 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/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() {

Powered by Google App Engine
This is Rietveld 408576698