| 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/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 1301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1312 | 1312 |
| 1313 if (!observing_root_window_) | 1313 if (!observing_root_window_) |
| 1314 return; | 1314 return; |
| 1315 | 1315 |
| 1316 observing_root_window_ = false; | 1316 observing_root_window_ = false; |
| 1317 content_view_core_->GetWindowAndroid()->RemoveObserver(this); | 1317 content_view_core_->GetWindowAndroid()->RemoveObserver(this); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time, | 1320 void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time, |
| 1321 base::TimeDelta vsync_period) { | 1321 base::TimeDelta vsync_period) { |
| 1322 TRACE_EVENT0("cc", "RenderWidgetHostViewAndroid::SendBeginFrame"); | 1322 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SendBeginFrame", |
| 1323 "frame_time_us", frame_time.ToInternalValue()); |
| 1323 base::TimeTicks display_time = frame_time + vsync_period; | 1324 base::TimeTicks display_time = frame_time + vsync_period; |
| 1324 | 1325 |
| 1325 // TODO(brianderson): Use adaptive draw-time estimation. | 1326 // TODO(brianderson): Use adaptive draw-time estimation. |
| 1326 base::TimeDelta estimated_browser_composite_time = | 1327 base::TimeDelta estimated_browser_composite_time = |
| 1327 base::TimeDelta::FromMicroseconds( | 1328 base::TimeDelta::FromMicroseconds( |
| 1328 (1.0f * base::Time::kMicrosecondsPerSecond) / (3.0f * 60)); | 1329 (1.0f * base::Time::kMicrosecondsPerSecond) / (3.0f * 60)); |
| 1329 | 1330 |
| 1330 base::TimeTicks deadline = display_time - estimated_browser_composite_time; | 1331 base::TimeTicks deadline = display_time - estimated_browser_composite_time; |
| 1331 | 1332 |
| 1332 host_->Send(new ViewMsg_BeginFrame( | 1333 host_->Send(new ViewMsg_BeginFrame( |
| (...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 results->orientationAngle = display.RotationAsDegree(); | 1851 results->orientationAngle = display.RotationAsDegree(); |
| 1851 results->orientationType = | 1852 results->orientationType = |
| 1852 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1853 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1853 gfx::DeviceDisplayInfo info; | 1854 gfx::DeviceDisplayInfo info; |
| 1854 results->depth = info.GetBitsPerPixel(); | 1855 results->depth = info.GetBitsPerPixel(); |
| 1855 results->depthPerComponent = info.GetBitsPerComponent(); | 1856 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1856 results->isMonochrome = (results->depthPerComponent == 0); | 1857 results->isMonochrome = (results->depthPerComponent == 0); |
| 1857 } | 1858 } |
| 1858 | 1859 |
| 1859 } // namespace content | 1860 } // namespace content |
| OLD | NEW |