1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_
6 #define UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_
8 #include "ui/gfx/native_widget_types.h"
16 class HardwareDisplayController;
18 // Interface for the display-server half of a DriWindow.
20 // The main implementation of this lives in the process that owns the display
21 // connection (usually the GPU process) and associates a platform window
22 // (DriWindow) with a display. A window is associated with the display whose
23 // bounds contains the window bounds. If there's no suitable display, the window
24 // is disconnected and its contents will not be visible.
26 // In software mode, this is owned directly on DriWindow because the display
27 // controller object is in the same process.
29 // In accelerated mode, there's a proxy implementation and calls are forwarded
30 // to the real object in the GPU process via IPC.
31 class DriWindowDelegate {
33 virtual ~DriWindowDelegate() {}
35 virtual void Initialize() = 0;
37 virtual void Shutdown() = 0;
39 // Returns the accelerated widget associated with the delegate.
40 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0;
42 // Returns the current controller the window is displaying on. Callers should
43 // not cache the result as the controller may change as the window is moved.
44 virtual HardwareDisplayController* GetController() = 0;
46 // Called when the window is resized/moved.
47 virtual void OnBoundsChanged(const gfx::Rect& bounds) = 0;
52 #endif // UI_OZONE_PLATFORM_DRI_DRI_WINDOW_DELEGATE_H_