OLD | NEW |
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 23 matching lines...) Expand all Loading... |
34 // WebGraphicsContext3D base class for use in WebKit unit tests. | 34 // WebGraphicsContext3D base class for use in WebKit unit tests. |
35 // All operations are no-ops (returning 0 if necessary). | 35 // All operations are no-ops (returning 0 if necessary). |
36 class MockWebGraphicsContext3D : public WebGraphicsContext3D { | 36 class MockWebGraphicsContext3D : public WebGraphicsContext3D { |
37 public: | 37 public: |
38 MockWebGraphicsContext3D() | 38 MockWebGraphicsContext3D() |
39 : m_nextTextureId(1) | 39 : m_nextTextureId(1) |
40 , m_contextLost(false) | 40 , m_contextLost(false) |
41 { | 41 { |
42 } | 42 } |
43 | 43 |
44 virtual void prepareTexture() { } | |
45 | |
46 virtual void postSubBufferCHROMIUM(int x, int y, int width, int height) { } | |
47 | |
48 virtual void synthesizeGLError(WGC3Denum) { } | 44 virtual void synthesizeGLError(WGC3Denum) { } |
49 | 45 |
50 virtual void* mapBufferSubDataCHROMIUM(WGC3Denum target, WGC3Dintptr offset,
WGC3Dsizeiptr size, WGC3Denum access) { return 0; } | |
51 virtual void unmapBufferSubDataCHROMIUM(const void*) { } | |
52 virtual void* mapTexSubImage2DCHROMIUM(WGC3Denum target, WGC3Dint level, WGC
3Dint xoffset, WGC3Dint yoffset, WGC3Dsizei width, WGC3Dsizei height, WGC3Denum
format, WGC3Denum type, WGC3Denum access) { return 0; } | |
53 virtual void unmapTexSubImage2DCHROMIUM(const void*) { } | |
54 | |
55 virtual void setVisibilityCHROMIUM(bool visible) { } | |
56 | |
57 virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachmen
ts, const WGC3Denum* attachments) { } | 46 virtual void discardFramebufferEXT(WGC3Denum target, WGC3Dsizei numAttachmen
ts, const WGC3Denum* attachments) { } |
58 virtual void ensureFramebufferCHROMIUM() { } | 47 virtual void ensureFramebufferCHROMIUM() { } |
59 | 48 |
60 virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); } | 49 virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); } |
61 virtual void requestExtensionCHROMIUM(const char*) { } | 50 virtual void requestExtensionCHROMIUM(const char*) { } |
62 | 51 |
63 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) { } | 52 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) { } |
64 virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Ds
izei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { } | 53 virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Ds
izei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) { } |
65 | 54 |
66 virtual void activeTexture(WGC3Denum texture) { } | 55 virtual void activeTexture(WGC3Denum texture) { } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) { return false; } | 156 virtual WGC3Dboolean isRenderbuffer(WebGLId renderbuffer) { return false; } |
168 virtual WGC3Dboolean isShader(WebGLId shader) { return false; } | 157 virtual WGC3Dboolean isShader(WebGLId shader) { return false; } |
169 virtual WGC3Dboolean isTexture(WebGLId texture) { return false; } | 158 virtual WGC3Dboolean isTexture(WebGLId texture) { return false; } |
170 virtual void lineWidth(WGC3Dfloat) { } | 159 virtual void lineWidth(WGC3Dfloat) { } |
171 virtual void linkProgram(WebGLId program) { } | 160 virtual void linkProgram(WebGLId program) { } |
172 virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) { } | 161 virtual void pixelStorei(WGC3Denum pname, WGC3Dint param) { } |
173 virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) { } | 162 virtual void polygonOffset(WGC3Dfloat factor, WGC3Dfloat units) { } |
174 | 163 |
175 virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei
height, WGC3Denum format, WGC3Denum type, void* pixels) { } | 164 virtual void readPixels(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei
height, WGC3Denum format, WGC3Denum type, void* pixels) { } |
176 | 165 |
177 virtual void releaseShaderCompiler() { } | |
178 | |
179 virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat,
WGC3Dsizei width, WGC3Dsizei height) { } | 166 virtual void renderbufferStorage(WGC3Denum target, WGC3Denum internalformat,
WGC3Dsizei width, WGC3Dsizei height) { } |
180 virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) { } | 167 virtual void sampleCoverage(WGC3Dclampf value, WGC3Dboolean invert) { } |
181 virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei he
ight) { } | 168 virtual void scissor(WGC3Dint x, WGC3Dint y, WGC3Dsizei width, WGC3Dsizei he
ight) { } |
182 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } | 169 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } |
183 virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { } | 170 virtual void stencilFunc(WGC3Denum func, WGC3Dint ref, WGC3Duint mask) { } |
184 virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint re
f, WGC3Duint mask) { } | 171 virtual void stencilFuncSeparate(WGC3Denum face, WGC3Denum func, WGC3Dint re
f, WGC3Duint mask) { } |
185 virtual void stencilMask(WGC3Duint mask) { } | 172 virtual void stencilMask(WGC3Duint mask) { } |
186 virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) { } | 173 virtual void stencilMaskSeparate(WGC3Denum face, WGC3Duint mask) { } |
187 virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { } | 174 virtual void stencilOp(WGC3Denum fail, WGC3Denum zfail, WGC3Denum zpass) { } |
188 virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfa
il, WGC3Denum zpass) { } | 175 virtual void stencilOpSeparate(WGC3Denum face, WGC3Denum fail, WGC3Denum zfa
il, WGC3Denum zpass) { } |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 void fakeContextLost() { m_contextLost = true; } | 276 void fakeContextLost() { m_contextLost = true; } |
290 protected: | 277 protected: |
291 unsigned m_nextTextureId; | 278 unsigned m_nextTextureId; |
292 bool m_contextLost; | 279 bool m_contextLost; |
293 Attributes m_attrs; | 280 Attributes m_attrs; |
294 }; | 281 }; |
295 | 282 |
296 } // namespace blink | 283 } // namespace blink |
297 | 284 |
298 #endif // MockWebGraphicsContext3D_h | 285 #endif // MockWebGraphicsContext3D_h |
OLD | NEW |