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