1 //
2 // Copyright 2016 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 // TextureNULL.cpp:
7 // Implements the class methods for TextureNULL.
8 //
9
10 #include "libANGLE/renderer/null/TextureNULL.h"
11
12 #include "common/debug.h"
13
14 namespace rx
15 {
16
TextureNULL(const gl::TextureState & state)17 TextureNULL::TextureNULL(const gl::TextureState &state) : TextureImpl(state) {}
18
~TextureNULL()19 TextureNULL::~TextureNULL() {}
20
setImage(const gl::Context * context,const gl::ImageIndex & index,GLenum internalFormat,const gl::Extents & size,GLenum format,GLenum type,const gl::PixelUnpackState & unpack,gl::Buffer * unpackBuffer,const uint8_t * pixels)21 angle::Result TextureNULL::setImage(const gl::Context *context,
22 const gl::ImageIndex &index,
23 GLenum internalFormat,
24 const gl::Extents &size,
25 GLenum format,
26 GLenum type,
27 const gl::PixelUnpackState &unpack,
28 gl::Buffer *unpackBuffer,
29 const uint8_t *pixels)
30 {
31 // TODO(geofflang): Read all incoming pixel data (maybe hash it?) to make sure we don't read out
32 // of bounds due to validation bugs.
33 return angle::Result::Continue;
34 }
35
setSubImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Box & area,GLenum format,GLenum type,const gl::PixelUnpackState & unpack,gl::Buffer * unpackBuffer,const uint8_t * pixels)36 angle::Result TextureNULL::setSubImage(const gl::Context *context,
37 const gl::ImageIndex &index,
38 const gl::Box &area,
39 GLenum format,
40 GLenum type,
41 const gl::PixelUnpackState &unpack,
42 gl::Buffer *unpackBuffer,
43 const uint8_t *pixels)
44 {
45 return angle::Result::Continue;
46 }
47
setCompressedImage(const gl::Context * context,const gl::ImageIndex & index,GLenum internalFormat,const gl::Extents & size,const gl::PixelUnpackState & unpack,size_t imageSize,const uint8_t * pixels)48 angle::Result TextureNULL::setCompressedImage(const gl::Context *context,
49 const gl::ImageIndex &index,
50 GLenum internalFormat,
51 const gl::Extents &size,
52 const gl::PixelUnpackState &unpack,
53 size_t imageSize,
54 const uint8_t *pixels)
55 {
56 return angle::Result::Continue;
57 }
58
setCompressedSubImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Box & area,GLenum format,const gl::PixelUnpackState & unpack,size_t imageSize,const uint8_t * pixels)59 angle::Result TextureNULL::setCompressedSubImage(const gl::Context *context,
60 const gl::ImageIndex &index,
61 const gl::Box &area,
62 GLenum format,
63 const gl::PixelUnpackState &unpack,
64 size_t imageSize,
65 const uint8_t *pixels)
66 {
67 return angle::Result::Continue;
68 }
69
copyImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Rectangle & sourceArea,GLenum internalFormat,gl::Framebuffer * source)70 angle::Result TextureNULL::copyImage(const gl::Context *context,
71 const gl::ImageIndex &index,
72 const gl::Rectangle &sourceArea,
73 GLenum internalFormat,
74 gl::Framebuffer *source)
75 {
76 return angle::Result::Continue;
77 }
78
copySubImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Offset & destOffset,const gl::Rectangle & sourceArea,gl::Framebuffer * source)79 angle::Result TextureNULL::copySubImage(const gl::Context *context,
80 const gl::ImageIndex &index,
81 const gl::Offset &destOffset,
82 const gl::Rectangle &sourceArea,
83 gl::Framebuffer *source)
84 {
85 return angle::Result::Continue;
86 }
87
copyTexture(const gl::Context * context,const gl::ImageIndex & index,GLenum internalFormat,GLenum type,GLint sourceLevel,bool unpackFlipY,bool unpackPremultiplyAlpha,bool unpackUnmultiplyAlpha,const gl::Texture * source)88 angle::Result TextureNULL::copyTexture(const gl::Context *context,
89 const gl::ImageIndex &index,
90 GLenum internalFormat,
91 GLenum type,
92 GLint sourceLevel,
93 bool unpackFlipY,
94 bool unpackPremultiplyAlpha,
95 bool unpackUnmultiplyAlpha,
96 const gl::Texture *source)
97 {
98 return angle::Result::Continue;
99 }
100
copySubTexture(const gl::Context * context,const gl::ImageIndex & index,const gl::Offset & destOffset,GLint sourceLevel,const gl::Box & sourceBox,bool unpackFlipY,bool unpackPremultiplyAlpha,bool unpackUnmultiplyAlpha,const gl::Texture * source)101 angle::Result TextureNULL::copySubTexture(const gl::Context *context,
102 const gl::ImageIndex &index,
103 const gl::Offset &destOffset,
104 GLint sourceLevel,
105 const gl::Box &sourceBox,
106 bool unpackFlipY,
107 bool unpackPremultiplyAlpha,
108 bool unpackUnmultiplyAlpha,
109 const gl::Texture *source)
110 {
111 return angle::Result::Continue;
112 }
113
copyRenderbufferSubData(const gl::Context * context,const gl::Renderbuffer * srcBuffer,GLint srcLevel,GLint srcX,GLint srcY,GLint srcZ,GLint dstLevel,GLint dstX,GLint dstY,GLint dstZ,GLsizei srcWidth,GLsizei srcHeight,GLsizei srcDepth)114 angle::Result TextureNULL::copyRenderbufferSubData(const gl::Context *context,
115 const gl::Renderbuffer *srcBuffer,
116 GLint srcLevel,
117 GLint srcX,
118 GLint srcY,
119 GLint srcZ,
120 GLint dstLevel,
121 GLint dstX,
122 GLint dstY,
123 GLint dstZ,
124 GLsizei srcWidth,
125 GLsizei srcHeight,
126 GLsizei srcDepth)
127 {
128 return angle::Result::Continue;
129 }
130
copyTextureSubData(const gl::Context * context,const gl::Texture * srcTexture,GLint srcLevel,GLint srcX,GLint srcY,GLint srcZ,GLint dstLevel,GLint dstX,GLint dstY,GLint dstZ,GLsizei srcWidth,GLsizei srcHeight,GLsizei srcDepth)131 angle::Result TextureNULL::copyTextureSubData(const gl::Context *context,
132 const gl::Texture *srcTexture,
133 GLint srcLevel,
134 GLint srcX,
135 GLint srcY,
136 GLint srcZ,
137 GLint dstLevel,
138 GLint dstX,
139 GLint dstY,
140 GLint dstZ,
141 GLsizei srcWidth,
142 GLsizei srcHeight,
143 GLsizei srcDepth)
144 {
145 return angle::Result::Continue;
146 }
147
copyCompressedTexture(const gl::Context * context,const gl::Texture * source)148 angle::Result TextureNULL::copyCompressedTexture(const gl::Context *context,
149 const gl::Texture *source)
150 {
151 return angle::Result::Continue;
152 }
153
setStorage(const gl::Context * context,gl::TextureType type,size_t levels,GLenum internalFormat,const gl::Extents & size)154 angle::Result TextureNULL::setStorage(const gl::Context *context,
155 gl::TextureType type,
156 size_t levels,
157 GLenum internalFormat,
158 const gl::Extents &size)
159 {
160 return angle::Result::Continue;
161 }
162
setStorageExternalMemory(const gl::Context * context,gl::TextureType type,size_t levels,GLenum internalFormat,const gl::Extents & size,gl::MemoryObject * memoryObject,GLuint64 offset,GLbitfield createFlags,GLbitfield usageFlags)163 angle::Result TextureNULL::setStorageExternalMemory(const gl::Context *context,
164 gl::TextureType type,
165 size_t levels,
166 GLenum internalFormat,
167 const gl::Extents &size,
168 gl::MemoryObject *memoryObject,
169 GLuint64 offset,
170 GLbitfield createFlags,
171 GLbitfield usageFlags)
172 {
173 return angle::Result::Continue;
174 }
175
setEGLImageTarget(const gl::Context * context,gl::TextureType type,egl::Image * image)176 angle::Result TextureNULL::setEGLImageTarget(const gl::Context *context,
177 gl::TextureType type,
178 egl::Image *image)
179 {
180 return angle::Result::Continue;
181 }
182
setImageExternal(const gl::Context * context,gl::TextureType type,egl::Stream * stream,const egl::Stream::GLTextureDescription & desc)183 angle::Result TextureNULL::setImageExternal(const gl::Context *context,
184 gl::TextureType type,
185 egl::Stream *stream,
186 const egl::Stream::GLTextureDescription &desc)
187 {
188 return angle::Result::Continue;
189 }
190
generateMipmap(const gl::Context * context)191 angle::Result TextureNULL::generateMipmap(const gl::Context *context)
192 {
193 return angle::Result::Continue;
194 }
195
setBaseLevel(const gl::Context * context,GLuint baseLevel)196 angle::Result TextureNULL::setBaseLevel(const gl::Context *context, GLuint baseLevel)
197 {
198 return angle::Result::Continue;
199 }
200
bindTexImage(const gl::Context * context,egl::Surface * surface)201 angle::Result TextureNULL::bindTexImage(const gl::Context *context, egl::Surface *surface)
202 {
203 return angle::Result::Continue;
204 }
205
releaseTexImage(const gl::Context * context)206 angle::Result TextureNULL::releaseTexImage(const gl::Context *context)
207 {
208 return angle::Result::Continue;
209 }
210
syncState(const gl::Context * context,const gl::Texture::DirtyBits & dirtyBits,gl::Command source)211 angle::Result TextureNULL::syncState(const gl::Context *context,
212 const gl::Texture::DirtyBits &dirtyBits,
213 gl::Command source)
214 {
215 return angle::Result::Continue;
216 }
217
setStorageMultisample(const gl::Context * context,gl::TextureType type,GLsizei samples,GLint internalformat,const gl::Extents & size,bool fixedSampleLocations)218 angle::Result TextureNULL::setStorageMultisample(const gl::Context *context,
219 gl::TextureType type,
220 GLsizei samples,
221 GLint internalformat,
222 const gl::Extents &size,
223 bool fixedSampleLocations)
224 {
225 return angle::Result::Continue;
226 }
227
initializeContents(const gl::Context * context,const gl::ImageIndex & imageIndex)228 angle::Result TextureNULL::initializeContents(const gl::Context *context,
229 const gl::ImageIndex &imageIndex)
230 {
231 return angle::Result::Continue;
232 }
233
234 } // namespace rx
235