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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/test/MockWebGraphicsContext3D.h

Issue 1808403002: Move simple methods [F-S] from WebGraphicsContext3D to GLES2Interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindFoo
Patch Set: simples-fplus: tests Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 } 42 }
43 43
44 virtual void synthesizeGLError(WGC3Denum) { } 44 virtual void synthesizeGLError(WGC3Denum) { }
45 45
46 virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); } 46 virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); }
47 47
48 virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Din t srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Din t dstY1, WGC3Dbitfield mask, WGC3Denum filter) { } 48 virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Din t srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Din t dstY1, WGC3Dbitfield mask, WGC3Denum filter) { }
49 49
50 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset) { } 50 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type, WGC3Dintptr offset) { }
51 51
52 virtual void finish() { }
53 virtual void flush() { }
54 virtual void frontFace(WGC3Denum mode) { }
55 virtual void generateMipmap(WGC3Denum target) { }
56
57 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; } 52 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
58 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; } 53 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&) { return false; }
59 virtual void getAttachedShaders(WebGLId program, WGC3Dsizei maxCount, WGC3Ds izei* count, WebGLId* shaders) { }
60 virtual WGC3Dint getAttribLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
61 virtual void getBooleanv(WGC3Denum pname, WGC3Dboolean* value) { }
62 virtual void getBufferParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Din t* value) { }
63 virtual Attributes getContextAttributes() { return m_attrs; } 54 virtual Attributes getContextAttributes() { return m_attrs; }
64 virtual WGC3Denum getError() { return 0; } 55 virtual WGC3Denum getError() { return 0; }
65 virtual void getFloatv(WGC3Denum pname, WGC3Dfloat* value) { }
66 virtual void getFramebufferAttachmentParameteriv(WGC3Denum target, WGC3Denum attachment, WGC3Denum pname, WGC3Dint* value) { }
67
68 virtual void getIntegerv(WGC3Denum pname, WGC3Dint* value)
69 {
70 if (pname == GL_MAX_TEXTURE_SIZE)
71 *value = 1024;
72 }
73
74 virtual void getProgramiv(WebGLId program, WGC3Denum pname, WGC3Dint* value)
75 {
76 if (pname == GL_LINK_STATUS)
77 *value = 1;
78 }
79
80 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } 56 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); }
81 virtual void getRenderbufferParameteriv(WGC3Denum target, WGC3Denum pname, W GC3Dint* value) { }
82
83 virtual void getShaderiv(WebGLId shader, WGC3Denum pname, WGC3Dint* value)
84 {
85 if (pname == GL_COMPILE_STATUS)
86 *value = 1;
87 }
88
89 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } 57 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); }
90 virtual void getShaderPrecisionFormat(WGC3Denum shadertype, WGC3Denum precis iontype, WGC3Dint* range, WGC3Dint* precision) { }
91 virtual WebString getShaderSource(WebGLId shader) { return WebString(); } 58 virtual WebString getShaderSource(WebGLId shader) { return WebString(); }
92 virtual WebString getString(WGC3Denum name) { return WebString(); } 59 virtual WebString getString(WGC3Denum name) { return WebString(); }
93 virtual void getTexParameterfv(WGC3Denum target, WGC3Denum pname, WGC3Dfloat * value) { }
94 virtual void getTexParameteriv(WGC3Denum target, WGC3Denum pname, WGC3Dint* value) { }
95 virtual void getUniformfv(WebGLId program, WGC3Dint location, WGC3Dfloat* va lue) { }
96 virtual void getUniformiv(WebGLId program, WGC3Dint location, WGC3Dint* valu e) { }
97 virtual WGC3Dint getUniformLocation(WebGLId program, const WGC3Dchar* name) { return 0; }
98 virtual void getVertexAttribfv(WGC3Duint index, WGC3Denum pname, WGC3Dfloat* value) { }
99 virtual void getVertexAttribiv(WGC3Duint index, WGC3Denum pname, WGC3Dint* v alue) { }
100 virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname ) { return 0; } 60 virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname ) { return 0; }
101 61
102 virtual void hint(WGC3Denum target, WGC3Denum mode) { }
103 virtual WGC3Dboolean isBuffer(WebGLId buffer) { return false; }
104 virtual WGC3Dboolean isEnabled(WGC3Denum cap) { return false; }
105 virtual WGC3Dboolean isFramebuffer(WebGLId framebuffer) { return false; }
106 virtual WGC3Dboolean isProgram(WebGLId program) { return false; }
107 virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) { return false; }
108 virtual WGC3Dboolean isShader(WebGLId shader) { return false; }
109 virtual WGC3Dboolean isTexture(WebGLId texture) { return false; }
110 virtual void lineWidth(WGC3Dfloat) { }
111 virtual void linkProgram(WebGLId program) { }
112 virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) { }
113 virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) { }
114
115 virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3Denum type, void* pixels) { }
116
117 virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { }
118 virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) { }
119 virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei he ight) { }
120 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } 62 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { }
121 virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { }
122 virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint re f, WGC3Duint mask) { }
123 virtual void stencilMask(WGC3Duint mask) { }
124 virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) { }
125 virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { }
126 virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfa il, WGC3Denum zpass) { }
127 63
128 virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internal format, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) { } 64 virtual void texImage2D(WGC3Denum target, WGC3Dint level, WGC3Denum internal format, WGC3Dsizei width, WGC3Dsizei height, WGC3Dint border, WGC3Denum format, WGC3Denum type, const void* pixels) { }
129 65
130 virtual void texParameterf(WGC3Denum target, WGC3Denum pname, WGC3Dfloat par am) { } 66 virtual void texParameterf(WGC3Denum target, WGC3Denum pname, WGC3Dfloat par am) { }
131 virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param ) { } 67 virtual void texParameteri(WGC3Denum target, WGC3Denum pname, WGC3Dint param ) { }
132 68
133 virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffse t, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3 Denum type, const void* pixels) { } 69 virtual void texSubImage2D(WGC3Denum target, WGC3Dint level, WGC3Dint xoffse t, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum format, WGC3 Denum type, const void* pixels) { }
134 70
135 virtual void uniform1f(WGC3Dint location, WGC3Dfloat x) { } 71 virtual void uniform1f(WGC3Dint location, WGC3Dfloat x) { }
136 virtual void uniform1fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloa t* v) { } 72 virtual void uniform1fv(WGC3Dint location, WGC3Dsizei count, const WGC3Dfloa t* v) { }
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 virtual WebGLId createProgram() { return 1; } 142 virtual WebGLId createProgram() { return 1; }
207 virtual WebGLId createShader(WGC3Denum) { return 1; } 143 virtual WebGLId createShader(WGC3Denum) { return 1; }
208 144
209 virtual void deleteProgram(WebGLId) { } 145 virtual void deleteProgram(WebGLId) { }
210 virtual void deleteShader(WebGLId) { } 146 virtual void deleteShader(WebGLId) { }
211 147
212 virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint in ternalformat, WGC3Dint width, WGC3Dint height) { } 148 virtual void texStorage2DEXT(WGC3Denum target, WGC3Dint levels, WGC3Duint in ternalformat, WGC3Dint width, WGC3Dint height) { }
213 149
214 virtual WebGLId createQueryEXT() { return 1; } 150 virtual WebGLId createQueryEXT() { return 1; }
215 virtual void deleteQueryEXT(WebGLId) { } 151 virtual void deleteQueryEXT(WebGLId) { }
216 virtual GLboolean isQueryEXT(WebGLId) { return true; }
217 virtual void beginQueryEXT(GLenum, WebGLId) { }
218 virtual void endQueryEXT(GLenum) { }
219 virtual void getQueryivEXT(GLenum, GLenum, GLint*) { }
220 virtual void getQueryObjectuivEXT(WebGLId, GLenum, GLuint*) { }
221 152
222 virtual WebString getTranslatedShaderSourceANGLE(WebGLId) { return WebString (); } 153 virtual WebString getTranslatedShaderSourceANGLE(WebGLId) { return WebString (); }
223 154
224 // Don't use this, make a MockGLES2Interface instead. 155 // Don't use this, make a MockGLES2Interface instead.
225 virtual gpu::gles2::GLES2Interface* getGLES2Interface() { return nullptr; } 156 virtual gpu::gles2::GLES2Interface* getGLES2Interface() { return nullptr; }
226 157
227 void fakeContextLost() { m_contextLost = true; } 158 void fakeContextLost() { m_contextLost = true; }
228 protected: 159 protected:
229 unsigned m_nextTextureId; 160 unsigned m_nextTextureId;
230 bool m_contextLost; 161 bool m_contextLost;
231 Attributes m_attrs; 162 Attributes m_attrs;
232 }; 163 };
233 164
234 } // namespace blink 165 } // namespace blink
235 166
236 #endif // MockWebGraphicsContext3D_h 167 #endif // MockWebGraphicsContext3D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698