Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 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 | // FramebufferImpl.h: Defines the abstract rx::DefaultAttachmentImpl class. |
| 8 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 9 | #ifndef LIBANGLE_RENDERER_FRAMBUFFERIMPL_H_ |
| 10 | #define LIBANGLE_RENDERER_FRAMBUFFERIMPL_H_ |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 11 | |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 12 | #include "libANGLE/Error.h" |
| 13 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 14 | #include "angle_gl.h" |
| 15 | |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 16 | namespace gl |
| 17 | { |
Geoff Lang | b04dc82 | 2014-12-01 12:02:02 -0500 | [diff] [blame] | 18 | class State; |
Geoff Lang | 9dd9580 | 2014-12-01 11:12:59 -0500 | [diff] [blame] | 19 | class FramebufferAttachment; |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 20 | struct Rectangle; |
| 21 | } |
| 22 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 23 | namespace rx |
| 24 | { |
| 25 | |
| 26 | class DefaultAttachmentImpl |
| 27 | { |
| 28 | public: |
| 29 | virtual ~DefaultAttachmentImpl() {}; |
| 30 | |
| 31 | virtual GLsizei getWidth() const = 0; |
| 32 | virtual GLsizei getHeight() const = 0; |
| 33 | virtual GLenum getInternalFormat() const = 0; |
| 34 | virtual GLenum getActualFormat() const = 0; |
| 35 | virtual GLsizei getSamples() const = 0; |
| 36 | }; |
| 37 | |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 38 | class FramebufferImpl |
| 39 | { |
| 40 | public: |
| 41 | virtual ~FramebufferImpl() {}; |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 42 | |
Geoff Lang | 9dd9580 | 2014-12-01 11:12:59 -0500 | [diff] [blame] | 43 | virtual void setColorAttachment(size_t index, const gl::FramebufferAttachment *attachment) = 0; |
| 44 | virtual void setDepthttachment(const gl::FramebufferAttachment *attachment) = 0; |
| 45 | virtual void setStencilAttachment(const gl::FramebufferAttachment *attachment) = 0; |
| 46 | virtual void setDepthStencilAttachment(const gl::FramebufferAttachment *attachment) = 0; |
| 47 | |
| 48 | virtual void setDrawBuffers(size_t count, const GLenum *buffers) = 0; |
| 49 | virtual void setReadBuffer(GLenum buffer) = 0; |
| 50 | |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 51 | virtual gl::Error invalidate(size_t count, const GLenum *attachments) = 0; |
| 52 | virtual gl::Error invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area) = 0; |
Geoff Lang | 748f74e | 2014-12-01 11:25:34 -0500 | [diff] [blame] | 53 | |
Geoff Lang | b04dc82 | 2014-12-01 12:02:02 -0500 | [diff] [blame] | 54 | virtual gl::Error clear(const gl::State &state, GLbitfield mask) = 0; |
| 55 | virtual gl::Error clearBufferfv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLfloat *values) = 0; |
| 56 | virtual gl::Error clearBufferuiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLuint *values) = 0; |
| 57 | virtual gl::Error clearBufferiv(const gl::State &state, GLenum buffer, GLint drawbuffer, const GLint *values) = 0; |
| 58 | virtual gl::Error clearBufferfi(const gl::State &state, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) = 0; |
| 59 | |
Geoff Lang | bce529e | 2014-12-01 12:48:41 -0500 | [diff] [blame^] | 60 | virtual GLenum getImplementationColorReadFormat() const = 0; |
| 61 | virtual GLenum getImplementationColorReadType() const = 0; |
| 62 | virtual gl::Error readPixels(const gl::State &state, const gl::Rectangle &area, GLenum format, GLenum type, GLvoid *pixels) const = 0; |
| 63 | |
Geoff Lang | 748f74e | 2014-12-01 11:25:34 -0500 | [diff] [blame] | 64 | virtual GLenum checkStatus() const = 0; |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 65 | }; |
| 66 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 67 | } |
| 68 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 69 | #endif // LIBANGLE_RENDERER_FRAMBUFFERIMPL_H_ |