summaryrefslogtreecommitdiffstats
path: root/chromecast
diff options
context:
space:
mode:
authorhalliwell <halliwell@chromium.org>2015-04-14 14:15:49 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-14 21:16:25 +0000
commitf9ed5e4c06176226d31216dd995b9a45f411d831 (patch)
tree1506dda28ca8fc891d27a35704e565d51cb6b377 /chromecast
parentc3cfb9cac0470cc09c369e58c7623b45cb7004e0 (diff)
downloadchromium_src-f9ed5e4c06176226d31216dd995b9a45f411d831.zip
chromium_src-f9ed5e4c06176226d31216dd995b9a45f411d831.tar.gz
chromium_src-f9ed5e4c06176226d31216dd995b9a45f411d831.tar.bz2
Adds new chromecast/public API for display resolution queries
This is to replace the old static "Is1080pAllowed" API. BUG= Review URL: https://codereview.chromium.org/1080833002 Cr-Commit-Position: refs/heads/master@{#325122}
Diffstat (limited to 'chromecast')
-rw-r--r--chromecast/chromecast.gyp4
-rw-r--r--chromecast/graphics/cast_egl_platform_default.cc5
-rw-r--r--chromecast/graphics/graphics_properties_default.cc15
-rw-r--r--chromecast/public/cast_egl_platform.h9
-rw-r--r--chromecast/public/graphics_properties_shlib.h32
5 files changed, 53 insertions, 12 deletions
diff --git a/chromecast/chromecast.gyp b/chromecast/chromecast.gyp
index 82d885d..c5ad4fb 100644
--- a/chromecast/chromecast.gyp
+++ b/chromecast/chromecast.gyp
@@ -36,6 +36,7 @@
'public/cast_egl_platform.h',
'public/cast_egl_platform_shlib.h',
'public/chromecast_export.h',
+ 'public/graphics_properties_shlib.h'
],
},
# TODO(gunsch): Remove this fake target once it's either added or no
@@ -584,7 +585,8 @@
'cast_public_api'
],
'sources': [
- 'graphics/cast_egl_platform_default.cc'
+ 'graphics/cast_egl_platform_default.cc',
+ 'graphics/graphics_properties_default.cc'
],
}
]
diff --git a/chromecast/graphics/cast_egl_platform_default.cc b/chromecast/graphics/cast_egl_platform_default.cc
index 6142d14..3cb9a1b 100644
--- a/chromecast/graphics/cast_egl_platform_default.cc
+++ b/chromecast/graphics/cast_egl_platform_default.cc
@@ -12,7 +12,6 @@ namespace {
class EglPlatformDefault : public CastEglPlatform {
public:
~EglPlatformDefault() override {}
- Size GetDefaultDisplaySize() const override { return Size(1, 1); }
const int* GetEGLSurfaceProperties(const int* desired) override {
return desired;
}
@@ -34,8 +33,8 @@ class EglPlatformDefault : public CastEglPlatform {
} // namespace
-CastEglPlatform*
-CastEglPlatformShlib::Create(const std::vector<std::string>& argv) {
+CastEglPlatform* CastEglPlatformShlib::Create(
+ const std::vector<std::string>& argv) {
return new EglPlatformDefault();
}
diff --git a/chromecast/graphics/graphics_properties_default.cc b/chromecast/graphics/graphics_properties_default.cc
new file mode 100644
index 0000000..200c6cc
--- /dev/null
+++ b/chromecast/graphics/graphics_properties_default.cc
@@ -0,0 +1,15 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/public/graphics_properties_shlib.h"
+
+namespace chromecast {
+
+bool GraphicsPropertiesShlib::IsSupported(
+ Resolution resolution,
+ const std::vector<std::string>& argv) {
+ return true;
+}
+
+} // namespace chromecast
diff --git a/chromecast/public/cast_egl_platform.h b/chromecast/public/cast_egl_platform.h
index 2255e46..c93bd0f 100644
--- a/chromecast/public/cast_egl_platform.h
+++ b/chromecast/public/cast_egl_platform.h
@@ -12,11 +12,8 @@ namespace chromecast {
// to OzonePlatformCast to create a complete Ozone implementation.
class CastEglPlatform {
public:
-
struct Size {
- Size(int w, int h)
- : width(w),
- height(h) {}
+ Size(int w, int h) : width(w), height(h) {}
const int width;
const int height;
};
@@ -27,10 +24,6 @@ class CastEglPlatform {
virtual ~CastEglPlatform() {}
- // Default display size is used for initial display and also as a minimum
- // resolution for applications.
- virtual Size GetDefaultDisplaySize() const = 0;
-
// Returns an array of EGL properties, which can be used in any EGL function
// used to select a display configuration. Note that all properties should be
// immediately followed by the corresponding desired value and array should be
diff --git a/chromecast/public/graphics_properties_shlib.h b/chromecast/public/graphics_properties_shlib.h
new file mode 100644
index 0000000..693a7c1c
--- /dev/null
+++ b/chromecast/public/graphics_properties_shlib.h
@@ -0,0 +1,32 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROMECAST_PUBLIC_GRAPHICS_PROPERTIES_SHLIB_H_
+#define CHROMECAST_PUBLIC_GRAPHICS_PROPERTIES_SHLIB_H_
+
+#include <string>
+#include <vector>
+
+#include "chromecast_export.h"
+
+namespace chromecast {
+
+class CHROMECAST_EXPORT GraphicsPropertiesShlib {
+ public:
+ // Optional resolutions that cast_shell queries for. 720p (1280x720) is
+ // assumed to be supported.
+ enum Resolution {
+ k1080p, // 1920x1080
+ kUHDTV // 3840x2160
+ };
+
+ // Returns whether or not the given display resolution is supported.
+ // Called in the browser process; command line args are provided.
+ static bool IsSupported(Resolution resolution,
+ const std::vector<std::string>& argv);
+};
+
+} // namespace chromecast
+
+#endif // CHROMECAST_PUBLIC_GRAPHICS_PROPERTIES_SHLIB_H_