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

Side by Side Diff: ui/display/android/screen_android.cc

Issue 2151563002: Add the fields bits-per-pixel and bits-per-component to Display. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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 | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | ui/display/display.h » ('j') | 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 "ui/display/screen.h" 5 #include "ui/display/screen.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "ui/display/display.h" 9 #include "ui/display/display.h"
10 #include "ui/gfx/android/device_display_info.h" 10 #include "ui/gfx/android/device_display_info.h"
(...skipping 29 matching lines...) Expand all
40 : device_info.GetDisplayWidth(), 40 : device_info.GetDisplayWidth(),
41 device_info.GetPhysicalDisplayHeight() 41 device_info.GetPhysicalDisplayHeight()
42 ? device_info.GetPhysicalDisplayHeight() 42 ? device_info.GetPhysicalDisplayHeight()
43 : device_info.GetDisplayHeight()); 43 : device_info.GetDisplayHeight());
44 const gfx::Rect bounds_in_dip = gfx::Rect(gfx::ScaleToCeiledSize( 44 const gfx::Rect bounds_in_dip = gfx::Rect(gfx::ScaleToCeiledSize(
45 bounds_in_pixels.size(), 1.0f / device_scale_factor)); 45 bounds_in_pixels.size(), 1.0f / device_scale_factor));
46 Display display(0, bounds_in_dip); 46 Display display(0, bounds_in_dip);
47 if (!Display::HasForceDeviceScaleFactor()) 47 if (!Display::HasForceDeviceScaleFactor())
48 display.set_device_scale_factor(device_scale_factor); 48 display.set_device_scale_factor(device_scale_factor);
49 display.SetRotationAsDegree(device_info.GetRotationDegrees()); 49 display.SetRotationAsDegree(device_info.GetRotationDegrees());
50 display.set_color_depth(device_info.GetBitsPerPixel());
51 display.set_depth_per_component(device_info.GetBitsPerComponent());
50 return display; 52 return display;
51 } 53 }
52 54
53 Display GetDisplayNearestWindow(gfx::NativeView view) const override { 55 Display GetDisplayNearestWindow(gfx::NativeView view) const override {
54 return GetPrimaryDisplay(); 56 return GetPrimaryDisplay();
55 } 57 }
56 58
57 Display GetDisplayNearestPoint(const gfx::Point& point) const override { 59 Display GetDisplayNearestPoint(const gfx::Point& point) const override {
58 return GetPrimaryDisplay(); 60 return GetPrimaryDisplay();
59 } 61 }
(...skipping 18 matching lines...) Expand all
78 80
79 private: 81 private:
80 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid); 82 DISALLOW_COPY_AND_ASSIGN(ScreenAndroid);
81 }; 83 };
82 84
83 Screen* CreateNativeScreen() { 85 Screen* CreateNativeScreen() {
84 return new ScreenAndroid; 86 return new ScreenAndroid;
85 } 87 }
86 88
87 } // namespace display 89 } // namespace display
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_android.cc ('k') | ui/display/display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698