Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: ui/gl/gl_stub_api.cc

Issue 2299413003: Enable a lot of extensions to increase fuzzer coverage (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gl/gl_stub_api.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gl/gl_stub_api.h" 5 #include "ui/gl/gl_stub_api.h"
6 6
7 namespace gl { 7 namespace gl {
8 8
9 namespace { 9 namespace {
10 10
11 void GenHelper(GLsizei count, GLuint* objects) { 11 void GenHelper(GLsizei count, GLuint* objects) {
12 for (GLsizei i = 0; i < count; ++i) 12 for (GLsizei i = 0; i < count; ++i)
13 objects[i] = i + 1; 13 objects[i] = i + 1;
14 } 14 }
15 15
16 } // anonymous namespace 16 } // anonymous namespace
17 17
18 GLStubApi::GLStubApi()
19 : version_("OpenGL ES 3.0"), extensions_("GL_EXT_framebuffer_object") {}
20
21 GLStubApi::~GLStubApi() = default;
22
18 GLenum GLStubApi::glCheckFramebufferStatusEXTFn(GLenum target) { 23 GLenum GLStubApi::glCheckFramebufferStatusEXTFn(GLenum target) {
19 return GL_FRAMEBUFFER_COMPLETE; 24 return GL_FRAMEBUFFER_COMPLETE;
20 } 25 }
21 26
22 GLuint GLStubApi::glCreateProgramFn(void) { 27 GLuint GLStubApi::glCreateProgramFn(void) {
23 return 1; 28 return 1;
24 } 29 }
25 30
26 GLuint GLStubApi::glCreateShaderFn(GLenum type) { 31 GLuint GLStubApi::glCreateShaderFn(GLenum type) {
27 return 2; 32 return 2;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 case GL_MAX_VERTEX_ATTRIBS: 112 case GL_MAX_VERTEX_ATTRIBS:
108 *params = 8; 113 *params = 8;
109 break; 114 break;
110 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS: 115 case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
111 *params = 8; 116 *params = 8;
112 break; 117 break;
113 case GL_MAX_TEXTURE_IMAGE_UNITS: 118 case GL_MAX_TEXTURE_IMAGE_UNITS:
114 *params = 8; 119 *params = 8;
115 break; 120 break;
116 case GL_MAX_TEXTURE_SIZE: 121 case GL_MAX_TEXTURE_SIZE:
122 case GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB:
117 *params = 2048; 123 *params = 2048;
118 break; 124 break;
119 case GL_MAX_CUBE_MAP_TEXTURE_SIZE: 125 case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
120 *params = 2048; 126 *params = 2048;
121 break; 127 break;
122 case GL_MAX_3D_TEXTURE_SIZE: 128 case GL_MAX_3D_TEXTURE_SIZE:
123 *params = 256; 129 *params = 256;
124 break; 130 break;
125 case GL_MAX_ARRAY_TEXTURE_LAYERS: 131 case GL_MAX_ARRAY_TEXTURE_LAYERS:
126 *params = 256; 132 *params = 256;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 break; 204 break;
199 } 205 }
200 } 206 }
201 207
202 const GLubyte* GLStubApi::glGetStringFn(GLenum name) { 208 const GLubyte* GLStubApi::glGetStringFn(GLenum name) {
203 switch (name) { 209 switch (name) {
204 case GL_RENDERER: 210 case GL_RENDERER:
205 default: 211 default:
206 return reinterpret_cast<const GLubyte*>(""); 212 return reinterpret_cast<const GLubyte*>("");
207 case GL_VERSION: 213 case GL_VERSION:
208 return reinterpret_cast<const GLubyte*>("OpenGL ES 3.0"); 214 return reinterpret_cast<const GLubyte*>(version_.c_str());
209 case GL_EXTENSIONS: 215 case GL_EXTENSIONS:
210 return reinterpret_cast<const GLubyte*>("GL_EXT_framebuffer_object"); 216 return reinterpret_cast<const GLubyte*>(extensions_.c_str());
211 } 217 }
212 } 218 }
213 219
214 const GLubyte* GLStubApi::glGetStringiFn(GLenum name, GLuint index) { 220 const GLubyte* GLStubApi::glGetStringiFn(GLenum name, GLuint index) {
215 return reinterpret_cast<const GLubyte*>(""); 221 return reinterpret_cast<const GLubyte*>("");
216 } 222 }
217 223
218 GLboolean GLStubApi::glIsBufferFn(GLuint buffer) { 224 GLboolean GLStubApi::glIsBufferFn(GLuint buffer) {
219 return GL_TRUE; 225 return GL_TRUE;
220 } 226 }
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 return GL_TRUE; 293 return GL_TRUE;
288 } 294 }
289 295
290 GLenum GLStubApi::glWaitSyncFn(GLsync sync, 296 GLenum GLStubApi::glWaitSyncFn(GLsync sync,
291 GLbitfield flags, 297 GLbitfield flags,
292 GLuint64 timeout) { 298 GLuint64 timeout) {
293 return GL_TRUE; 299 return GL_TRUE;
294 } 300 }
295 301
296 } // namespace gl 302 } // namespace gl
OLDNEW
« no previous file with comments | « ui/gl/gl_stub_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698