1 // 2 // Copyright 2014 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 // RenderbufferImpl.h: Defines the abstract class gl::RenderbufferImpl 8 9 #ifndef LIBANGLE_RENDERER_RENDERBUFFERIMPL_H_ 10 #define LIBANGLE_RENDERER_RENDERBUFFERIMPL_H_ 11 12 #include "angle_gl.h" 13 #include "common/angleutils.h" 14 #include "libANGLE/Error.h" 15 #include "libANGLE/renderer/FramebufferAttachmentObjectImpl.h" 16 17 namespace gl 18 { 19 class RenderbufferState; 20 } // namespace gl 21 22 namespace egl 23 { 24 class Image; 25 } // namespace egl 26 27 namespace rx 28 { 29 30 class RenderbufferImpl : public FramebufferAttachmentObjectImpl 31 { 32 public: RenderbufferImpl(const gl::RenderbufferState & state)33 RenderbufferImpl(const gl::RenderbufferState &state) : mState(state) {} ~RenderbufferImpl()34 ~RenderbufferImpl() override {} onDestroy(const gl::Context * context)35 virtual void onDestroy(const gl::Context *context) {} 36 37 virtual angle::Result setStorage(const gl::Context *context, 38 GLenum internalformat, 39 size_t width, 40 size_t height) = 0; 41 virtual angle::Result setStorageMultisample(const gl::Context *context, 42 size_t samples, 43 GLenum internalformat, 44 size_t width, 45 size_t height) = 0; 46 virtual angle::Result setStorageEGLImageTarget(const gl::Context *context, 47 egl::Image *image) = 0; 48 49 // Override if accurate native memory size information is available 50 virtual GLint getMemorySize() const; 51 52 protected: 53 const gl::RenderbufferState &mState; 54 }; 55 getMemorySize()56inline GLint RenderbufferImpl::getMemorySize() const 57 { 58 return 0; 59 } 60 61 } // namespace rx 62 63 #endif // LIBANGLE_RENDERER_RENDERBUFFERIMPL_H_ 64