| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
{ return false; } | 51 virtual bool getActiveUniform(WebGLId program, WGC3Duint index, ActiveInfo&)
{ return false; } |
| 52 virtual Attributes getContextAttributes() { return m_attrs; } | 52 virtual Attributes getContextAttributes() { return m_attrs; } |
| 53 virtual WGC3Denum getError() { return 0; } | 53 virtual WGC3Denum getError() { return 0; } |
| 54 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } | 54 virtual WebString getProgramInfoLog(WebGLId program) { return WebString(); } |
| 55 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } | 55 virtual WebString getShaderInfoLog(WebGLId shader) { return WebString(); } |
| 56 virtual WebString getShaderSource(WebGLId shader) { return WebString(); } | 56 virtual WebString getShaderSource(WebGLId shader) { return WebString(); } |
| 57 virtual WebString getString(WGC3Denum name) { return WebString(); } | 57 virtual WebString getString(WGC3Denum name) { return WebString(); } |
| 58 | 58 |
| 59 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } | 59 virtual void shaderSource(WebGLId shader, const WGC3Dchar* string) { } |
| 60 | 60 |
| 61 virtual void genBuffers(WGC3Dsizei count, WebGLId* ids) | |
| 62 { | |
| 63 for (int i = 0; i < count; ++i) | |
| 64 ids[i] = 1; | |
| 65 } | |
| 66 virtual void genFramebuffers(WGC3Dsizei count, WebGLId* ids) | |
| 67 { | |
| 68 for (int i = 0; i < count; ++i) | |
| 69 ids[i] = 1; | |
| 70 } | |
| 71 virtual void genRenderbuffers(WGC3Dsizei count, WebGLId* ids) | |
| 72 { | |
| 73 for (int i = 0; i < count; ++i) | |
| 74 ids[i] = 1; | |
| 75 } | |
| 76 virtual void genTextures(WGC3Dsizei count, WebGLId* ids) | |
| 77 { | |
| 78 for (int i = 0; i < count; ++i) | |
| 79 ids[i] = m_nextTextureId++; | |
| 80 } | |
| 81 | |
| 82 virtual void deleteBuffers(WGC3Dsizei count, WebGLId* ids) { } | |
| 83 virtual void deleteFramebuffers(WGC3Dsizei count, WebGLId* ids) { } | |
| 84 virtual void deleteRenderbuffers(WGC3Dsizei count, WebGLId* ids) { } | |
| 85 virtual void deleteTextures(WGC3Dsizei count, WebGLId* ids) { } | |
| 86 | |
| 87 virtual WebGLId createBuffer() { return 1; } | |
| 88 virtual WebGLId createFramebuffer() { return 1; } | |
| 89 virtual WebGLId createRenderbuffer() { return 1; } | |
| 90 virtual WebGLId createTexture() { return m_nextTextureId++; } | |
| 91 | |
| 92 virtual void deleteBuffer(WebGLId) { } | |
| 93 virtual void deleteFramebuffer(WebGLId) { } | |
| 94 virtual void deleteRenderbuffer(WebGLId) { } | |
| 95 virtual void deleteTexture(WebGLId) { } | |
| 96 | |
| 97 virtual WebGLId createQueryEXT() { return 1; } | |
| 98 virtual void deleteQueryEXT(WebGLId) { } | |
| 99 | |
| 100 virtual WebString getTranslatedShaderSourceANGLE(WebGLId) { return WebString
(); } | 61 virtual WebString getTranslatedShaderSourceANGLE(WebGLId) { return WebString
(); } |
| 101 | 62 |
| 102 // Don't use this, make a MockGLES2Interface instead. | 63 // Don't use this, make a MockGLES2Interface instead. |
| 103 virtual gpu::gles2::GLES2Interface* getGLES2Interface() { return nullptr; } | 64 virtual gpu::gles2::GLES2Interface* getGLES2Interface() { return nullptr; } |
| 104 | 65 |
| 105 void fakeContextLost() { m_contextLost = true; } | 66 void fakeContextLost() { m_contextLost = true; } |
| 106 protected: | 67 protected: |
| 107 unsigned m_nextTextureId; | 68 unsigned m_nextTextureId; |
| 108 bool m_contextLost; | 69 bool m_contextLost; |
| 109 Attributes m_attrs; | 70 Attributes m_attrs; |
| 110 }; | 71 }; |
| 111 | 72 |
| 112 } // namespace blink | 73 } // namespace blink |
| 113 | 74 |
| 114 #endif // MockWebGraphicsContext3D_h | 75 #endif // MockWebGraphicsContext3D_h |
| OLD | NEW |