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 | 9dd9580 | 2014-12-01 11:12:59 -0500 | [diff] [blame^] | 18 | class FramebufferAttachment; |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 19 | struct Rectangle; |
| 20 | } |
| 21 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 22 | namespace rx |
| 23 | { |
| 24 | |
| 25 | class DefaultAttachmentImpl |
| 26 | { |
| 27 | public: |
| 28 | virtual ~DefaultAttachmentImpl() {}; |
| 29 | |
| 30 | virtual GLsizei getWidth() const = 0; |
| 31 | virtual GLsizei getHeight() const = 0; |
| 32 | virtual GLenum getInternalFormat() const = 0; |
| 33 | virtual GLenum getActualFormat() const = 0; |
| 34 | virtual GLsizei getSamples() const = 0; |
| 35 | }; |
| 36 | |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 37 | class FramebufferImpl |
| 38 | { |
| 39 | public: |
| 40 | virtual ~FramebufferImpl() {}; |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 41 | |
Geoff Lang | 9dd9580 | 2014-12-01 11:12:59 -0500 | [diff] [blame^] | 42 | virtual void setColorAttachment(size_t index, const gl::FramebufferAttachment *attachment) = 0; |
| 43 | virtual void setDepthttachment(const gl::FramebufferAttachment *attachment) = 0; |
| 44 | virtual void setStencilAttachment(const gl::FramebufferAttachment *attachment) = 0; |
| 45 | virtual void setDepthStencilAttachment(const gl::FramebufferAttachment *attachment) = 0; |
| 46 | |
| 47 | virtual void setDrawBuffers(size_t count, const GLenum *buffers) = 0; |
| 48 | virtual void setReadBuffer(GLenum buffer) = 0; |
| 49 | |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 50 | virtual gl::Error invalidate(size_t count, const GLenum *attachments) = 0; |
| 51 | virtual gl::Error invalidateSub(size_t count, const GLenum *attachments, const gl::Rectangle &area) = 0; |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 52 | }; |
| 53 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 54 | } |
| 55 | |
Geoff Lang | 0a73dd8 | 2014-11-19 16:18:08 -0500 | [diff] [blame] | 56 | #endif // LIBANGLE_RENDERER_FRAMBUFFERIMPL_H_ |