Commit 935ae1dc authored by dnicoara@chromium.org's avatar dnicoara@chromium.org

[Ozone-GBM] Adding NativeWindowDelegate to IPC window changes to the GPU

This change is the first part in a series of changes to allow better display
configuration and tracking of windows/surfaces.

The browser process uses PlatformWindows to keep track of display surfaces.
The window then has an underlying surface to display content. The surface (in our
context SurfaceOzoneEGL) is created on the GPU process and is associated with
the window via an AcceleratedWidget handle. Each surface is then associated with
a HardwareDisplayController in order to scanout the contents to the monitor.
Since the surface is assumed to be in the window's coordinate system, the GPU
side has no knowledge of how to map a surface to the configured displays. The
NativeWindowDelegate is meant to IPC window information from the browser process
to the GPU process such that we can map surfaces to display controllers.

BUG=392478
NOTRY=true

Review URL: https://codereview.chromium.org/479713002

Cr-Commit-Position: refs/heads/master@{#291071}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@291071 0039d316-1c4b-4281-b951-d872f2087c98
parent dd5c797d
......@@ -10,6 +10,7 @@
#include "ipc/ipc_message_macros.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/ipc/gfx_param_traits.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
......@@ -58,6 +59,20 @@ IPC_MESSAGE_CONTROL3(OzoneGpuMsg_CursorSet,
IPC_MESSAGE_CONTROL2(OzoneGpuMsg_CursorMove,
gfx::AcceleratedWidget, gfx::Point)
// Explicit creation of a WindowDelegate. We explicitly create the window
// delegate such that any state change in the window is not lost while the
// surface is created on the GPU side.
IPC_MESSAGE_CONTROL1(OzoneGpuMsg_CreateWindowDelegate,
gfx::AcceleratedWidget /* widget */)
IPC_MESSAGE_CONTROL1(OzoneGpuMsg_DestroyWindowDelegate,
gfx::AcceleratedWidget /* widget */)
// Updates the location and size of the widget on the screen.
IPC_MESSAGE_CONTROL2(OzoneGpuMsg_WindowBoundsChanged,
gfx::AcceleratedWidget /* widget */,
gfx::Rect /* bounds */)
#if defined(OS_CHROMEOS)
// Force the DPMS state of the display to on.
IPC_MESSAGE_CONTROL0(OzoneGpuMsg_ForceDPMSOn)
......
......@@ -35,6 +35,11 @@ source_set("dri_common") {
"dri_vsync_provider.h",
"dri_window.cc",
"dri_window.h",
"dri_window_delegate.h",
"dri_window_delegate_impl.cc",
"dri_window_delegate_impl.h",
"dri_window_manager.cc",
"dri_window_manager.h",
"dri_wrapper.cc",
"dri_wrapper.h",
"hardware_display_controller.cc",
......@@ -109,6 +114,8 @@ if (ozone_platform_gbm) {
"chromeos/display_message_handler.h",
"chromeos/native_display_delegate_proxy.cc",
"chromeos/native_display_delegate_proxy.h",
"dri_window_delegate_proxy.cc",
"dri_window_delegate_proxy.h",
"gbm_buffer.cc",
"gbm_buffer.h",
"gbm_buffer_base.cc",
......
......@@ -59,6 +59,11 @@
'dri_vsync_provider.h',
'dri_window.cc',
'dri_window.h',
'dri_window_delegate.h',
'dri_window_delegate_impl.cc',
'dri_window_delegate_impl.h',
'dri_window_manager.cc',
'dri_window_manager.h',
'dri_wrapper.cc',
'dri_wrapper.h',
'hardware_display_controller.cc',
......
// 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_DRI_DRI_WINDOW_DELEGATE_H_
#define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_
#include "ui/gfx/native_widget_types.h"
namespace gfx {
class Rect;
} // namespace gfx
namespace ui {
class HardwareDisplayController;
// Interface for the display-server half of a DriWindow.
//
// The main implementation of this lives in the process that owns the display
// connection (usually the GPU process) and associates a platform window
// (DriWindow) with a display. A window is associated with the display whose
// bounds contains the window bounds. If there's no suitable display, the window
// is disconnected and its contents will not be visible.
//
// In software mode, this is owned directly on DriWindow because the display
// controller object is in the same process.
//
// In accelerated mode, there's a proxy implementation and calls are forwarded
// to the real object in the GPU process via IPC.
class DriWindowDelegate {
public:
virtual ~DriWindowDelegate() {}
virtual void Initialize() = 0;
virtual void Shutdown() = 0;
// Returns the accelerated widget associated with the delegate.
virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
// Returns the current controller the window is displaying on. Callers should
// not cache the result as the controller may change as the window is moved.
virtual HardwareDisplayController* GetController() = 0;
// Called when the window is resized/moved.
virtual void OnBoundsChanged(const gfx::Rect& bounds) = 0;
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_
// 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/ozone/platform/dri/dri_window_delegate_impl.h"
#include "ui/ozone/platform/dri/screen_manager.h"
namespace ui {
DriWindowDelegateImpl::DriWindowDelegateImpl(gfx::AcceleratedWidget widget,
ScreenManager* screen_manager)
: widget_(widget), screen_manager_(screen_manager) {
}
DriWindowDelegateImpl::~DriWindowDelegateImpl() {
}
void DriWindowDelegateImpl::Initialize() {
}
void DriWindowDelegateImpl::Shutdown() {
}
gfx::AcceleratedWidget DriWindowDelegateImpl::GetAcceleratedWidget() {
return widget_;
}
HardwareDisplayController* DriWindowDelegateImpl::GetController() {
return controller_.get();
}
void DriWindowDelegateImpl::OnBoundsChanged(const gfx::Rect& bounds) {
controller_ = screen_manager_->GetDisplayController(bounds);
}
} // namespace ui
// 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_DRI_DRI_WINDOW_DELEGATE_IMPL_H_
#define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_
#include "base/memory/weak_ptr.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/ozone/platform/dri/dri_window_delegate.h"
namespace gfx {
class Rect;
} // namespace gfx
namespace ui {
class HardwareDisplayController;
class ScreenManager;
class DriWindowDelegateImpl : public DriWindowDelegate {
public:
DriWindowDelegateImpl(gfx::AcceleratedWidget widget,
ScreenManager* screen_manager);
virtual ~DriWindowDelegateImpl();
// DriWindowDelegate:
virtual void Initialize() OVERRIDE;
virtual void Shutdown() OVERRIDE;
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
virtual HardwareDisplayController* GetController() OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
private:
gfx::AcceleratedWidget widget_;
ScreenManager* screen_manager_; // Not owned.
base::WeakPtr<HardwareDisplayController> controller_;
DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateImpl);
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_IMPL_H_
// 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/ozone/platform/dri/dri_window_delegate_proxy.h"
#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
#include "ui/ozone/platform/dri/gpu_platform_support_host_gbm.h"
namespace ui {
DriWindowDelegateProxy::DriWindowDelegateProxy(
gfx::AcceleratedWidget widget,
GpuPlatformSupportHostGbm* sender)
: widget_(widget), sender_(sender) {
}
DriWindowDelegateProxy::~DriWindowDelegateProxy() {
}
void DriWindowDelegateProxy::Initialize() {
bool status = sender_->Send(new OzoneGpuMsg_CreateWindowDelegate(widget_));
DCHECK(status);
}
void DriWindowDelegateProxy::Shutdown() {
bool status = sender_->Send(new OzoneGpuMsg_DestroyWindowDelegate(widget_));
DCHECK(status);
}
gfx::AcceleratedWidget DriWindowDelegateProxy::GetAcceleratedWidget() {
return widget_;
}
HardwareDisplayController* DriWindowDelegateProxy::GetController() {
NOTREACHED();
return NULL;
}
void DriWindowDelegateProxy::OnBoundsChanged(const gfx::Rect& bounds) {
bool status =
sender_->Send(new OzoneGpuMsg_WindowBoundsChanged(widget_, bounds));
DCHECK(status);
}
} // namespace ui
// 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_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
#define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
#include "ui/ozone/platform/dri/dri_window_delegate.h"
namespace ui {
class GpuPlatformSupportHostGbm;
// This is used when running with a GPU process (or with the in-process GPU) to
// IPC the native window configuration from the browser to the GPU.
class DriWindowDelegateProxy : public DriWindowDelegate {
public:
DriWindowDelegateProxy(gfx::AcceleratedWidget widget,
GpuPlatformSupportHostGbm* sender);
virtual ~DriWindowDelegateProxy();
// DriWindowDelegate:
virtual void Initialize() OVERRIDE;
virtual void Shutdown() OVERRIDE;
virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
virtual HardwareDisplayController* GetController() OVERRIDE;
virtual void OnBoundsChanged(const gfx::Rect& bounds) OVERRIDE;
private:
gfx::AcceleratedWidget widget_;
GpuPlatformSupportHostGbm* sender_;
DISALLOW_COPY_AND_ASSIGN(DriWindowDelegateProxy);
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_PROXY_H_
// 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/ozone/platform/dri/dri_window_manager.h"
namespace ui {
DriWindowManager::DriWindowManager() : last_allocated_widget_(0) {
}
DriWindowManager::~DriWindowManager() {
DCHECK(delegate_map_.empty());
}
gfx::AcceleratedWidget DriWindowManager::NextAcceleratedWidget() {
// We're not using 0 since other code assumes that a 0 AcceleratedWidget is an
// invalid widget.
return ++last_allocated_widget_;
}
void DriWindowManager::AddWindowDelegate(gfx::AcceleratedWidget widget,
DriWindowDelegate* delegate) {
DCHECK(delegate_map_.find(widget) == delegate_map_.end())
<< "Window delegate already added.";
delegate_map_.insert(std::make_pair(widget, delegate));
}
void DriWindowManager::RemoveWindowDelegate(gfx::AcceleratedWidget widget) {
WidgetToDelegateMap::iterator it = delegate_map_.find(widget);
DCHECK(it != delegate_map_.end())
<< "Attempting to remove non-existing delegate.";
delegate_map_.erase(it);
}
DriWindowDelegate* DriWindowManager::GetWindowDelegate(
gfx::AcceleratedWidget widget) {
WidgetToDelegateMap::iterator it = delegate_map_.find(widget);
if (it != delegate_map_.end())
return it->second;
NOTREACHED();
return NULL;
}
bool DriWindowManager::HasWindowDelegate(gfx::AcceleratedWidget widget) {
return delegate_map_.find(widget) != delegate_map_.end();
}
} // namespace ui
// 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_DRI_DRI_WINDOW_MANAGER_H_
#define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_
#include <map>
#include "ui/gfx/native_widget_types.h"
namespace ui {
class DriWindowDelegate;
class DriWindowManager {
public:
DriWindowManager();
~DriWindowManager();
gfx::AcceleratedWidget NextAcceleratedWidget();
// Adds a delegate for |widget|. Note: |widget| should not be associated with
// a delegate when calling this function.
void AddWindowDelegate(gfx::AcceleratedWidget widget,
DriWindowDelegate* surface);
// Removes the delegate for |widget|. Note: |widget| must have a delegate
// associated with it when calling this function.
void RemoveWindowDelegate(gfx::AcceleratedWidget widget);
// Returns the delegate associated with |widget|. Note: This function should
// be called only if a valid delegate has been associated with |widget|.
DriWindowDelegate* GetWindowDelegate(gfx::AcceleratedWidget widget);
// Check if |widget| has a valid delegate associated with it.
bool HasWindowDelegate(gfx::AcceleratedWidget widget);
private:
typedef std::map<gfx::AcceleratedWidget, DriWindowDelegate*>
WidgetToDelegateMap;
WidgetToDelegateMap delegate_map_;
gfx::AcceleratedWidget last_allocated_widget_;
DISALLOW_COPY_AND_ASSIGN(DriWindowManager);
};
} // namespace ui
#endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_MANAGER_H_
......@@ -34,6 +34,8 @@
'chromeos/display_message_handler.h',
'chromeos/native_display_delegate_proxy.cc',
'chromeos/native_display_delegate_proxy.h',
'dri_window_delegate_proxy.cc',
'dri_window_delegate_proxy.h',
'gbm_buffer.cc',
'gbm_buffer.h',
'gbm_buffer_base.cc',
......
......@@ -7,11 +7,18 @@
#include "ipc/ipc_message_macros.h"
#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
#include "ui/ozone/platform/dri/dri_surface_factory.h"
#include "ui/ozone/platform/dri/dri_window_delegate_impl.h"
#include "ui/ozone/platform/dri/dri_window_manager.h"
namespace ui {
GpuPlatformSupportGbm::GpuPlatformSupportGbm(DriSurfaceFactory* dri)
: sender_(NULL), dri_(dri) {
GpuPlatformSupportGbm::GpuPlatformSupportGbm(DriSurfaceFactory* dri,
DriWindowManager* window_manager,
ScreenManager* screen_manager)
: sender_(NULL),
dri_(dri),
window_manager_(window_manager),
screen_manager_(screen_manager) {
}
GpuPlatformSupportGbm::~GpuPlatformSupportGbm() {}
......@@ -31,6 +38,11 @@ bool GpuPlatformSupportGbm::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(GpuPlatformSupportGbm, message)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_CreateWindowDelegate, OnCreateWindowDelegate)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_DestroyWindowDelegate,
OnDestroyWindowDelegate)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_WindowBoundsChanged, OnWindowBoundsChanged)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorSet, OnCursorSet)
IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorMove, OnCursorMove)
IPC_MESSAGE_UNHANDLED(handled = false);
......@@ -44,6 +56,39 @@ bool GpuPlatformSupportGbm::OnMessageReceived(const IPC::Message& message) {
return false;
}
void GpuPlatformSupportGbm::OnCreateWindowDelegate(
gfx::AcceleratedWidget widget) {
// Due to how the GPU process starts up this IPC call may happen after the IPC
// to create a surface. Since a surface wants to know the window associated
// with it, we create it ahead of time. So when this call happens we do not
// create a delegate if it already exists.
if (!window_manager_->HasWindowDelegate(widget)) {
scoped_ptr<DriWindowDelegate> delegate(
new DriWindowDelegateImpl(widget, screen_manager_));
delegate->Initialize();
window_manager_->AddWindowDelegate(widget, delegate.get());
std::pair<WidgetToWindowDelegateMap::iterator, bool> result =
window_delegate_owner_.add(widget, delegate.Pass());
DCHECK(result.second) << "Delegate already added.";
}
}
void GpuPlatformSupportGbm::OnDestroyWindowDelegate(
gfx::AcceleratedWidget widget) {
scoped_ptr<DriWindowDelegate> delegate =
window_delegate_owner_.take_and_erase(widget);
DCHECK(delegate) << "Attempting to remove non-existing delegate.";
window_manager_->RemoveWindowDelegate(widget);
delegate->Shutdown();
}
void GpuPlatformSupportGbm::OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
const gfx::Rect& bounds) {
window_manager_->GetWindowDelegate(widget)->OnBoundsChanged(bounds);
}
void GpuPlatformSupportGbm::OnCursorSet(gfx::AcceleratedWidget widget,
const SkBitmap& bitmap,
const gfx::Point& location) {
......
......@@ -5,6 +5,7 @@
#ifndef UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_
#define UI_OZONE_PLATFORM_DRI_GPU_PLATFORM_SUPPORT_GBM_H_
#include "base/containers/scoped_ptr_hash_map.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/scoped_vector.h"
#include "ui/gfx/native_widget_types.h"
......@@ -14,15 +15,21 @@ class SkBitmap;
namespace gfx {
class Point;
class Rect;
}
namespace ui {
class DriSurfaceFactory;
class DriWindowDelegate;
class DriWindowManager;
class ScreenManager;
class GpuPlatformSupportGbm : public GpuPlatformSupport {
public:
GpuPlatformSupportGbm(DriSurfaceFactory* dri);
GpuPlatformSupportGbm(DriSurfaceFactory* dri,
DriWindowManager* window_manager,
ScreenManager* screen_manager);
virtual ~GpuPlatformSupportGbm();
void AddHandler(scoped_ptr<GpuPlatformSupport> handler);
......@@ -34,15 +41,24 @@ class GpuPlatformSupportGbm : public GpuPlatformSupport {
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
private:
IPC::Sender* sender_;
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 SkBitmap& bitmap,
const gfx::Point& location);
void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
typedef base::ScopedPtrHashMap<gfx::AcceleratedWidget, DriWindowDelegate>
WidgetToWindowDelegateMap;
IPC::Sender* sender_;
DriSurfaceFactory* dri_;
DriWindowManager* window_manager_;
ScreenManager* screen_manager_;
ScopedVector<GpuPlatformSupport> handlers_;
WidgetToWindowDelegateMap window_delegate_owner_;
};
} // namespace ui
......
......@@ -14,6 +14,7 @@
#include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/ozone/platform/dri/cursor_factory_evdev_dri.h"
#include "ui/ozone/platform/dri/dri_window.h"
#include "ui/ozone/platform/dri/dri_window_manager.h"
#include "ui/ozone/platform/dri/dri_wrapper.h"
#include "ui/ozone/platform/dri/gbm_buffer.h"
#include "ui/ozone/platform/dri/gbm_surface.h"
......@@ -140,7 +141,9 @@ class OzonePlatformGbm : public OzonePlatform {
buffer_generator_->device(),
screen_manager_.get());
gpu_platform_support_.reset(
new GpuPlatformSupportGbm(surface_factory_ozone_.get()));
new GpuPlatformSupportGbm(surface_factory_ozone_.get(),
&gpu_window_manager_,
screen_manager_.get()));
#if defined(OS_CHROMEOS)
gpu_platform_support_->AddHandler(scoped_ptr<GpuPlatformSupport>(
new DisplayMessageHandler(
......@@ -169,6 +172,8 @@ class OzonePlatformGbm : public OzonePlatform {
scoped_ptr<GpuPlatformSupportGbm> gpu_platform_support_;
scoped_ptr<GpuPlatformSupportHostGbm> gpu_platform_support_host_;
DriWindowManager gpu_window_manager_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm);
};
......
......@@ -16,6 +16,14 @@
namespace ui {
namespace {
gfx::Size GetModeSize(const drmModeModeInfo& mode) {
return gfx::Size(mode.hdisplay, mode.vdisplay);
}
} // namespace
ScreenManager::ScreenManager(
DriWrapper* dri, ScanoutBufferGenerator* buffer_generator)
: dri_(dri), buffer_generator_(buffer_generator), last_added_widget_(0) {
......@@ -111,6 +119,22 @@ base::WeakPtr<HardwareDisplayController> ScreenManager::GetDisplayController(
return base::WeakPtr<HardwareDisplayController>();
}
base::WeakPtr<HardwareDisplayController> ScreenManager::GetDisplayController(
const gfx::Rect& bounds) {
// TODO(dnicoara): Remove hack once TestScreen uses a simple Ozone display
// configuration reader and ScreenManager is called from there to create the
// one display needed by the content_shell target.
if (controllers_.empty())
ForceInitializationOfPrimaryDisplay();
HardwareDisplayControllerMap::iterator it =
FindActiveDisplayControllerByLocation(bounds);
if (it != controllers_.end())
return it->second->AsWeakPtr();
return base::WeakPtr<HardwareDisplayController>();
}
ScreenManager::HardwareDisplayControllerMap::iterator
ScreenManager::FindDisplayController(uint32_t crtc) {
for (HardwareDisplayControllerMap::iterator it = controllers_.begin();
......@@ -135,6 +159,22 @@ ScreenManager::FindDisplayControllerByOrigin(const gfx::Point& origin) {
return controllers_.end();
}
ScreenManager::HardwareDisplayControllerMap::iterator
ScreenManager::FindActiveDisplayControllerByLocation(const gfx::Rect& bounds) {
for (HardwareDisplayControllerMap::iterator it = controllers_.begin();
it != controllers_.end();
++it) {
gfx::Rect controller_bounds(it->second->origin(),
GetModeSize(it->second->get_mode()));
// We don't perform a strict check since content_shell will have windows
// smaller than the display size.
if (controller_bounds.Contains(bounds))
return it;
}
return controllers_.end();
}
void ScreenManager::ForceInitializationOfPrimaryDisplay() {
ScopedVector<HardwareDisplayControllerInfo> displays =
GetAvailableDisplayControllerInfos(dri_->get_fd());
......
......@@ -55,6 +55,15 @@ class ScreenManager {
base::WeakPtr<HardwareDisplayController> GetDisplayController(
gfx::AcceleratedWidget widget);
// Returns a reference to the display controller configured to display within
// |bounds|.
// This returns a weak reference since the display controller may be destroyed
// at any point in time, but the changes are propagated to the compositor much
// later (Compositor owns SurfaceOzone*, which is responsible for updating the
// display surface).
base::WeakPtr<HardwareDisplayController> GetDisplayController(
const gfx::Rect& bounds);
private:
typedef std::map<gfx::AcceleratedWidget, HardwareDisplayController*>
HardwareDisplayControllerMap;
......@@ -69,6 +78,11 @@ class ScreenManager {
HardwareDisplayControllerMap::iterator FindDisplayControllerByOrigin(
const gfx::Point& origin);
// Returns an iterator into |controllers_| for the controller located within
// |bounds|.
HardwareDisplayControllerMap::iterator FindActiveDisplayControllerByLocation(
const gfx::Rect& bounds);
// Perform modesetting in |controller| using |origin| and |mode|.
bool ModesetDisplayController(HardwareDisplayController* controller,
const gfx::Point& origin,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment