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 | |
Jamie Madill | 811b635 | 2015-02-09 10:17:09 -0500 | [diff] [blame] | 7 | // FramebufferImpl.h: Defines the abstract rx::FramebufferImpl class. |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 8 | |
Jamie Madill | 811b635 | 2015-02-09 10:17:09 -0500 | [diff] [blame] | 9 | #ifndef LIBANGLE_RENDERER_FRAMEBUFFERIMPL_H_ |
| 10 | #define LIBANGLE_RENDERER_FRAMEBUFFERIMPL_H_ |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 11 | |
| 12 | #include "angle_gl.h" |
Jamie Madill | 1d57ad4 | 2015-02-02 16:57:06 -0500 | [diff] [blame] | 13 | #include "common/angleutils.h" |
| 14 | #include "libANGLE/Error.h" |
Jamie Madill | d1405e5 | 2015-03-05 15:41:39 -0500 | [diff] [blame] | 15 | #include "libANGLE/Framebuffer.h" |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 16 | |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 17 | namespace gl |
| 18 | { |
Geoff Lang | b04dc82 | 2014-12-01 12:02:02 -0500 | [diff] [blame] | 19 | class State; |
Geoff Lang | 54bd5a4 | 2014-12-01 12:51:04 -0500 | [diff] [blame] | 20 | class Framebuffer; |
Geoff Lang | 9dd9580 | 2014-12-01 11:12:59 -0500 | [diff] [blame] | 21 | class FramebufferAttachment; |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 22 | struct Rectangle; |
| 23 | } |
| 24 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 25 | namespace rx |
| 26 | { |
Jamie Madill | 6c1f671 | 2017-02-14 19:08:04 -0500 | [diff] [blame] | 27 | class DisplayImpl; |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 28 | |
Jamie Madill | f0d10f8 | 2015-03-31 12:56:52 -0400 | [diff] [blame] | 29 | class FramebufferImpl : angle::NonCopyable |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 30 | { |
| 31 | public: |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 32 | explicit FramebufferImpl(const gl::FramebufferState &state) : mState(state) {} |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 33 | virtual ~FramebufferImpl() {} |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 34 | virtual void destroy(const gl::Context *context) {} |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 35 | |
Jamie Madill | 64b7c4f | 2018-10-19 11:38:04 -0400 | [diff] [blame^] | 36 | virtual angle::Result discard(const gl::Context *context, |
| 37 | size_t count, |
| 38 | const GLenum *attachments) = 0; |
| 39 | virtual angle::Result invalidate(const gl::Context *context, |
| 40 | size_t count, |
| 41 | const GLenum *attachments) = 0; |
| 42 | virtual angle::Result invalidateSub(const gl::Context *context, |
| 43 | size_t count, |
| 44 | const GLenum *attachments, |
| 45 | const gl::Rectangle &area) = 0; |
Geoff Lang | 748f74e | 2014-12-01 11:25:34 -0500 | [diff] [blame] | 46 | |
Jamie Madill | 64b7c4f | 2018-10-19 11:38:04 -0400 | [diff] [blame^] | 47 | virtual angle::Result clear(const gl::Context *context, GLbitfield mask) = 0; |
| 48 | virtual angle::Result clearBufferfv(const gl::Context *context, |
| 49 | GLenum buffer, |
| 50 | GLint drawbuffer, |
| 51 | const GLfloat *values) = 0; |
| 52 | virtual angle::Result clearBufferuiv(const gl::Context *context, |
| 53 | GLenum buffer, |
| 54 | GLint drawbuffer, |
| 55 | const GLuint *values) = 0; |
| 56 | virtual angle::Result clearBufferiv(const gl::Context *context, |
| 57 | GLenum buffer, |
| 58 | GLint drawbuffer, |
| 59 | const GLint *values) = 0; |
| 60 | virtual angle::Result clearBufferfi(const gl::Context *context, |
| 61 | GLenum buffer, |
| 62 | GLint drawbuffer, |
| 63 | GLfloat depth, |
| 64 | GLint stencil) = 0; |
Geoff Lang | b04dc82 | 2014-12-01 12:02:02 -0500 | [diff] [blame] | 65 | |
Jamie Madill | 4928b7c | 2017-06-20 12:57:39 -0400 | [diff] [blame] | 66 | virtual GLenum getImplementationColorReadFormat(const gl::Context *context) const = 0; |
| 67 | virtual GLenum getImplementationColorReadType(const gl::Context *context) const = 0; |
Jamie Madill | 64b7c4f | 2018-10-19 11:38:04 -0400 | [diff] [blame^] | 68 | virtual angle::Result readPixels(const gl::Context *context, |
| 69 | const gl::Rectangle &area, |
| 70 | GLenum format, |
| 71 | GLenum type, |
| 72 | void *pixels) = 0; |
Geoff Lang | bce529e | 2014-12-01 12:48:41 -0500 | [diff] [blame] | 73 | |
Jamie Madill | 64b7c4f | 2018-10-19 11:38:04 -0400 | [diff] [blame^] | 74 | virtual angle::Result blit(const gl::Context *context, |
| 75 | const gl::Rectangle &sourceArea, |
| 76 | const gl::Rectangle &destArea, |
| 77 | GLbitfield mask, |
| 78 | GLenum filter) = 0; |
Geoff Lang | 54bd5a4 | 2014-12-01 12:51:04 -0500 | [diff] [blame] | 79 | |
Kenneth Russell | ce8602a | 2017-10-03 18:23:08 -0700 | [diff] [blame] | 80 | virtual bool checkStatus(const gl::Context *context) const = 0; |
Jamie Madill | 1d57ad4 | 2015-02-02 16:57:06 -0500 | [diff] [blame] | 81 | |
Jamie Madill | 6f755b2 | 2018-10-09 12:48:54 -0400 | [diff] [blame] | 82 | virtual angle::Result syncState(const gl::Context *context, |
| 83 | const gl::Framebuffer::DirtyBits &dirtyBits) = 0; |
Jamie Madill | 60ec6ea | 2016-01-22 15:27:19 -0500 | [diff] [blame] | 84 | |
Jamie Madill | 64b7c4f | 2018-10-19 11:38:04 -0400 | [diff] [blame^] | 85 | virtual angle::Result getSamplePosition(const gl::Context *context, |
| 86 | size_t index, |
| 87 | GLfloat *xy) const = 0; |
JiangYizhou | bddc46b | 2016-12-09 09:50:51 +0800 | [diff] [blame] | 88 | |
Jamie Madill | ab9f9c3 | 2017-01-17 17:47:34 -0500 | [diff] [blame] | 89 | const gl::FramebufferState &getState() const { return mState; } |
| 90 | |
Jamie Madill | d1405e5 | 2015-03-05 15:41:39 -0500 | [diff] [blame] | 91 | protected: |
Jamie Madill | 48ef11b | 2016-04-27 15:21:52 -0400 | [diff] [blame] | 92 | const gl::FramebufferState &mState; |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 93 | }; |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 94 | } |
| 95 | |
Jamie Madill | 231c7f5 | 2017-04-26 13:45:37 -0400 | [diff] [blame] | 96 | #endif // LIBANGLE_RENDERER_FRAMEBUFFERIMPL_H_ |