Edit

kc3-lang/angle/src/libANGLE/renderer/d3d/ImageD3D.cpp

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2015-05-04 12:55:18
    Hash : 8cf813c7
    Message : Query attachment render targets from Impl class. *re-land with fix for D3D9* This allows us to eradicate the GetAttachmentRenderTarget methods. This improves potential performance, at the cost of exposing a Renderer-specific function at the API object level. BUG=angleproject:963 Change-Id: Iee9f985ddaed668df0c622228004b348eb4d2ea8 Reviewed-on: https://chromium-review.googlesource.com/269006 Tested-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>

  • src/libANGLE/renderer/d3d/ImageD3D.cpp
  • //
    // Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    
    // Image.h: Implements the rx::Image class, an abstract base class for the
    // renderer-specific classes which will define the interface to the underlying
    // surfaces or resources.
    
    #include "libANGLE/renderer/d3d/ImageD3D.h"
    
    #include "libANGLE/Framebuffer.h"
    #include "libANGLE/FramebufferAttachment.h"
    #include "libANGLE/renderer/d3d/FramebufferD3D.h"
    #include "libANGLE/renderer/d3d/RenderTargetD3D.h"
    
    namespace rx
    {
    
    ImageD3D::ImageD3D()
        : mWidth(0),
          mHeight(0),
          mDepth(0),
          mInternalFormat(GL_NONE),
          mTarget(GL_NONE),
          mRenderable(false),
          mDirty(false)
    {
    }
    
    gl::Error ImageD3D::copy(const gl::Offset &destOffset, const gl::Rectangle &sourceArea, const gl::Framebuffer *source)
    {
        const gl::FramebufferAttachment *srcAttachment = source->getReadColorbuffer();
        ASSERT(srcAttachment);
    
        RenderTargetD3D *renderTarget = NULL;
        gl::Error error = srcAttachment->getRenderTarget(&renderTarget);
        if (error.isError())
        {
            return error;
        }
    
        ASSERT(renderTarget);
        return copy(destOffset, sourceArea, renderTarget);
    }
    
    }