Commit 62a4be24 by Jamie Madill

Move the Image::copy implementation to ImageD3D.

This method uses rx::RenderTarget, which is D3D-only. BUG=angle:773 Change-Id: I2cb523fa98bda96661260d37a8c69c2ed8e7aa84 Reviewed-on: https://chromium-review.googlesource.com/233441Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarKenneth Russell <kbr@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent b5d8f23e
...@@ -9,9 +9,6 @@ ...@@ -9,9 +9,6 @@
// surfaces or resources. // surfaces or resources.
#include "libANGLE/renderer/Image.h" #include "libANGLE/renderer/Image.h"
#include "libANGLE/renderer/d3d/FramebufferD3D.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h"
namespace rx namespace rx
{ {
...@@ -28,20 +25,4 @@ Image::Image() ...@@ -28,20 +25,4 @@ Image::Image()
mDirty = false; mDirty = false;
} }
gl::Error Image::copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &area, gl::Framebuffer *source)
{
gl::FramebufferAttachment *colorbuffer = source->getReadColorbuffer();
ASSERT(colorbuffer);
RenderTarget *renderTarget = NULL;
gl::Error error = GetAttachmentRenderTarget(colorbuffer, &renderTarget);
if (error.isError())
{
return error;
}
ASSERT(renderTarget);
return copy(xoffset, yoffset, zoffset, area, renderTarget);
}
} }
...@@ -54,8 +54,7 @@ class Image ...@@ -54,8 +54,7 @@ class Image
virtual gl::Error loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, virtual gl::Error loadCompressedData(GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
const void *input) = 0; const void *input) = 0;
gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea, gl::Framebuffer *source); virtual gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea, gl::Framebuffer *source) = 0;
virtual gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea, RenderTarget *source) = 0;
virtual gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea, virtual gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea,
const gl::ImageIndex &sourceIndex, TextureStorage *source) = 0; const gl::ImageIndex &sourceIndex, TextureStorage *source) = 0;
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
#include "libANGLE/renderer/d3d/ImageD3D.h" #include "libANGLE/renderer/d3d/ImageD3D.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/renderer/d3d/FramebufferD3D.h"
namespace rx namespace rx
{ {
...@@ -23,4 +27,20 @@ ImageD3D *ImageD3D::makeImageD3D(Image *img) ...@@ -23,4 +27,20 @@ ImageD3D *ImageD3D::makeImageD3D(Image *img)
return static_cast<ImageD3D*>(img); return static_cast<ImageD3D*>(img);
} }
gl::Error ImageD3D::copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &area, gl::Framebuffer *source)
{
gl::FramebufferAttachment *colorbuffer = source->getReadColorbuffer();
ASSERT(colorbuffer);
RenderTarget *renderTarget = NULL;
gl::Error error = GetAttachmentRenderTarget(colorbuffer, &renderTarget);
if (error.isError())
{
return error;
}
ASSERT(renderTarget);
return copy(xoffset, yoffset, zoffset, area, renderTarget);
}
} }
...@@ -41,8 +41,12 @@ class ImageD3D : public Image ...@@ -41,8 +41,12 @@ class ImageD3D : public Image
virtual gl::Error setManagedSurface2DArray(TextureStorage *storage, int layer, int level) { return gl::Error(GL_NO_ERROR); }; virtual gl::Error setManagedSurface2DArray(TextureStorage *storage, int layer, int level) { return gl::Error(GL_NO_ERROR); };
virtual gl::Error copyToStorage(TextureStorage *storage, const gl::ImageIndex &index, const gl::Box &region) = 0; virtual gl::Error copyToStorage(TextureStorage *storage, const gl::ImageIndex &index, const gl::Box &region) = 0;
gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea, gl::Framebuffer *source) override;
private: private:
DISALLOW_COPY_AND_ASSIGN(ImageD3D); DISALLOW_COPY_AND_ASSIGN(ImageD3D);
virtual gl::Error copy(GLint xoffset, GLint yoffset, GLint zoffset, const gl::Rectangle &sourceArea, RenderTarget *source) = 0;
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment