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 | |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 7 | // FramebufferD3D.cpp: Implements the DefaultAttachmentD3D and FramebufferD3D classes. |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 8 | |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 9 | #include "libANGLE/renderer/d3d/FramebufferD3D.h" |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 10 | #include "libANGLE/renderer/d3d/RendererD3D.h" |
Geoff Lang | 2b5420c | 2014-11-19 14:20:15 -0500 | [diff] [blame] | 11 | #include "libANGLE/renderer/RenderTarget.h" |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 12 | |
| 13 | namespace rx |
| 14 | { |
| 15 | |
| 16 | DefaultAttachmentD3D::DefaultAttachmentD3D(RenderTarget *renderTarget) |
| 17 | : mRenderTarget(renderTarget) |
| 18 | { |
| 19 | ASSERT(mRenderTarget); |
| 20 | } |
| 21 | |
| 22 | DefaultAttachmentD3D::~DefaultAttachmentD3D() |
| 23 | { |
| 24 | SafeDelete(mRenderTarget); |
| 25 | } |
| 26 | |
| 27 | DefaultAttachmentD3D *DefaultAttachmentD3D::makeDefaultAttachmentD3D(DefaultAttachmentImpl* impl) |
| 28 | { |
| 29 | ASSERT(HAS_DYNAMIC_TYPE(DefaultAttachmentD3D*, impl)); |
| 30 | return static_cast<DefaultAttachmentD3D*>(impl); |
| 31 | } |
| 32 | |
| 33 | GLsizei DefaultAttachmentD3D::getWidth() const |
| 34 | { |
| 35 | return mRenderTarget->getWidth(); |
| 36 | } |
| 37 | |
| 38 | GLsizei DefaultAttachmentD3D::getHeight() const |
| 39 | { |
| 40 | return mRenderTarget->getHeight(); |
| 41 | } |
| 42 | |
| 43 | GLenum DefaultAttachmentD3D::getInternalFormat() const |
| 44 | { |
| 45 | return mRenderTarget->getInternalFormat(); |
| 46 | } |
| 47 | |
| 48 | GLenum DefaultAttachmentD3D::getActualFormat() const |
| 49 | { |
| 50 | return mRenderTarget->getActualFormat(); |
| 51 | } |
| 52 | |
| 53 | GLsizei DefaultAttachmentD3D::getSamples() const |
| 54 | { |
| 55 | return mRenderTarget->getSamples(); |
| 56 | } |
| 57 | |
| 58 | RenderTarget *DefaultAttachmentD3D::getRenderTarget() const |
| 59 | { |
| 60 | return mRenderTarget; |
| 61 | } |
| 62 | |
Geoff Lang | da88add | 2014-12-01 10:22:01 -0500 | [diff] [blame] | 63 | |
| 64 | FramebufferD3D::FramebufferD3D(RendererD3D *renderer) |
| 65 | : mRenderer(renderer) |
| 66 | { |
| 67 | ASSERT(mRenderer != nullptr); |
| 68 | } |
| 69 | |
| 70 | FramebufferD3D::~FramebufferD3D() |
| 71 | { |
| 72 | } |
| 73 | |
Geoff Lang | 9ad4bda | 2014-12-01 11:03:09 -0500 | [diff] [blame] | 74 | gl::Error FramebufferD3D::invalidate(size_t, const GLenum *) |
| 75 | { |
| 76 | // No-op in D3D |
| 77 | return gl::Error(GL_NO_ERROR); |
| 78 | } |
| 79 | |
| 80 | gl::Error FramebufferD3D::invalidateSub(size_t, const GLenum *, const gl::Rectangle &) |
| 81 | { |
| 82 | // No-op in D3D |
| 83 | return gl::Error(GL_NO_ERROR); |
| 84 | } |
| 85 | |
Geoff Lang | 6a1e6b9 | 2014-11-06 10:42:45 -0500 | [diff] [blame] | 86 | } |