X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2Fangle%2Fsrc%2FlibGLESv2%2Frenderer%2Fd3d%2Fd3d9%2FBlit9.h;h=ca722744071118db9f3bdbe57427a621b1d601d5;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=46a3ee1cf36d953717bb9a1746db07835065caca;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.h b/src/third_party/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.h index 46a3ee1..ca72274 100644 --- a/src/third_party/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.h +++ b/src/third_party/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.h @@ -10,6 +10,7 @@ #define LIBGLESV2_BLIT9_H_ #include "common/angleutils.h" +#include "libGLESv2/Error.h" #include @@ -29,32 +30,33 @@ class Blit9 explicit Blit9(Renderer9 *renderer); ~Blit9(); + gl::Error initialize(); + // Copy from source surface to dest surface. // sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left) - bool copy2D(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage *storage, GLint level); - bool copyCube(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage *storage, GLenum target, GLint level); + gl::Error copy2D(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage *storage, GLint level); + gl::Error copyCube(gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, TextureStorage *storage, GLenum target, GLint level); // Copy from source surface to dest surface. // sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left) // source is interpreted as RGBA and destFormat specifies the desired result format. For example, if destFormat = GL_RGB, the alpha channel will be forced to 0. - bool formatConvert(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, IDirect3DSurface9 *dest); + gl::Error formatConvert(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, IDirect3DSurface9 *dest); // 2x2 box filter sample from source to dest. // Requires that source is RGB(A) and dest has the same format as source. - bool boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest); + gl::Error boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest); private: rx::Renderer9 *mRenderer; + bool mGeometryLoaded; IDirect3DVertexBuffer9 *mQuadVertexBuffer; IDirect3DVertexDeclaration9 *mQuadVertexDeclaration; - void initGeometry(); - - bool setFormatConvertShaders(GLenum destFormat); + gl::Error setFormatConvertShaders(GLenum destFormat); - bool copy(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, IDirect3DSurface9 *dest); - IDirect3DTexture9 *copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect); + gl::Error copy(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFormat, GLint xoffset, GLint yoffset, IDirect3DSurface9 *dest); + gl::Error copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect, IDirect3DTexture9 **outTexture); void setViewport(const RECT &sourceRect, GLint xoffset, GLint yoffset); void setCommonBlitState(); RECT getSurfaceRect(IDirect3DSurface9 *surface) const; @@ -74,12 +76,12 @@ class Blit9 IUnknown *mCompiledShaders[SHADER_COUNT]; template - bool setShader(ShaderId source, const char *profile, - D3DShaderType *(Renderer9::*createShader)(const DWORD *, size_t length), - HRESULT (WINAPI IDirect3DDevice9::*setShader)(D3DShaderType*)); + gl::Error setShader(ShaderId source, const char *profile, + gl::Error (Renderer9::*createShader)(const DWORD *, size_t length, D3DShaderType **outShader), + HRESULT (WINAPI IDirect3DDevice9::*setShader)(D3DShaderType*)); - bool setVertexShader(ShaderId shader); - bool setPixelShader(ShaderId shader); + gl::Error setVertexShader(ShaderId shader); + gl::Error setPixelShader(ShaderId shader); void render(); void saveState();