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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1332 observing_root_window_ = false; | 1332 observing_root_window_ = false; |
1333 content_view_core_->GetWindowAndroid()->RemoveObserver(this); | 1333 content_view_core_->GetWindowAndroid()->RemoveObserver(this); |
1334 } | 1334 } |
1335 | 1335 |
1336 void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time, | 1336 void RenderWidgetHostViewAndroid::SendBeginFrame(base::TimeTicks frame_time, |
1337 base::TimeDelta vsync_period) { | 1337 base::TimeDelta vsync_period) { |
1338 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SendBeginFrame", | 1338 TRACE_EVENT1("cc", "RenderWidgetHostViewAndroid::SendBeginFrame", |
1339 "frame_time_us", frame_time.ToInternalValue()); | 1339 "frame_time_us", frame_time.ToInternalValue()); |
1340 base::TimeTicks display_time = frame_time + vsync_period; | 1340 base::TimeTicks display_time = frame_time + vsync_period; |
1341 | 1341 |
1342 // TODO(brianderson): Use adaptive draw-time estimation. | |
1343 base::TimeDelta estimated_browser_composite_time = | 1342 base::TimeDelta estimated_browser_composite_time = |
brianderson
2014/09/22 22:59:35
Can get rid of this local variable now.
orglofch
2014/09/22 23:55:14
Done.
| |
1344 base::TimeDelta::FromMicroseconds( | 1343 host_->GetEstimatedBrowserCompositeTime(); |
1345 (1.0f * base::Time::kMicrosecondsPerSecond) / (3.0f * 60)); | |
1346 | 1344 |
1347 base::TimeTicks deadline = display_time - estimated_browser_composite_time; | 1345 base::TimeTicks deadline = display_time - estimated_browser_composite_time; |
1348 | 1346 |
1349 host_->Send(new ViewMsg_BeginFrame( | 1347 host_->Send(new ViewMsg_BeginFrame( |
1350 host_->GetRoutingID(), | 1348 host_->GetRoutingID(), |
1351 cc::BeginFrameArgs::Create(frame_time, deadline, vsync_period))); | 1349 cc::BeginFrameArgs::Create(frame_time, deadline, vsync_period))); |
1352 } | 1350 } |
1353 | 1351 |
1354 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { | 1352 bool RenderWidgetHostViewAndroid::Animate(base::TimeTicks frame_time) { |
1355 bool needs_animate = | 1353 bool needs_animate = |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1867 results->orientationAngle = display.RotationAsDegree(); | 1865 results->orientationAngle = display.RotationAsDegree(); |
1868 results->orientationType = | 1866 results->orientationType = |
1869 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1867 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1870 gfx::DeviceDisplayInfo info; | 1868 gfx::DeviceDisplayInfo info; |
1871 results->depth = info.GetBitsPerPixel(); | 1869 results->depth = info.GetBitsPerPixel(); |
1872 results->depthPerComponent = info.GetBitsPerComponent(); | 1870 results->depthPerComponent = info.GetBitsPerComponent(); |
1873 results->isMonochrome = (results->depthPerComponent == 0); | 1871 results->isMonochrome = (results->depthPerComponent == 0); |
1874 } | 1872 } |
1875 | 1873 |
1876 } // namespace content | 1874 } // namespace content |
OLD | NEW |