forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsurface.h
47 lines (37 loc) · 1.34 KB
/
surface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2011 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 GPU_GLES2_CONFORM_SUPPORT_EGL_SURFACE_H_
#define GPU_GLES2_CONFORM_SUPPORT_EGL_SURFACE_H_
#include <EGL/egl.h>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
namespace gl {
class GLSurface;
}
namespace gles2_conform_support {
namespace egl {
class Config;
class Surface : public base::RefCountedThreadSafe<Surface> {
public:
explicit Surface(gl::GLSurface* gl_surface, const Config* config);
Surface(const Surface&) = delete;
Surface& operator=(const Surface&) = delete;
void set_is_current_in_some_thread(bool flag) {
is_current_in_some_thread_ = flag;
}
bool is_current_in_some_thread() const { return is_current_in_some_thread_; }
gl::GLSurface* gl_surface() const;
const Config* config() const;
static bool ValidatePbufferAttributeList(const EGLint* attrib_list);
static bool ValidateWindowAttributeList(const EGLint* attrib_list);
private:
friend class base::RefCountedThreadSafe<Surface>;
~Surface();
bool is_current_in_some_thread_;
scoped_refptr<gl::GLSurface> gl_surface_;
raw_ptr<const Config> config_;
};
} // namespace egl
} // namespace gles2_conform_support
#endif // GPU_GLES2_CONFORM_SUPPORT_EGL_SURFACE_H_