diff options
author | dnicoara <dnicoara@chromium.org> | 2015-03-05 12:46:18 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-05 20:47:08 +0000 |
commit | 171d8c892da1b2e38f90c17b62896ba82f0719e3 (patch) | |
tree | 9fe2810948b2d8dfd73cd7a5afa002dcf79c0547 /ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h | |
parent | f36607f2398cb4aa9b50449b1221bbc72e3f3453 (diff) | |
download | chromium_src-171d8c892da1b2e38f90c17b62896ba82f0719e3.zip chromium_src-171d8c892da1b2e38f90c17b62896ba82f0719e3.tar.gz chromium_src-171d8c892da1b2e38f90c17b62896ba82f0719e3.tar.bz2 |
[Ozone] Rename and split the DRI platform for clarity
This CL does the following:
- Moves the files in ui/ozone/platform/dri to ui/ozone/platform/drm
since the platform name should really be DRM rather than DRI. Note,
that the platform is still refered to as "dri" in GYP/GN since CrOS
builds are still using the 'dri' name.
- Rename all files with a "_dri*" suffix to a "drm_" prefix. Also
rename all files with a "dri_" prefix to a "drm_" prefix.
- Rename NativeDisplayDelegateDri to DrmDisplayDelegateManager since it
is no longer dependent on the NativeDisplayDelegate interface and the
new name better describes its intent.
- Split the files in the platform into 2 sub-folders ("host" and
"gpu"). Depending on the intended use place of the objects (Browser
(host) process or GPU process) the files in the platform are split
accordingly in the 2 sub-folders.
BUG=none
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/975063002
Cr-Commit-Position: refs/heads/master@{#319320}
Diffstat (limited to 'ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h')
-rw-r--r-- | ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h new file mode 100644 index 0000000..046a4ae --- /dev/null +++ b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h @@ -0,0 +1,96 @@ +// 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_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_ +#define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_ + +#include "base/containers/scoped_ptr_hash_map.h" +#include "base/memory/scoped_ptr.h" +#include "base/memory/scoped_vector.h" +#include "ipc/message_filter.h" +#include "ui/gfx/native_widget_types.h" +#include "ui/ozone/public/gpu_platform_support.h" + +class SkBitmap; + +namespace base { +class FilePath; +class SingleThreadTaskRunner; +struct FileDescriptor; +} + +namespace gfx { +class Point; +class Rect; +} + +namespace ui { + +class DrmDeviceManager; +class DrmGpuDisplayManager; +class DrmSurfaceFactory; +class DrmWindow; +class DrmWindowManager; +class ScreenManager; + +struct DisplayMode_Params; +struct DisplaySnapshot_Params; + +class DrmGpuPlatformSupport : public GpuPlatformSupport { + public: + DrmGpuPlatformSupport(DrmDeviceManager* drm_device_manager, + DrmWindowManager* window_manager, + ScreenManager* screen_manager, + scoped_ptr<DrmGpuDisplayManager> ndd); + ~DrmGpuPlatformSupport() override; + + void AddHandler(scoped_ptr<GpuPlatformSupport> handler); + + // GpuPlatformSupport: + void OnChannelEstablished(IPC::Sender* sender) override; + void RelinquishGpuResources(const base::Closure& callback) override; + IPC::MessageFilter* GetMessageFilter() override; + + // IPC::Listener: + bool OnMessageReceived(const IPC::Message& message) override; + + private: + void OnCreateWindowDelegate(gfx::AcceleratedWidget widget); + void OnDestroyWindowDelegate(gfx::AcceleratedWidget widget); + void OnWindowBoundsChanged(gfx::AcceleratedWidget widget, + const gfx::Rect& bounds); + void OnCursorSet(gfx::AcceleratedWidget widget, + const std::vector<SkBitmap>& bitmaps, + const gfx::Point& location, + int frame_delay_ms); + void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location); + + // Display related IPC handlers. + void OnRefreshNativeDisplays(); + void OnConfigureNativeDisplay(int64_t id, + const DisplayMode_Params& mode, + const gfx::Point& origin); + void OnDisableNativeDisplay(int64_t id); + void OnTakeDisplayControl(); + void OnRelinquishDisplayControl(); + void OnAddGraphicsDevice(const base::FilePath& path, + const base::FileDescriptor& fd); + void OnRemoveGraphicsDevice(const base::FilePath& path); + + void SetIOTaskRunner( + const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner); + + IPC::Sender* sender_; // Not owned. + DrmDeviceManager* drm_device_manager_; // Not owned. + DrmWindowManager* window_manager_; // Not owned. + ScreenManager* screen_manager_; // Not owned. + + scoped_ptr<DrmGpuDisplayManager> ndd_; + ScopedVector<GpuPlatformSupport> handlers_; + scoped_refptr<IPC::MessageFilter> filter_; +}; + +} // namespace ui + +#endif // UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_ |