diff options
author | dnicoara@chromium.org <dnicoara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-28 18:40:28 +0000 |
---|---|---|
committer | dnicoara@chromium.org <dnicoara@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-28 18:40:28 +0000 |
commit | b9e9033c0c663d555475abbc18949079c94c4cf9 (patch) | |
tree | 66a31f308f9148f90abfb7fc2f48f7d03575e867 /ui/display/chromeos | |
parent | 64855b0398e677321127b38ded175a2ca10f1853 (diff) | |
download | chromium_src-b9e9033c0c663d555475abbc18949079c94c4cf9.zip chromium_src-b9e9033c0c663d555475abbc18949079c94c4cf9.tar.gz chromium_src-b9e9033c0c663d555475abbc18949079c94c4cf9.tar.bz2 |
Add Ozone stub implementations for NativeDisplayDelegate and TouchscreenDelegate
As a first step, I'm introducing stub implementations such that the Ozone path
can be exercised. In future CLs I plan on removing ifdefs limiting the use of
OutputConfigurator to X11 and add actual functionality to the delegates.
BUG=333413
Review URL: https://codereview.chromium.org/214513006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@260214 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/display/chromeos')
5 files changed, 222 insertions, 1 deletions
diff --git a/ui/display/chromeos/output_configurator.cc b/ui/display/chromeos/output_configurator.cc index 255e4b9..9523afe 100644 --- a/ui/display/chromeos/output_configurator.cc +++ b/ui/display/chromeos/output_configurator.cc @@ -12,8 +12,15 @@ #include "base/time/time.h" #include "ui/display/chromeos/display_mode.h" #include "ui/display/chromeos/display_snapshot.h" +#include "ui/display/chromeos/native_display_delegate.h" + +#if defined(USE_OZONE) +#include "ui/display/chromeos/ozone/native_display_delegate_ozone.h" +#include "ui/display/chromeos/ozone/touchscreen_delegate_ozone.h" +#elif defined(USE_X11) #include "ui/display/chromeos/x11/native_display_delegate_x11.h" #include "ui/display/chromeos/x11/touchscreen_delegate_x11.h" +#endif namespace ui { @@ -189,12 +196,25 @@ void OutputConfigurator::Init(bool is_panel_fitting_enabled) { return; if (!native_display_delegate_) { +#if defined(USE_OZONE) + native_display_delegate_.reset(new NativeDisplayDelegateOzone()); +#elif defined(USE_X11) native_display_delegate_.reset(new NativeDisplayDelegateX11()); +#else + NOTREACHED(); +#endif native_display_delegate_->AddObserver(this); } - if (!touchscreen_delegate_) + if (!touchscreen_delegate_) { +#if defined(USE_OZONE) + touchscreen_delegate_.reset(new TouchscreenDelegateOzone()); +#elif defined(USE_X11) touchscreen_delegate_.reset(new TouchscreenDelegateX11()); +#else + NOTREACHED(); +#endif + } } void OutputConfigurator::ForceInitialConfigure(uint32_t background_color_argb) { diff --git a/ui/display/chromeos/ozone/native_display_delegate_ozone.cc b/ui/display/chromeos/ozone/native_display_delegate_ozone.cc new file mode 100644 index 0000000..f9dc678 --- /dev/null +++ b/ui/display/chromeos/ozone/native_display_delegate_ozone.cc @@ -0,0 +1,95 @@ +// Copyright 2014 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 "ui/display/chromeos/ozone/native_display_delegate_ozone.h" + +#include "base/logging.h" + +namespace ui { + +NativeDisplayDelegateOzone::NativeDisplayDelegateOzone() {} + +NativeDisplayDelegateOzone::~NativeDisplayDelegateOzone() {} + +void NativeDisplayDelegateOzone::Initialize() { + NOTIMPLEMENTED(); +} + +void NativeDisplayDelegateOzone::GrabServer() { + NOTIMPLEMENTED(); +} + +void NativeDisplayDelegateOzone::UngrabServer() { + NOTIMPLEMENTED(); +} + +void NativeDisplayDelegateOzone::SyncWithServer() { + NOTIMPLEMENTED(); +} + +void NativeDisplayDelegateOzone::SetBackgroundColor(uint32_t color_argb) { + NOTIMPLEMENTED(); +} + +void NativeDisplayDelegateOzone::ForceDPMSOn() { + NOTIMPLEMENTED(); +} + +std::vector<ui::DisplaySnapshot*> NativeDisplayDelegateOzone::GetOutputs() { + NOTIMPLEMENTED(); + return std::vector<ui::DisplaySnapshot*>(); +} + +void NativeDisplayDelegateOzone::AddMode(const ui::DisplaySnapshot& output, + const ui::DisplayMode* mode) { + NOTIMPLEMENTED(); +} + +bool NativeDisplayDelegateOzone::Configure(const ui::DisplaySnapshot& output, + const ui::DisplayMode* mode, + const gfx::Point& origin) { + NOTIMPLEMENTED(); + return false; +} + +void NativeDisplayDelegateOzone::CreateFrameBuffer(const gfx::Size& size) { + NOTIMPLEMENTED(); +} + +bool NativeDisplayDelegateOzone::GetHDCPState(const ui::DisplaySnapshot& output, + ui::HDCPState* state) { + NOTIMPLEMENTED(); + return false; +} + +bool NativeDisplayDelegateOzone::SetHDCPState(const ui::DisplaySnapshot& output, + ui::HDCPState state) { + NOTIMPLEMENTED(); + return false; +} + +std::vector<ui::ColorCalibrationProfile> +NativeDisplayDelegateOzone::GetAvailableColorCalibrationProfiles( + const ui::DisplaySnapshot& output) { + NOTIMPLEMENTED(); + return std::vector<ui::ColorCalibrationProfile>(); +} + +bool NativeDisplayDelegateOzone::SetColorCalibrationProfile( + const ui::DisplaySnapshot& output, + ui::ColorCalibrationProfile new_profile) { + NOTIMPLEMENTED(); + return false; +} + +void NativeDisplayDelegateOzone::AddObserver(NativeDisplayObserver* observer) { + NOTIMPLEMENTED(); +} + +void NativeDisplayDelegateOzone::RemoveObserver( + NativeDisplayObserver* observer) { + NOTIMPLEMENTED(); +} + +} // namespace ui diff --git a/ui/display/chromeos/ozone/native_display_delegate_ozone.h b/ui/display/chromeos/ozone/native_display_delegate_ozone.h new file mode 100644 index 0000000..1519b852 --- /dev/null +++ b/ui/display/chromeos/ozone/native_display_delegate_ozone.h @@ -0,0 +1,51 @@ +// Copyright 2014 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 UI_DISPLAY_CHROMEOS_OZONE_NATIVE_DISPLAY_DELEGATE_OZONE_H_ +#define UI_DISPLAY_CHROMEOS_OZONE_NATIVE_DISPLAY_DELEGATE_OZONE_H_ + +#include "base/macros.h" +#include "ui/display/chromeos/native_display_delegate.h" + +namespace ui { + +class NativeDisplayDelegateOzone : public NativeDisplayDelegate { + public: + NativeDisplayDelegateOzone(); + virtual ~NativeDisplayDelegateOzone(); + + // NativeDisplayDelegate overrides: + virtual void Initialize() OVERRIDE; + virtual void GrabServer() OVERRIDE; + virtual void UngrabServer() OVERRIDE; + virtual void SyncWithServer() OVERRIDE; + virtual void SetBackgroundColor(uint32_t color_argb) OVERRIDE; + virtual void ForceDPMSOn() OVERRIDE; + virtual std::vector<ui::DisplaySnapshot*> GetOutputs() OVERRIDE; + virtual void AddMode(const ui::DisplaySnapshot& output, + const ui::DisplayMode* mode) OVERRIDE; + virtual bool Configure(const ui::DisplaySnapshot& output, + const ui::DisplayMode* mode, + const gfx::Point& origin) OVERRIDE; + virtual void CreateFrameBuffer(const gfx::Size& size) OVERRIDE; + virtual bool GetHDCPState(const ui::DisplaySnapshot& output, + ui::HDCPState* state) OVERRIDE; + virtual bool SetHDCPState(const ui::DisplaySnapshot& output, + ui::HDCPState state) OVERRIDE; + virtual std::vector<ui::ColorCalibrationProfile> + GetAvailableColorCalibrationProfiles( + const ui::DisplaySnapshot& output) OVERRIDE; + virtual bool SetColorCalibrationProfile( + const ui::DisplaySnapshot& output, + ui::ColorCalibrationProfile new_profile) OVERRIDE; + virtual void AddObserver(NativeDisplayObserver* observer) OVERRIDE; + virtual void RemoveObserver(NativeDisplayObserver* observer) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(NativeDisplayDelegateOzone); +}; + +} // namespace ui + +#endif // UI_DISPLAY_CHROMEOS_OZONE_NATIVE_DISPLAY_DELEGATE_OZONE_H_ diff --git a/ui/display/chromeos/ozone/touchscreen_delegate_ozone.cc b/ui/display/chromeos/ozone/touchscreen_delegate_ozone.cc new file mode 100644 index 0000000..f25f359 --- /dev/null +++ b/ui/display/chromeos/ozone/touchscreen_delegate_ozone.cc @@ -0,0 +1,24 @@ +// Copyright 2014 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 "ui/display/chromeos/ozone/touchscreen_delegate_ozone.h" + +namespace ui { + +TouchscreenDelegateOzone::TouchscreenDelegateOzone() {} + +TouchscreenDelegateOzone::~TouchscreenDelegateOzone() {} + +void TouchscreenDelegateOzone::AssociateTouchscreens( + std::vector<OutputConfigurator::DisplayState>* outputs) { + NOTIMPLEMENTED(); +} + +void TouchscreenDelegateOzone::ConfigureCTM( + int touch_device_id, + const OutputConfigurator::CoordinateTransformation& ctm) { + NOTIMPLEMENTED(); +} + +} // namespace ui diff --git a/ui/display/chromeos/ozone/touchscreen_delegate_ozone.h b/ui/display/chromeos/ozone/touchscreen_delegate_ozone.h new file mode 100644 index 0000000..f9fd34a --- /dev/null +++ b/ui/display/chromeos/ozone/touchscreen_delegate_ozone.h @@ -0,0 +1,31 @@ +// Copyright 2014 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 UI_DISPLAY_CHROMEOS_OZONE_TOUCHSCREEN_DELEGATE_OZONE_H_ +#define UI_DISPLAY_CHROMEOS_OZONE_TOUCHSCREEN_DELEGATE_OZONE_H_ + +#include "ui/display/chromeos/output_configurator.h" + +namespace ui { + +class TouchscreenDelegateOzone + : public OutputConfigurator::TouchscreenDelegate { + public: + TouchscreenDelegateOzone(); + virtual ~TouchscreenDelegateOzone(); + + // OutputConfigurator::TouchscreenDelegate overrides: + virtual void AssociateTouchscreens( + std::vector<OutputConfigurator::DisplayState>* outputs) OVERRIDE; + virtual void ConfigureCTM( + int touch_device_id, + const OutputConfigurator::CoordinateTransformation& ctm) OVERRIDE; + + private: + DISALLOW_COPY_AND_ASSIGN(TouchscreenDelegateOzone); +}; + +} // namespace ui + +#endif // UI_DISPLAY_CHROMEOS_OZONE_TOUCHSCREEN_DELEGATE_OZONE_H_ |