| 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 synthesizeGLError(WGC3Denum) { } | |
| 45 | |
| 46 virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); } | 44 virtual WebString getRequestableExtensionsCHROMIUM() { return WebString(); } |
| 47 | 45 |
| 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) { } | 46 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 | 47 |
| 50 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type,
WGC3Dintptr offset) { } | 48 virtual void drawElements(WGC3Denum mode, WGC3Dsizei count, WGC3Denum type,
WGC3Dintptr offset) { } |
| 51 | 49 |
| 52 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&)
{ return false; } | 50 virtual bool getActiveAttrib(WebGLId program, WGC3Duint index, ActiveInfo&)
{ return false; } |
| 53 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
{ return false; } | 51 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
{ return false; } |
| 54 virtual Attributes getContextAttributes() { return m_attrs; } | 52 virtual Attributes getContextAttributes() { return m_attrs; } |
| 55 virtual WGC3Denum getError() { return 0; } | |
| 56 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } | 53 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } |
| 57 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } | 54 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } |
| 58 virtual WebString getShaderSource(WebGLId shader) { return WebString(); } | 55 virtual WebString getShaderSource(WebGLId shader) { return WebString(); } |
| 59 virtual WebString getString(WGC3Denum name) { return WebString(); } | 56 virtual WebString getString(WGC3Denum name) { return WebString(); } |
| 60 virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname
) { return 0; } | 57 virtual WGC3Dsizeiptr getVertexAttribOffset(WGC3Duint index, WGC3Denum pname
) { return 0; } |
| 61 | 58 |
| 62 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } | 59 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } |
| 63 | 60 |
| 64 virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum t
ype, WGC3Dboolean normalized, WGC3Dsizei stride, WGC3Dintptr offset) { } | 61 virtual void vertexAttribPointer(WGC3Duint index, WGC3Dint size, WGC3Denum t
ype, WGC3Dboolean normalized, WGC3Dsizei stride, WGC3Dintptr offset) { } |
| 65 | 62 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 void fakeContextLost() { m_contextLost = true; } | 107 void fakeContextLost() { m_contextLost = true; } |
| 111 protected: | 108 protected: |
| 112 unsigned m_nextTextureId; | 109 unsigned m_nextTextureId; |
| 113 bool m_contextLost; | 110 bool m_contextLost; |
| 114 Attributes m_attrs; | 111 Attributes m_attrs; |
| 115 }; | 112 }; |
| 116 | 113 |
| 117 } // namespace blink | 114 } // namespace blink |
| 118 | 115 |
| 119 #endif // MockWebGraphicsContext3D_h | 116 #endif // MockWebGraphicsContext3D_h |
| OLD | NEW |