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_view_android.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 | 1340 |
1341 void RenderWidgetHostViewAndroid::SendTouchEvent( | 1341 void RenderWidgetHostViewAndroid::SendTouchEvent( |
1342 const blink::WebTouchEvent& event) { | 1342 const blink::WebTouchEvent& event) { |
1343 if (host_) | 1343 if (host_) |
1344 host_->ForwardTouchEventWithLatencyInfo(event, CreateLatencyInfo(event)); | 1344 host_->ForwardTouchEventWithLatencyInfo(event, CreateLatencyInfo(event)); |
1345 | 1345 |
1346 // Send a proactive BeginFrame on the next vsync to reduce latency. | 1346 // Send a proactive BeginFrame on the next vsync to reduce latency. |
1347 // This is good enough as long as the first touch event has Begin semantics | 1347 // This is good enough as long as the first touch event has Begin semantics |
1348 // and the actual scroll happens on the next vsync. | 1348 // and the actual scroll happens on the next vsync. |
1349 // TODO: Is this actually still needed? | 1349 // TODO: Is this actually still needed? |
1350 if (content_view_core_) { | 1350 if (content_view_core_ && observing_root_window_) { |
1351 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1351 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
1352 } | 1352 } |
1353 } | 1353 } |
1354 | 1354 |
1355 void RenderWidgetHostViewAndroid::SendMouseEvent( | 1355 void RenderWidgetHostViewAndroid::SendMouseEvent( |
1356 const blink::WebMouseEvent& event) { | 1356 const blink::WebMouseEvent& event) { |
1357 if (host_) | 1357 if (host_) |
1358 host_->ForwardMouseEvent(event); | 1358 host_->ForwardMouseEvent(event); |
1359 } | 1359 } |
1360 | 1360 |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 results->orientationAngle = display.RotationAsDegree(); | 1693 results->orientationAngle = display.RotationAsDegree(); |
1694 results->orientationType = | 1694 results->orientationType = |
1695 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1695 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1696 gfx::DeviceDisplayInfo info; | 1696 gfx::DeviceDisplayInfo info; |
1697 results->depth = info.GetBitsPerPixel(); | 1697 results->depth = info.GetBitsPerPixel(); |
1698 results->depthPerComponent = info.GetBitsPerComponent(); | 1698 results->depthPerComponent = info.GetBitsPerComponent(); |
1699 results->isMonochrome = (results->depthPerComponent == 0); | 1699 results->isMonochrome = (results->depthPerComponent == 0); |
1700 } | 1700 } |
1701 | 1701 |
1702 } // namespace content | 1702 } // namespace content |
OLD | NEW |