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

Side by Side Diff: chromecast/graphics/cast_screen.cc

Issue 2361283002: Add GetDisplayWithDisplayId to display::Screen. (Closed)
Patch Set: ref, test, etc Created 4 years, 2 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "chromecast/graphics/cast_screen.h" 5 #include "chromecast/graphics/cast_screen.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "chromecast/public/graphics_properties_shlib.h" 10 #include "chromecast/public/graphics_properties_shlib.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 } 52 }
53 53
54 int CastScreen::GetNumDisplays() const { 54 int CastScreen::GetNumDisplays() const {
55 return 1; 55 return 1;
56 } 56 }
57 57
58 std::vector<display::Display> CastScreen::GetAllDisplays() const { 58 std::vector<display::Display> CastScreen::GetAllDisplays() const {
59 return std::vector<display::Display>(1, display_); 59 return std::vector<display::Display>(1, display_);
60 } 60 }
61 61
62 bool CastScreen::GetDisplayWithDisplayId(int64_t display_id,
63 display::Display* display) const {
64 if (display_.id() == display_id) {
65 *display = display_;
66 return true;
67 }
68 return false;
69 }
70
62 display::Display CastScreen::GetDisplayNearestWindow( 71 display::Display CastScreen::GetDisplayNearestWindow(
63 gfx::NativeWindow window) const { 72 gfx::NativeWindow window) const {
64 return display_; 73 return display_;
65 } 74 }
66 75
67 display::Display CastScreen::GetDisplayNearestPoint( 76 display::Display CastScreen::GetDisplayNearestPoint(
68 const gfx::Point& point) const { 77 const gfx::Point& point) const {
69 return display_; 78 return display_;
70 } 79 }
71 80
(...skipping 11 matching lines...) Expand all
83 void CastScreen::RemoveObserver(display::DisplayObserver* observer) {} 92 void CastScreen::RemoveObserver(display::DisplayObserver* observer) {}
84 93
85 CastScreen::CastScreen() : display_(kDisplayId) { 94 CastScreen::CastScreen() : display_(kDisplayId) {
86 // Device scale factor computed relative to 720p display 95 // Device scale factor computed relative to 720p display
87 const gfx::Size size = GetScreenResolution(); 96 const gfx::Size size = GetScreenResolution();
88 const float device_scale_factor = size.height() / 720.0f; 97 const float device_scale_factor = size.height() / 720.0f;
89 display_.SetScaleAndBounds(device_scale_factor, gfx::Rect(size)); 98 display_.SetScaleAndBounds(device_scale_factor, gfx::Rect(size));
90 } 99 }
91 100
92 } // namespace chromecast 101 } // namespace chromecast
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698