• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2016 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 // Thread.h : Defines the Thread class which represents a global EGL thread.
8 
9 #ifndef LIBANGLE_THREAD_H_
10 #define LIBANGLE_THREAD_H_
11 
12 #include <EGL/egl.h>
13 
14 #include "libANGLE/Debug.h"
15 
16 namespace gl
17 {
18 class Context;
19 }  // namespace gl
20 
21 namespace egl
22 {
23 class Error;
24 class Debug;
25 class Display;
26 class Surface;
27 
28 class Thread : public LabeledObject
29 {
30   public:
31     Thread();
32 
33     void setLabel(EGLLabelKHR label) override;
34     EGLLabelKHR getLabel() const override;
35 
36     void setSuccess();
37     void setError(const Error &error,
38                   const Debug *debug,
39                   const char *command,
40                   const LabeledObject *object);
41     EGLint getError() const;
42 
43     void setAPI(EGLenum api);
44     EGLenum getAPI() const;
45 
46     void setCurrent(gl::Context *context);
47     Surface *getCurrentDrawSurface() const;
48     Surface *getCurrentReadSurface() const;
49     gl::Context *getContext() const;
50     gl::Context *getValidContext() const;
51     Display *getDisplay() const;
52 
53   private:
54     EGLLabelKHR mLabel;
55     EGLint mError;
56     EGLenum mAPI;
57     gl::Context *mContext;
58 };
59 
60 }  // namespace egl
61 
62 #endif  // LIBANGLE_THREAD_H_
63