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 // Framebuffer9.h: Defines the Framebuffer9 class. 8 9 #ifndef LIBANGLE_RENDERER_D3D_D3D9_FRAMBUFFER9_H_ 10 #define LIBANGLE_RENDERER_D3D_D3D9_FRAMBUFFER9_H_ 11 12 #include "libANGLE/renderer/RenderTargetCache.h" 13 #include "libANGLE/renderer/d3d/FramebufferD3D.h" 14 #include "libANGLE/renderer/d3d/d3d9/renderer9_utils.h" 15 16 namespace rx 17 { 18 class Renderer9; 19 20 class Framebuffer9 : public FramebufferD3D 21 { 22 public: 23 Framebuffer9(const gl::FramebufferState &data, Renderer9 *renderer); 24 ~Framebuffer9() override; 25 26 angle::Result discard(const gl::Context *context, 27 size_t count, 28 const GLenum *attachments) override; 29 angle::Result invalidate(const gl::Context *context, 30 size_t count, 31 const GLenum *attachments) override; 32 angle::Result invalidateSub(const gl::Context *context, 33 size_t count, 34 const GLenum *attachments, 35 const gl::Rectangle &area) override; 36 37 angle::Result getSamplePosition(const gl::Context *context, 38 size_t index, 39 GLfloat *xy) const override; 40 41 angle::Result syncState(const gl::Context *context, 42 GLenum binding, 43 const gl::Framebuffer::DirtyBits &dirtyBits) override; 44 getCachedColorRenderTargets()45 const gl::AttachmentArray<RenderTarget9 *> &getCachedColorRenderTargets() const 46 { 47 return mRenderTargetCache.getColors(); 48 } 49 getCachedDepthStencilRenderTarget()50 const RenderTarget9 *getCachedDepthStencilRenderTarget() const 51 { 52 return mRenderTargetCache.getDepthStencil(true); 53 } 54 55 const gl::InternalFormat &getImplementationColorReadFormat( 56 const gl::Context *context) const override; 57 58 private: 59 angle::Result clearImpl(const gl::Context *context, 60 const ClearParameters &clearParams) override; 61 62 angle::Result readPixelsImpl(const gl::Context *context, 63 const gl::Rectangle &area, 64 GLenum format, 65 GLenum type, 66 size_t outputPitch, 67 const gl::PixelPackState &pack, 68 uint8_t *pixels) override; 69 70 angle::Result blitImpl(const gl::Context *context, 71 const gl::Rectangle &sourceArea, 72 const gl::Rectangle &destArea, 73 const gl::Rectangle *scissor, 74 bool blitRenderTarget, 75 bool blitDepth, 76 bool blitStencil, 77 GLenum filter, 78 const gl::Framebuffer *sourceFramebuffer) override; 79 80 Renderer9 *const mRenderer; 81 82 RenderTargetCache<RenderTarget9> mRenderTargetCache; 83 }; 84 85 } // namespace rx 86 87 #endif // LIBANGLE_RENDERER_D3D_D3D9_FRAMBUFFER9_H_ 88