Put different UI density levels into a enumeration
This commit is contained in:
parent
2853f7ae9b
commit
8c4c911c40
2 changed files with 46 additions and 4 deletions
39
src/anbox/graphics/density.h
Normal file
39
src/anbox/graphics/density.h
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2016 Simon Fels <morphis@gravedo.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
|
* under the terms of the GNU General Public License version 3, as published
|
||||||
|
* by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranties of
|
||||||
|
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
|
||||||
|
* PURPOSE. See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along
|
||||||
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ANBOX_GRAPHICS_DENSITY_H_
|
||||||
|
#define ANBOX_GRAPHICS_DENSITY_H_
|
||||||
|
|
||||||
|
namespace anbox {
|
||||||
|
namespace graphics {
|
||||||
|
/**
|
||||||
|
* @brief Defines different types of density being used in an Android system. See the
|
||||||
|
* documentation in frameworks/base/core/java/android/util/DisplayMetrics.java
|
||||||
|
* of the Android source tree which defines the different types.
|
||||||
|
*/
|
||||||
|
enum class DensityType {
|
||||||
|
low = 120,
|
||||||
|
medium = 160,
|
||||||
|
tv = 213,
|
||||||
|
high = 240,
|
||||||
|
xhigh = 360,
|
||||||
|
xxhigh = 480,
|
||||||
|
};
|
||||||
|
} // namespace graphics
|
||||||
|
} // namespace anbox
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -16,7 +16,8 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "anbox/qemu//boot_properties_message_processor.h"
|
#include "anbox/qemu//boot_properties_message_processor.h"
|
||||||
#include "anbox/logger.h"
|
#include "anbox/graphics/density.h"
|
||||||
|
#include "anbox/utils.h"
|
||||||
|
|
||||||
namespace anbox {
|
namespace anbox {
|
||||||
namespace qemu {
|
namespace qemu {
|
||||||
|
|
@ -31,8 +32,6 @@ BootPropertiesMessageProcessor::~BootPropertiesMessageProcessor() {
|
||||||
void BootPropertiesMessageProcessor::handle_command(const std::string &command) {
|
void BootPropertiesMessageProcessor::handle_command(const std::string &command) {
|
||||||
if (command == "list")
|
if (command == "list")
|
||||||
list_properties();
|
list_properties();
|
||||||
else
|
|
||||||
DEBUG("Unknown command '%s'", command);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BootPropertiesMessageProcessor::list_properties() {
|
void BootPropertiesMessageProcessor::list_properties() {
|
||||||
|
|
@ -55,7 +54,7 @@ void BootPropertiesMessageProcessor::list_properties() {
|
||||||
|
|
||||||
// TODO(morphis): Using HDPI here for now but should be adjusted to the device
|
// TODO(morphis): Using HDPI here for now but should be adjusted to the device
|
||||||
// we're running on.
|
// we're running on.
|
||||||
"ro.sf.lcd_density=200",
|
utils::string_format("ro.sf.lcd_density=%d", static_cast<int>(graphics::DensityType::high)),
|
||||||
|
|
||||||
// libhwui detects that we support certain GLESv3 extensions which
|
// libhwui detects that we support certain GLESv3 extensions which
|
||||||
// we don't yet support in our host channel so we have to disable
|
// we don't yet support in our host channel so we have to disable
|
||||||
|
|
@ -65,6 +64,10 @@ void BootPropertiesMessageProcessor::list_properties() {
|
||||||
// This will give us a virtual on screen navigation area at the bottom
|
// This will give us a virtual on screen navigation area at the bottom
|
||||||
// of the screen we really need to navigate through the system.
|
// of the screen we really need to navigate through the system.
|
||||||
"qemu.hw.mainkeys=0",
|
"qemu.hw.mainkeys=0",
|
||||||
|
|
||||||
|
// To let surfaceflinger load our hwcomposer implementation we specify
|
||||||
|
// the correct subkey of the module here.
|
||||||
|
// "ro.hardware.hwcomposer=anbox",
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto &prop : properties) {
|
for (const auto &prop : properties) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue