• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2018 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 // NativeBufferImageSiblingAndroid.h: Defines the NativeBufferImageSiblingAndroid to wrap EGL images
8 // created from ANativeWindowBuffer objects
9 
10 #ifndef LIBANGLE_RENDERER_GL_EGL_ANDROID_NATIVEBUFFERIMAGESIBLINGANDROID_H_
11 #define LIBANGLE_RENDERER_GL_EGL_ANDROID_NATIVEBUFFERIMAGESIBLINGANDROID_H_
12 
13 #include "libANGLE/renderer/gl/egl/ExternalImageSiblingEGL.h"
14 
15 namespace rx
16 {
17 
18 class NativeBufferImageSiblingAndroid : public ExternalImageSiblingEGL
19 {
20   public:
21     NativeBufferImageSiblingAndroid(EGLClientBuffer buffer);
22     ~NativeBufferImageSiblingAndroid() override;
23 
24     egl::Error initialize(const egl::Display *display) override;
25 
26     // ExternalImageSiblingImpl interface
27     gl::Format getFormat() const override;
28     bool isRenderable(const gl::Context *context) const override;
29     bool isTexturable(const gl::Context *context) const override;
30     bool isYUV() const override;
31     gl::Extents getSize() const override;
32     size_t getSamples() const override;
33 
34     // ExternalImageSiblingEGL interface
35     EGLClientBuffer getBuffer() const override;
36 
37   private:
38     EGLClientBuffer mBuffer;
39     gl::Extents mSize;
40     gl::Format mFormat;
41     bool mYUV;
42 };
43 
44 }  // namespace rx
45 
46 #endif  // LIBANGLE_RENDERER_GL_EGL_ANDROID_NATIVEBUFFERIMAGESIBLINGANDROID_H_
47