Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 493053004: [Android] Allow redundant |StartObservingRootWindow()| calls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make boliu@ happy Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698