Merge remote-tracking branch 'upstream/master' into android_goto_splash

This commit is contained in:
Gabriel Calero 2018-03-22 15:15:50 -03:00
commit f444766551
3 changed files with 25 additions and 44 deletions

View file

@ -11,44 +11,34 @@
import QtQuick 2.5 import QtQuick 2.5
import QtQuick.Window 2.2 import QtQuick.Window 2.2
Item { QtObject {
readonly property alias colors: colors
readonly property alias colorSchemes: colorSchemes
readonly property alias dimensions: dimensions
readonly property alias fontSizes: fontSizes
readonly property alias glyphs: glyphs
readonly property alias icons: icons
readonly property alias buttons: buttons
readonly property alias effects: effects
function glyphForIcon(icon) { function glyphForIcon(icon) {
// Translates icon enum to glyph char. // Translates icon enum to glyph char.
var glyph; var glyph;
switch (icon) { switch (icon) {
case hifi.icons.information: case icons.information:
glyph = hifi.glyphs.info; glyph = glyphs.info;
break; break;
case hifi.icons.question: case icons.question:
glyph = hifi.glyphs.question; glyph = glyphs.question;
break; break;
case hifi.icons.warning: case icons.warning:
glyph = hifi.glyphs.alert; glyph = glyphs.alert;
break; break;
case hifi.icons.critical: case icons.critical:
glyph = hifi.glyphs.error; glyph = glyphs.error;
break; break;
case hifi.icons.placemark: case icons.placemark:
glyph = hifi.glyphs.placemark; glyph = glyphs.placemark;
break; break;
default: default:
glyph = hifi.glyphs.noIcon; glyph = glyphs.noIcon;
} }
return glyph; return glyph;
} }
Item { readonly property QtObject colors: QtObject {
id: colors
// Base colors // Base colors
readonly property color baseGray: "#393939" readonly property color baseGray: "#393939"
readonly property color darkGray: "#121212" readonly property color darkGray: "#121212"
@ -134,15 +124,13 @@ Item {
readonly property color tabBackgroundLight: "#d4d4d4" readonly property color tabBackgroundLight: "#d4d4d4"
} }
Item { readonly property QtObject colorSchemes: QtObject {
id: colorSchemes
readonly property int light: 0 readonly property int light: 0
readonly property int dark: 1 readonly property int dark: 1
readonly property int faintGray: 2 readonly property int faintGray: 2
} }
Item { readonly property QtObject dimensions: QtObject {
id: dimensions
readonly property bool largeScreen: Screen.width >= 1920 && Screen.height >= 1080 readonly property bool largeScreen: Screen.width >= 1920 && Screen.height >= 1080
readonly property real borderRadius: largeScreen ? 7.5 : 5.0 readonly property real borderRadius: largeScreen ? 7.5 : 5.0
readonly property real borderWidth: largeScreen ? 2 : 1 readonly property real borderWidth: largeScreen ? 2 : 1
@ -168,8 +156,8 @@ Item {
readonly property real buttonWidth: 120 readonly property real buttonWidth: 120
} }
Item { readonly property QtObject fontSizes: QtObject {
id: fontSizes // In pixels // In pixels
readonly property real overlayTitle: dimensions.largeScreen ? 18 : 14 readonly property real overlayTitle: dimensions.largeScreen ? 18 : 14
readonly property real tabName: dimensions.largeScreen ? 12 : 10 readonly property real tabName: dimensions.largeScreen ? 12 : 10
readonly property real sectionName: dimensions.largeScreen ? 12 : 10 readonly property real sectionName: dimensions.largeScreen ? 12 : 10
@ -194,8 +182,7 @@ Item {
readonly property real disclosureButton: dimensions.largeScreen ? 30 : 22 readonly property real disclosureButton: dimensions.largeScreen ? 30 : 22
} }
Item { readonly property QtObject icons: QtObject {
id: icons
// Values per OffscreenUi::Icon // Values per OffscreenUi::Icon
readonly property int none: 0 readonly property int none: 0
readonly property int question: 1 readonly property int question: 1
@ -205,8 +192,7 @@ Item {
readonly property int placemark: 5 readonly property int placemark: 5
} }
Item { readonly property QtObject buttons: QtObject {
id: buttons
readonly property int white: 0 readonly property int white: 0
readonly property int blue: 1 readonly property int blue: 1
readonly property int red: 2 readonly property int red: 2
@ -227,12 +213,11 @@ Item {
readonly property int radius: 5 readonly property int radius: 5
} }
QtObject { readonly property QtObject effects: QtObject {
id: effects
readonly property int fadeInDuration: 300 readonly property int fadeInDuration: 300
} }
Item {
id: glyphs readonly property QtObject glyphs: QtObject {
readonly property string noIcon: "" readonly property string noIcon: ""
readonly property string hmd: "b" readonly property string hmd: "b"
readonly property string screen: "c" readonly property string screen: "c"

View file

@ -69,8 +69,7 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) {
qFatal("Offscreen surface is invalid"); qFatal("Offscreen surface is invalid");
} }
#endif #endif
#if !defined(USE_GLES)
if (gl::Context::enableDebugLogger()) { if (gl::Context::enableDebugLogger()) {
_context->makeCurrent(_offscreenSurface); _context->makeCurrent(_offscreenSurface);
QOpenGLDebugLogger *logger = new QOpenGLDebugLogger(this); QOpenGLDebugLogger *logger = new QOpenGLDebugLogger(this);
@ -80,7 +79,6 @@ bool OffscreenGLCanvas::create(QOpenGLContext* sharedContext) {
logger->startLogging(QOpenGLDebugLogger::SynchronousLogging); logger->startLogging(QOpenGLDebugLogger::SynchronousLogging);
_context->doneCurrent(); _context->doneCurrent();
} }
#endif
return true; return true;
} }

View file

@ -17,8 +17,7 @@ std::string GLBackend::getBackendShaderHeader() const {
#if defined(USE_GLES) #if defined(USE_GLES)
static const std::string header( static const std::string header(
R"SHADER( R"SHADER(#version 310 es
#version 310 es
#extension GL_EXT_texture_buffer : enable #extension GL_EXT_texture_buffer : enable
precision lowp float; // check precision 2 precision lowp float; // check precision 2
precision lowp samplerBuffer; precision lowp samplerBuffer;
@ -26,8 +25,7 @@ precision lowp sampler2DShadow;
)SHADER"); )SHADER");
#else #else
static const std::string header( static const std::string header(
R"SHADER( R"SHADER(#version 410 core
#version 410 core
)SHADER"); )SHADER");
#endif #endif