diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-01-25 11:39:07 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-25 15:20:42 +0000 |
commit | 6c91641271e536ffaa88a1dff5127e42ee99a91e (patch) | |
tree | 703d9dd49602377ddc90cbf886aad37913f2496b /chromium/ui/ozone/public | |
parent | b145b7fafd36f0c260d6a768c81fc14e32578099 (diff) | |
download | qtwebengine-chromium-6c91641271e536ffaa88a1dff5127e42ee99a91e.tar.gz |
BASELINE: Update Chromium to 49.0.2623.23
Also adds missing printing sources.
Change-Id: I3726b8f0c7d6751c9fc846096c571fadca7108cd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'chromium/ui/ozone/public')
-rw-r--r-- | chromium/ui/ozone/public/client_native_pixmap_factory.h | 11 | ||||
-rw-r--r-- | chromium/ui/ozone/public/input_controller.cc | 9 | ||||
-rw-r--r-- | chromium/ui/ozone/public/input_controller.h | 9 | ||||
-rw-r--r-- | chromium/ui/ozone/public/native_pixmap.h | 25 | ||||
-rw-r--r-- | chromium/ui/ozone/public/overlay_candidates_ozone.h | 1 | ||||
-rw-r--r-- | chromium/ui/ozone/public/ozone_gpu_test_helper.cc | 47 | ||||
-rw-r--r-- | chromium/ui/ozone/public/ozone_gpu_test_helper.h | 1 | ||||
-rw-r--r-- | chromium/ui/ozone/public/ozone_platform.h | 1 | ||||
-rw-r--r-- | chromium/ui/ozone/public/ozone_switches.h | 12 | ||||
-rw-r--r-- | chromium/ui/ozone/public/surface_factory_ozone.cc | 12 | ||||
-rw-r--r-- | chromium/ui/ozone/public/surface_factory_ozone.h | 11 | ||||
-rw-r--r-- | chromium/ui/ozone/public/surface_ozone_canvas.h | 1 | ||||
-rw-r--r-- | chromium/ui/ozone/public/surface_ozone_egl.h | 3 | ||||
-rw-r--r-- | chromium/ui/ozone/public/system_input_injector.h | 1 |
14 files changed, 96 insertions, 48 deletions
diff --git a/chromium/ui/ozone/public/client_native_pixmap_factory.h b/chromium/ui/ozone/public/client_native_pixmap_factory.h index 943547c3956..9973bf6fef1 100644 --- a/chromium/ui/ozone/public/client_native_pixmap_factory.h +++ b/chromium/ui/ozone/public/client_native_pixmap_factory.h @@ -8,6 +8,7 @@ #include <vector> #include "base/files/scoped_file.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "ui/gfx/buffer_types.h" #include "ui/ozone/ozone_export.h" @@ -34,13 +35,9 @@ class OZONE_EXPORT ClientNativePixmapFactory { // Initialize with the given client native pixmap |device_fd|. virtual void Initialize(base::ScopedFD device_fd) = 0; - struct Configuration { - gfx::BufferFormat format; - gfx::BufferUsage usage; - }; - - // Gets supported format/usage configurations. - virtual std::vector<Configuration> GetSupportedConfigurations() const = 0; + // Returns true if format/usage configuration is supported. + virtual bool IsConfigurationSupported(gfx::BufferFormat format, + gfx::BufferUsage usage) const = 0; // TODO(dshwang): implement it. crbug.com/475633 // Import the native pixmap from |handle| to be used in non-GPU processes. diff --git a/chromium/ui/ozone/public/input_controller.cc b/chromium/ui/ozone/public/input_controller.cc index df9a7ba1d81..45f11e14b16 100644 --- a/chromium/ui/ozone/public/input_controller.cc +++ b/chromium/ui/ozone/public/input_controller.cc @@ -6,6 +6,7 @@ #include "base/compiler_specific.h" #include "base/logging.h" +#include "base/macros.h" namespace ui { @@ -42,6 +43,8 @@ class StubInputController : public InputController { void GetTouchEventLog(const base::FilePath& out_dir, const GetTouchEventLogReply& reply) override; void SetInternalTouchpadEnabled(bool enabled) override; + bool IsInternalTouchpadEnabled() const override; + void SetTouchscreensEnabled(bool enabled) override; void SetInternalKeyboardFilter(bool enable_filter, std::vector<DomCode> allowed_keys) override; @@ -134,6 +137,12 @@ void StubInputController::GetTouchEventLog(const base::FilePath& out_dir, void StubInputController::SetInternalTouchpadEnabled(bool enabled) { } +bool StubInputController::IsInternalTouchpadEnabled() const { + return false; +} + +void StubInputController::SetTouchscreensEnabled(bool enabled) {} + void StubInputController::SetInternalKeyboardFilter( bool enable_filter, std::vector<DomCode> allowed_keys) { diff --git a/chromium/ui/ozone/public/input_controller.h b/chromium/ui/ozone/public/input_controller.h index fbf5c060761..398fbbe5157 100644 --- a/chromium/ui/ozone/public/input_controller.h +++ b/chromium/ui/ozone/public/input_controller.h @@ -13,7 +13,7 @@ #include "base/files/file_path.h" #include "base/macros.h" #include "base/memory/scoped_ptr.h" -#include "ui/ozone/ozone_export.h" +#include "ui/ozone/ozone_base_export.h" namespace base { class TimeDelta; @@ -28,7 +28,7 @@ enum class DomCode; // The object provides methods for the preference page to configure input // devices w.r.t. the user setting. On ChromeOS, this replaces the inputcontrol // script that is originally located at /opt/google/chrome/. -class OZONE_EXPORT InputController { +class OZONE_BASE_EXPORT InputController { public: typedef base::Callback<void(scoped_ptr<std::string>)> GetTouchDeviceStatusReply; @@ -77,6 +77,9 @@ class OZONE_EXPORT InputController { virtual void SetTapToClickPaused(bool state) = 0; virtual void SetInternalTouchpadEnabled(bool enabled) = 0; + virtual bool IsInternalTouchpadEnabled() const = 0; + + virtual void SetTouchscreensEnabled(bool enabled) = 0; // If |enable_filter| is true, all keys on the internal keyboard except // |allowed_keys| are disabled. @@ -88,7 +91,7 @@ class OZONE_EXPORT InputController { }; // Create an input controller that does nothing. -OZONE_EXPORT scoped_ptr<InputController> CreateStubInputController(); +OZONE_BASE_EXPORT scoped_ptr<InputController> CreateStubInputController(); } // namespace ui diff --git a/chromium/ui/ozone/public/native_pixmap.h b/chromium/ui/ozone/public/native_pixmap.h index 5bb007ad8d0..1cd79c3e8b1 100644 --- a/chromium/ui/ozone/public/native_pixmap.h +++ b/chromium/ui/ozone/public/native_pixmap.h @@ -6,6 +6,7 @@ #define UI_OZONE_PUBLIC_NATIVE_PIXMAP_H_ #include "base/bind.h" +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "ui/gfx/native_pixmap_handle_ozone.h" #include "ui/gfx/native_widget_types.h" @@ -24,9 +25,11 @@ class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { public: NativePixmap() {} - virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() = 0; - virtual int GetDmaBufFd() = 0; - virtual int GetDmaBufPitch() = 0; + virtual void* /* EGLClientBuffer */ GetEGLClientBuffer() const = 0; + virtual int GetDmaBufFd() const = 0; + virtual int GetDmaBufPitch() const = 0; + virtual gfx::BufferFormat GetBufferFormat() const = 0; + virtual gfx::Size GetBufferSize() const = 0; // Sets the overlay plane to switch to at the next page flip. // |w| specifies the screen to display this overlay plane on. @@ -45,14 +48,16 @@ class NativePixmap : public base::RefCountedThreadSafe<NativePixmap> { const gfx::Rect& display_bounds, const gfx::RectF& crop_rect) = 0; - // This represents a callback function pointing to scaling unit like VPP - // to do scaling operations on native pixmap with required size. - typedef base::Callback<scoped_refptr<NativePixmap>(gfx::Size)> - ScalingCallback; + // This represents a callback function pointing to processing unit like VPP to + // do post-processing operations like scaling and color space conversion on + // |source_pixmap| and save processed result to |target_pixmap|. + typedef base::Callback<bool(const scoped_refptr<NativePixmap>& source_pixmap, + scoped_refptr<NativePixmap> target_pixmap)> + ProcessingCallback; - // Set callback function for the pixmap used for scaling. - virtual void SetScalingCallback(const ScalingCallback& scaling_callback) = 0; - virtual scoped_refptr<NativePixmap> GetScaledPixmap(gfx::Size new_size) = 0; + // Set callback function for the pixmap used for post processing. + virtual void SetProcessingCallback( + const ProcessingCallback& processing_callback) = 0; // Export the buffer for sharing across processes. // Any file descriptors in the exported handle are owned by the caller. diff --git a/chromium/ui/ozone/public/overlay_candidates_ozone.h b/chromium/ui/ozone/public/overlay_candidates_ozone.h index bc6b237fa43..cacf562a383 100644 --- a/chromium/ui/ozone/public/overlay_candidates_ozone.h +++ b/chromium/ui/ozone/public/overlay_candidates_ozone.h @@ -7,7 +7,6 @@ #include <vector> -#include "base/basictypes.h" #include "ui/gfx/geometry/rect_f.h" #include "ui/ozone/ozone_base_export.h" #include "ui/ozone/public/surface_factory_ozone.h" diff --git a/chromium/ui/ozone/public/ozone_gpu_test_helper.cc b/chromium/ui/ozone/public/ozone_gpu_test_helper.cc index 8490a322c2f..fe5a17b31cd 100644 --- a/chromium/ui/ozone/public/ozone_gpu_test_helper.cc +++ b/chromium/ui/ozone/public/ozone_gpu_test_helper.cc @@ -19,15 +19,36 @@ namespace { const int kGpuProcessHostId = 1; -} // namespace - -static void DispatchToGpuPlatformSupportHostTask(IPC::Message* msg) { +void DispatchToGpuPlatformSupportHostTask(IPC::Message* msg) { ui::OzonePlatform::GetInstance() ->GetGpuPlatformSupportHost() ->OnMessageReceived(*msg); delete msg; } +void DispatchToGpuPlatformSupportTask(IPC::Message* msg) { + ui::OzonePlatform::GetInstance()->GetGpuPlatformSupport()->OnMessageReceived( + *msg); + delete msg; +} + +void DispatchToGpuPlatformSupportTaskOnIO( + const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner, + IPC::Message* msg) { + IPC::MessageFilter* filter = ui::OzonePlatform::GetInstance() + ->GetGpuPlatformSupport() + ->GetMessageFilter(); + if (filter && filter->OnMessageReceived(*msg)) { + delete msg; + return; + } + + gpu_task_runner->PostTask(FROM_HERE, + base::Bind(DispatchToGpuPlatformSupportTask, msg)); +} + +} // namespace + class FakeGpuProcess : public IPC::Sender { public: FakeGpuProcess( @@ -60,30 +81,27 @@ class FakeGpuProcess : public IPC::Sender { scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; }; -static void DispatchToGpuPlatformSupportTask(IPC::Message* msg) { - ui::OzonePlatform::GetInstance()->GetGpuPlatformSupport()->OnMessageReceived( - *msg); - delete msg; -} - class FakeGpuProcessHost { public: FakeGpuProcessHost( - const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner) - : gpu_task_runner_(gpu_task_runner) {} + const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner, + const scoped_refptr<base::SingleThreadTaskRunner>& gpu_io_task_runner) + : gpu_task_runner_(gpu_task_runner), + gpu_io_task_runner_(gpu_io_task_runner) {} ~FakeGpuProcessHost() {} void Init() { base::Callback<void(IPC::Message*)> sender = - base::Bind(&DispatchToGpuPlatformSupportTask); + base::Bind(&DispatchToGpuPlatformSupportTaskOnIO, gpu_task_runner_); ui::OzonePlatform::GetInstance() ->GetGpuPlatformSupportHost() - ->OnChannelEstablished(kGpuProcessHostId, gpu_task_runner_, sender); + ->OnChannelEstablished(kGpuProcessHostId, gpu_io_task_runner_, sender); } private: scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; + scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_; }; OzoneGpuTestHelper::OzoneGpuTestHelper() { @@ -106,7 +124,8 @@ bool OzoneGpuTestHelper::Initialize( base::Unretained(fake_gpu_process_.get()))); fake_gpu_process_->Init(); - fake_gpu_process_host_.reset(new FakeGpuProcessHost(gpu_task_runner)); + fake_gpu_process_host_.reset(new FakeGpuProcessHost( + gpu_task_runner, io_helper_thread_->task_runner())); fake_gpu_process_host_->Init(); return true; diff --git a/chromium/ui/ozone/public/ozone_gpu_test_helper.h b/chromium/ui/ozone/public/ozone_gpu_test_helper.h index e3428656ad5..5a740ac4ec8 100644 --- a/chromium/ui/ozone/public/ozone_gpu_test_helper.h +++ b/chromium/ui/ozone/public/ozone_gpu_test_helper.h @@ -5,6 +5,7 @@ #ifndef UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_ #define UI_OZONE_PUBLIC_OZONE_GPU_THREAD_HELPER_H_ +#include "base/macros.h" #include "base/memory/ref_counted.h" #include "base/memory/scoped_ptr.h" #include "ui/ozone/ozone_export.h" diff --git a/chromium/ui/ozone/public/ozone_platform.h b/chromium/ui/ozone/public/ozone_platform.h index e4a7bca45fc..f96915959b1 100644 --- a/chromium/ui/ozone/public/ozone_platform.h +++ b/chromium/ui/ozone/public/ozone_platform.h @@ -6,6 +6,7 @@ #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ #include "base/files/scoped_file.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "ui/ozone/ozone_export.h" diff --git a/chromium/ui/ozone/public/ozone_switches.h b/chromium/ui/ozone/public/ozone_switches.h index 88c848b0ac5..099b858c1c6 100644 --- a/chromium/ui/ozone/public/ozone_switches.h +++ b/chromium/ui/ozone/public/ozone_switches.h @@ -6,19 +6,19 @@ #define UI_OZONE_PUBLIC_OZONE_SWITCHES_H_ #include "base/compiler_specific.h" -#include "ui/ozone/ozone_export.h" +#include "ui/ozone/ozone_base_export.h" namespace switches { -OZONE_EXPORT extern const char kOzonePlatform[]; +OZONE_BASE_EXPORT extern const char kOzonePlatform[]; -OZONE_EXPORT extern const char kOzoneDumpFile[]; +OZONE_BASE_EXPORT extern const char kOzoneDumpFile[]; -OZONE_EXPORT extern const char kOzoneTestSingleOverlaySupport[]; +OZONE_BASE_EXPORT extern const char kOzoneTestSingleOverlaySupport[]; -OZONE_EXPORT extern const char kOzoneInitialDisplayBounds[]; +OZONE_BASE_EXPORT extern const char kOzoneInitialDisplayBounds[]; -OZONE_EXPORT extern const char kOzoneInitialDisplayPhysicalSizeMm[]; +OZONE_BASE_EXPORT extern const char kOzoneInitialDisplayPhysicalSizeMm[]; } // namespace switches diff --git a/chromium/ui/ozone/public/surface_factory_ozone.cc b/chromium/ui/ozone/public/surface_factory_ozone.cc index f3aa16b24b0..b493045353c 100644 --- a/chromium/ui/ozone/public/surface_factory_ozone.cc +++ b/chromium/ui/ozone/public/surface_factory_ozone.cc @@ -39,8 +39,8 @@ scoped_ptr<SurfaceOzoneCanvas> SurfaceFactoryOzone::CreateCanvasForWidget( return nullptr; } -const int32* SurfaceFactoryOzone::GetEGLSurfaceProperties( - const int32* desired_attributes) { +const int32_t* SurfaceFactoryOzone::GetEGLSurfaceProperties( + const int32_t* desired_attributes) { return desired_attributes; } @@ -49,7 +49,13 @@ scoped_refptr<ui::NativePixmap> SurfaceFactoryOzone::CreateNativePixmap( gfx::Size size, gfx::BufferFormat format, gfx::BufferUsage usage) { - return NULL; + return nullptr; +} + +scoped_refptr<ui::NativePixmap> +SurfaceFactoryOzone::CreateNativePixmapFromHandle( + const gfx::NativePixmapHandle& handle) { + return nullptr; } } // namespace ui diff --git a/chromium/ui/ozone/public/surface_factory_ozone.h b/chromium/ui/ozone/public/surface_factory_ozone.h index 07ab4957594..eaa353b4bf8 100644 --- a/chromium/ui/ozone/public/surface_factory_ozone.h +++ b/chromium/ui/ozone/public/surface_factory_ozone.h @@ -5,7 +5,10 @@ #ifndef UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ #define UI_OZONE_PUBLIC_SURFACE_FACTORY_OZONE_H_ +#include <stdint.h> + #include "base/callback.h" +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "base/native_library.h" #include "ui/gfx/buffer_types.h" @@ -13,6 +16,7 @@ #include "ui/gfx/native_widget_types.h" #include "ui/gfx/overlay_transform.h" #include "ui/ozone/ozone_base_export.h" +#include "ui/ozone/public/native_pixmap.h" namespace ui { @@ -94,7 +98,7 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone { // immediately followed by the corresponding desired value and array should be // terminated with EGL_NONE. Ownership of the array is not transferred to // caller. desired_list contains list of desired EGL properties and values. - virtual const int32* GetEGLSurfaceProperties(const int32* desired_list); + virtual const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list); // Create a single native buffer to be used for overlay planes or zero copy // for |widget| representing a particular display controller or default @@ -106,6 +110,11 @@ class OZONE_BASE_EXPORT SurfaceFactoryOzone { gfx::BufferFormat format, gfx::BufferUsage usage); + // Create a single native buffer from an existing handle. Takes ownership of + // |handle| and can be called on any thread. + virtual scoped_refptr<NativePixmap> CreateNativePixmapFromHandle( + const gfx::NativePixmapHandle& handle); + protected: SurfaceFactoryOzone(); virtual ~SurfaceFactoryOzone(); diff --git a/chromium/ui/ozone/public/surface_ozone_canvas.h b/chromium/ui/ozone/public/surface_ozone_canvas.h index 42347c3dba5..6cab0b40f0e 100644 --- a/chromium/ui/ozone/public/surface_ozone_canvas.h +++ b/chromium/ui/ozone/public/surface_ozone_canvas.h @@ -5,7 +5,6 @@ #ifndef UI_OZONE_PUBLIC_SURFACE_OZONE_CANVAS_H_ #define UI_OZONE_PUBLIC_SURFACE_OZONE_CANVAS_H_ -#include "base/basictypes.h" #include "base/memory/scoped_ptr.h" #include "skia/ext/refptr.h" #include "ui/ozone/ozone_base_export.h" diff --git a/chromium/ui/ozone/public/surface_ozone_egl.h b/chromium/ui/ozone/public/surface_ozone_egl.h index 3056deca1f0..f66f354e50c 100644 --- a/chromium/ui/ozone/public/surface_ozone_egl.h +++ b/chromium/ui/ozone/public/surface_ozone_egl.h @@ -5,7 +5,6 @@ #ifndef UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ #define UI_OZONE_PUBLIC_SURFACE_OZONE_EGL_H_ -#include "base/basictypes.h" #include "base/callback.h" #include "base/memory/scoped_ptr.h" #include "ui/gfx/overlay_transform.h" @@ -46,7 +45,7 @@ class OZONE_BASE_EXPORT SurfaceOzoneEGL { // be used to present the new front buffer if the platform requires this. // The callback should be run on the calling thread // (i.e. same thread SwapBuffersAsync is called). - virtual bool OnSwapBuffersAsync(const SwapCompletionCallback& callback) = 0; + virtual void OnSwapBuffersAsync(const SwapCompletionCallback& callback) = 0; // Returns a gfx::VsyncProvider for this surface. Note that this may be // called after we have entered the sandbox so if there are operations (e.g. diff --git a/chromium/ui/ozone/public/system_input_injector.h b/chromium/ui/ozone/public/system_input_injector.h index a13051f4bba..64858ee210c 100644 --- a/chromium/ui/ozone/public/system_input_injector.h +++ b/chromium/ui/ozone/public/system_input_injector.h @@ -5,6 +5,7 @@ #ifndef UI_OZONE_PUBLIC_SYSTEM_INPUT_INJECTOR_H_ #define UI_OZONE_PUBLIC_SYSTEM_INPUT_INJECTOR_H_ +#include "base/macros.h" #include "base/memory/scoped_ptr.h" #include "ui/events/event.h" #include "ui/events/keycodes/dom/keycode_converter.h" |