xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/gl/ImageGL.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1*8975f5c5SAndroid Build Coastguard Worker //
2*8975f5c5SAndroid Build Coastguard Worker // Copyright 2018 The ANGLE Project Authors. All rights reserved.
3*8975f5c5SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be
4*8975f5c5SAndroid Build Coastguard Worker // found in the LICENSE file.
5*8975f5c5SAndroid Build Coastguard Worker //
6*8975f5c5SAndroid Build Coastguard Worker 
7*8975f5c5SAndroid Build Coastguard Worker // ImageGL.h: Defines the rx::ImageGL class, the GL implementation of EGL images
8*8975f5c5SAndroid Build Coastguard Worker 
9*8975f5c5SAndroid Build Coastguard Worker #ifndef LIBANGLE_RENDERER_GL_IMAGEGL_H_
10*8975f5c5SAndroid Build Coastguard Worker #define LIBANGLE_RENDERER_GL_IMAGEGL_H_
11*8975f5c5SAndroid Build Coastguard Worker 
12*8975f5c5SAndroid Build Coastguard Worker #include "common/PackedEnums.h"
13*8975f5c5SAndroid Build Coastguard Worker #include "libANGLE/renderer/ImageImpl.h"
14*8975f5c5SAndroid Build Coastguard Worker 
15*8975f5c5SAndroid Build Coastguard Worker namespace rx
16*8975f5c5SAndroid Build Coastguard Worker {
17*8975f5c5SAndroid Build Coastguard Worker class TextureGL;
18*8975f5c5SAndroid Build Coastguard Worker class RenderbufferGL;
19*8975f5c5SAndroid Build Coastguard Worker 
20*8975f5c5SAndroid Build Coastguard Worker class ImageGL : public ImageImpl
21*8975f5c5SAndroid Build Coastguard Worker {
22*8975f5c5SAndroid Build Coastguard Worker   public:
23*8975f5c5SAndroid Build Coastguard Worker     ImageGL(const egl::ImageState &state);
24*8975f5c5SAndroid Build Coastguard Worker     ~ImageGL() override;
25*8975f5c5SAndroid Build Coastguard Worker 
26*8975f5c5SAndroid Build Coastguard Worker     // TextureGL does not have access to all the parameters needed to implement
27*8975f5c5SAndroid Build Coastguard Worker     // glEGLImageTargetTexture2DOES or glEGLImageTargetRenderbufferStorageOES. This allows the Image
28*8975f5c5SAndroid Build Coastguard Worker     // to implement these functions because it holds the native EGLimage or emulated object.
29*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result setTexture2D(const gl::Context *context,
30*8975f5c5SAndroid Build Coastguard Worker                                        gl::TextureType type,
31*8975f5c5SAndroid Build Coastguard Worker                                        TextureGL *texture,
32*8975f5c5SAndroid Build Coastguard Worker                                        GLenum *outInternalFormat)           = 0;
33*8975f5c5SAndroid Build Coastguard Worker     virtual angle::Result setRenderbufferStorage(const gl::Context *context,
34*8975f5c5SAndroid Build Coastguard Worker                                                  RenderbufferGL *renderbuffer,
35*8975f5c5SAndroid Build Coastguard Worker                                                  GLenum *outInternalFormat) = 0;
36*8975f5c5SAndroid Build Coastguard Worker };
37*8975f5c5SAndroid Build Coastguard Worker 
38*8975f5c5SAndroid Build Coastguard Worker }  // namespace rx
39*8975f5c5SAndroid Build Coastguard Worker 
40*8975f5c5SAndroid Build Coastguard Worker #endif  // LIBANGLE_RENDERER_GL_IMAGEGL_H_
41