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 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 outstanding_vsync_requests_ |= requests; | 1257 outstanding_vsync_requests_ |= requests; |
1258 // Note that if we're not currently observing the root window, outstanding | 1258 // Note that if we're not currently observing the root window, outstanding |
1259 // vsync requests will be pushed if/when we resume observing in | 1259 // vsync requests will be pushed if/when we resume observing in |
1260 // |StartObservingRootWindow()|. | 1260 // |StartObservingRootWindow()|. |
1261 if (observing_root_window_ && should_request_vsync) | 1261 if (observing_root_window_ && should_request_vsync) |
1262 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); | 1262 content_view_core_->GetWindowAndroid()->RequestVSyncUpdate(); |
1263 } | 1263 } |
1264 | 1264 |
1265 void RenderWidgetHostViewAndroid::StartObservingRootWindow() { | 1265 void RenderWidgetHostViewAndroid::StartObservingRootWindow() { |
1266 DCHECK(content_view_core_); | 1266 DCHECK(content_view_core_); |
1267 DCHECK(!observing_root_window_); | 1267 if (observing_root_window_) |
| 1268 return; |
| 1269 |
1268 observing_root_window_ = true; | 1270 observing_root_window_ = true; |
1269 content_view_core_->GetWindowAndroid()->AddObserver(this); | 1271 content_view_core_->GetWindowAndroid()->AddObserver(this); |
1270 | 1272 |
1271 // Clear existing vsync requests to allow a request to the new window. | 1273 // Clear existing vsync requests to allow a request to the new window. |
1272 uint32 outstanding_vsync_requests = outstanding_vsync_requests_; | 1274 uint32 outstanding_vsync_requests = outstanding_vsync_requests_; |
1273 outstanding_vsync_requests_ = 0; | 1275 outstanding_vsync_requests_ = 0; |
1274 RequestVSyncUpdate(outstanding_vsync_requests); | 1276 RequestVSyncUpdate(outstanding_vsync_requests); |
1275 } | 1277 } |
1276 | 1278 |
1277 void RenderWidgetHostViewAndroid::StopObservingRootWindow() { | 1279 void RenderWidgetHostViewAndroid::StopObservingRootWindow() { |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1823 results->orientationAngle = display.RotationAsDegree(); | 1825 results->orientationAngle = display.RotationAsDegree(); |
1824 results->orientationType = | 1826 results->orientationType = |
1825 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1827 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
1826 gfx::DeviceDisplayInfo info; | 1828 gfx::DeviceDisplayInfo info; |
1827 results->depth = info.GetBitsPerPixel(); | 1829 results->depth = info.GetBitsPerPixel(); |
1828 results->depthPerComponent = info.GetBitsPerComponent(); | 1830 results->depthPerComponent = info.GetBitsPerComponent(); |
1829 results->isMonochrome = (results->depthPerComponent == 0); | 1831 results->isMonochrome = (results->depthPerComponent == 0); |
1830 } | 1832 } |
1831 | 1833 |
1832 } // namespace content | 1834 } // namespace content |
OLD | NEW |