1 //
2 // Copyright 2020 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // DisplayWindow.cpp: Implementation of OSWindow for Linux Display
8 
9 #include "util/display/DisplayWindow.h"
10 
11 #include "common/debug.h"
12 #include "util/Timer.h"
13 #include "util/test_utils.h"
14 
DisplayWindow()15 DisplayWindow::DisplayWindow()
16 {
17     mWindow.width  = 0;
18     mWindow.height = 0;
19 }
20 
~DisplayWindow()21 DisplayWindow::~DisplayWindow() {}
22 
initializeImpl(const std::string & name,int width,int height)23 bool DisplayWindow::initializeImpl(const std::string &name, int width, int height)
24 {
25     return resize(width, height);
26 }
27 
disableErrorMessageDialog()28 void DisplayWindow::disableErrorMessageDialog() {}
29 
destroy()30 void DisplayWindow::destroy() {}
31 
resetNativeWindow()32 void DisplayWindow::resetNativeWindow() {}
33 
getNativeWindow() const34 EGLNativeWindowType DisplayWindow::getNativeWindow() const
35 {
36     return (EGLNativeWindowType)&mWindow;
37 }
38 
getNativeDisplay() const39 EGLNativeDisplayType DisplayWindow::getNativeDisplay() const
40 {
41     return NULL;
42 }
43 
messageLoop()44 void DisplayWindow::messageLoop() {}
45 
setMousePosition(int x,int y)46 void DisplayWindow::setMousePosition(int x, int y)
47 {
48     UNIMPLEMENTED();
49 }
50 
setOrientation(int width,int height)51 bool DisplayWindow::setOrientation(int width, int height)
52 {
53     UNIMPLEMENTED();
54     return true;
55 }
56 
setPosition(int x,int y)57 bool DisplayWindow::setPosition(int x, int y)
58 {
59     UNIMPLEMENTED();
60     return true;
61 }
62 
resize(int width,int height)63 bool DisplayWindow::resize(int width, int height)
64 {
65     mWindow.width  = width;
66     mWindow.height = height;
67     return true;
68 }
69 
setVisible(bool isVisible)70 void DisplayWindow::setVisible(bool isVisible) {}
71 
signalTestEvent()72 void DisplayWindow::signalTestEvent()
73 {
74     Event event;
75     event.Type   = Event::EVENT_TEST;
76     event.Move.X = 0;
77     event.Move.Y = 0;
78     pushEvent(event);
79 }
80 
81 // static
82 #if defined(ANGLE_USE_VULKAN_DISPLAY)
New()83 OSWindow *OSWindow::New()
84 {
85     return new DisplayWindow();
86 }
87 #endif
88