Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/renderer_host/render_widget_host_impl.h" | 5 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 #include "content/common/view_messages.h" | 53 #include "content/common/view_messages.h" |
| 54 #include "content/public/browser/native_web_keyboard_event.h" | 54 #include "content/public/browser/native_web_keyboard_event.h" |
| 55 #include "content/public/browser/notification_service.h" | 55 #include "content/public/browser/notification_service.h" |
| 56 #include "content/public/browser/notification_types.h" | 56 #include "content/public/browser/notification_types.h" |
| 57 #include "content/public/browser/render_widget_host_iterator.h" | 57 #include "content/public/browser/render_widget_host_iterator.h" |
| 58 #include "content/public/browser/user_metrics.h" | 58 #include "content/public/browser/user_metrics.h" |
| 59 #include "content/public/common/content_constants.h" | 59 #include "content/public/common/content_constants.h" |
| 60 #include "content/public/common/content_switches.h" | 60 #include "content/public/common/content_switches.h" |
| 61 #include "content/public/common/result_codes.h" | 61 #include "content/public/common/result_codes.h" |
| 62 #include "content/public/common/web_preferences.h" | 62 #include "content/public/common/web_preferences.h" |
| 63 #include "gpu/command_buffer/service/gpu_switches.h" | |
| 63 #include "skia/ext/image_operations.h" | 64 #include "skia/ext/image_operations.h" |
| 64 #include "skia/ext/platform_canvas.h" | 65 #include "skia/ext/platform_canvas.h" |
| 65 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" | 66 #include "third_party/WebKit/public/web/WebCompositionUnderline.h" |
| 66 #include "ui/events/event.h" | 67 #include "ui/events/event.h" |
| 67 #include "ui/events/keycodes/keyboard_codes.h" | 68 #include "ui/events/keycodes/keyboard_codes.h" |
| 68 #include "ui/gfx/geometry/vector2d_conversions.h" | 69 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 69 #include "ui/gfx/size_conversions.h" | 70 #include "ui/gfx/size_conversions.h" |
| 70 #include "ui/gfx/skbitmap_operations.h" | 71 #include "ui/gfx/skbitmap_operations.h" |
| 71 #include "ui/snapshot/snapshot.h" | 72 #include "ui/snapshot/snapshot.h" |
| 72 | 73 |
| (...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 848 } | 849 } |
| 849 | 850 |
| 850 void RenderWidgetHostImpl::StopHangMonitorTimeout() { | 851 void RenderWidgetHostImpl::StopHangMonitorTimeout() { |
| 851 if (hang_monitor_timeout_) | 852 if (hang_monitor_timeout_) |
| 852 hang_monitor_timeout_->Stop(); | 853 hang_monitor_timeout_->Stop(); |
| 853 RendererIsResponsive(); | 854 RendererIsResponsive(); |
| 854 } | 855 } |
| 855 | 856 |
| 856 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { | 857 void RenderWidgetHostImpl::ForwardMouseEvent(const WebMouseEvent& mouse_event) { |
| 857 ForwardMouseEventWithLatencyInfo(mouse_event, ui::LatencyInfo()); | 858 ForwardMouseEventWithLatencyInfo(mouse_event, ui::LatencyInfo()); |
| 859 const base::CommandLine& command_line = | |
|
jdduke (slow)
2014/11/18 16:55:30
I'm wondering if we still want to send this messag
orglofch
2014/11/20 02:16:21
Done.
| |
| 860 *base::CommandLine::ForCurrentProcess(); | |
| 861 // Pass mouse state to gpu service if the subscribe uniform | |
| 862 // extension is enabled | |
|
Ken Russell (switch to Gerrit)
2014/11/17 23:19:32
Style nit here and throughout: please add comments
orglofch
2014/11/20 02:16:21
Done.
| |
| 863 if (command_line.HasSwitch(switches::kEnableSubscribeUniformExtension)) { | |
| 864 gpu::ValueState state; | |
| 865 state.int_value[0] = mouse_event.x; | |
| 866 state.int_value[1] = mouse_event.y; | |
| 867 GpuProcessHost::SendOnIO( | |
| 868 #if defined(OS_WIN) | |
|
Ken Russell (switch to Gerrit)
2014/11/17 23:19:32
This #ifdef is gross. Can you please figure out a
orglofch
2014/11/20 02:16:21
Done. This was unnecesarry logic, the GPU should b
| |
| 869 GpuProcessHost::GPU_PROCESS_KIND_UNSANDBOXED, | |
| 870 #else | |
| 871 GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | |
| 872 #endif | |
| 873 CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH, | |
| 874 new GpuMsg_UpdateValueState( | |
| 875 process_->GetID(), GL_MOUSE_POSITION_CHROMIUM, state)); | |
| 876 } | |
| 858 } | 877 } |
| 859 | 878 |
| 860 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( | 879 void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( |
| 861 const blink::WebMouseEvent& mouse_event, | 880 const blink::WebMouseEvent& mouse_event, |
| 862 const ui::LatencyInfo& ui_latency) { | 881 const ui::LatencyInfo& ui_latency) { |
| 863 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", | 882 TRACE_EVENT2("input", "RenderWidgetHostImpl::ForwardMouseEvent", |
| 864 "x", mouse_event.x, "y", mouse_event.y); | 883 "x", mouse_event.x, "y", mouse_event.y); |
| 865 ui::LatencyInfo::InputCoordinate logical_coordinate(mouse_event.x, | 884 ui::LatencyInfo::InputCoordinate logical_coordinate(mouse_event.x, |
| 866 mouse_event.y); | 885 mouse_event.y); |
| 867 | 886 |
| (...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2421 } | 2440 } |
| 2422 #endif | 2441 #endif |
| 2423 | 2442 |
| 2424 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { | 2443 SkColorType RenderWidgetHostImpl::PreferredReadbackFormat() { |
| 2425 if (view_) | 2444 if (view_) |
| 2426 return view_->PreferredReadbackFormat(); | 2445 return view_->PreferredReadbackFormat(); |
| 2427 return kN32_SkColorType; | 2446 return kN32_SkColorType; |
| 2428 } | 2447 } |
| 2429 | 2448 |
| 2430 } // namespace content | 2449 } // namespace content |
| OLD | NEW |