OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gfx/compositor/test_web_graphics_context_3d.h" |
| 6 |
| 7 #include "ui/gfx/gl/gl_context_stub.h" |
| 8 #include "ui/gfx/gl/gl_surface_stub.h" |
| 9 |
| 10 namespace ui { |
| 11 |
| 12 TestWebGraphicsContext3D::TestWebGraphicsContext3D() {} |
| 13 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() {} |
| 14 |
| 15 bool TestWebGraphicsContext3D::initialize(Attributes attributes, |
| 16 WebKit::WebView* view, |
| 17 bool render_directly_to_web_view) { |
| 18 gl_surface_ = new gfx::GLSurfaceStub; |
| 19 gl_context_ = new gfx::GLContextStub; |
| 20 gl_context_->MakeCurrent(gl_surface_.get()); |
| 21 return true; |
| 22 } |
| 23 |
| 24 bool TestWebGraphicsContext3D::makeContextCurrent() { |
| 25 return true; |
| 26 } |
| 27 |
| 28 int TestWebGraphicsContext3D::width() { |
| 29 return 0; |
| 30 } |
| 31 |
| 32 int TestWebGraphicsContext3D::height() { |
| 33 return 0; |
| 34 } |
| 35 |
| 36 bool TestWebGraphicsContext3D::isGLES2Compliant() { |
| 37 return false; |
| 38 } |
| 39 |
| 40 bool TestWebGraphicsContext3D::readBackFramebuffer( |
| 41 unsigned char* pixels, |
| 42 size_t bufferSize, |
| 43 WebKit::WebGLId framebuffer, |
| 44 int width, |
| 45 int height) { |
| 46 return false; |
| 47 } |
| 48 |
| 49 WebKit::WebGLId TestWebGraphicsContext3D::getPlatformTextureId() { |
| 50 return 0; |
| 51 } |
| 52 |
| 53 bool TestWebGraphicsContext3D::isContextLost() { |
| 54 return false; |
| 55 } |
| 56 |
| 57 void* TestWebGraphicsContext3D::mapBufferSubDataCHROMIUM( |
| 58 WebKit::WGC3Denum target, |
| 59 WebKit::WGC3Dintptr offset, |
| 60 WebKit::WGC3Dsizeiptr size, |
| 61 WebKit::WGC3Denum access) { |
| 62 return 0; |
| 63 } |
| 64 |
| 65 void* TestWebGraphicsContext3D::mapTexSubImage2DCHROMIUM( |
| 66 WebKit::WGC3Denum target, |
| 67 WebKit::WGC3Dint level, |
| 68 WebKit::WGC3Dint xoffset, |
| 69 WebKit::WGC3Dint yoffset, |
| 70 WebKit::WGC3Dsizei width, |
| 71 WebKit::WGC3Dsizei height, |
| 72 WebKit::WGC3Denum format, |
| 73 WebKit::WGC3Denum type, |
| 74 WebKit::WGC3Denum access) { |
| 75 return 0; |
| 76 } |
| 77 |
| 78 WebKit::WebString TestWebGraphicsContext3D::getRequestableExtensionsCHROMIUM() { |
| 79 return WebKit::WebString(); |
| 80 } |
| 81 |
| 82 WebKit::WGC3Denum TestWebGraphicsContext3D::checkFramebufferStatus( |
| 83 WebKit::WGC3Denum target) { |
| 84 return GL_FRAMEBUFFER_COMPLETE; |
| 85 } |
| 86 |
| 87 bool TestWebGraphicsContext3D::getActiveAttrib(WebKit::WebGLId program, |
| 88 WebKit::WGC3Duint index, |
| 89 ActiveInfo& info) { |
| 90 return false; |
| 91 } |
| 92 |
| 93 bool TestWebGraphicsContext3D::getActiveUniform(WebKit::WebGLId program, |
| 94 WebKit::WGC3Duint index, |
| 95 ActiveInfo& info) { |
| 96 return false; |
| 97 } |
| 98 |
| 99 WebKit::WGC3Dint TestWebGraphicsContext3D::getAttribLocation( |
| 100 WebKit::WebGLId program, |
| 101 const WebKit::WGC3Dchar* name) { |
| 102 return 0; |
| 103 } |
| 104 |
| 105 TestWebGraphicsContext3D::Attributes |
| 106 TestWebGraphicsContext3D::getContextAttributes() { |
| 107 return Attributes(); |
| 108 } |
| 109 |
| 110 WebKit::WGC3Denum TestWebGraphicsContext3D::getError() { |
| 111 return 0; |
| 112 } |
| 113 |
| 114 void TestWebGraphicsContext3D::getIntegerv(WebKit::WGC3Denum pname, |
| 115 WebKit::WGC3Dint* value) { |
| 116 if (pname == GL_MAX_TEXTURE_SIZE) |
| 117 *value = 1024; |
| 118 } |
| 119 |
| 120 void TestWebGraphicsContext3D::getProgramiv(WebKit::WebGLId program, |
| 121 WebKit::WGC3Denum pname, |
| 122 WebKit::WGC3Dint* value) { |
| 123 if (pname == GL_LINK_STATUS) |
| 124 *value = 1; |
| 125 } |
| 126 |
| 127 WebKit::WebString TestWebGraphicsContext3D::getProgramInfoLog( |
| 128 WebKit::WebGLId program) { |
| 129 return WebKit::WebString(); |
| 130 } |
| 131 |
| 132 void TestWebGraphicsContext3D::getShaderiv(WebKit::WebGLId shader, |
| 133 WebKit::WGC3Denum pname, |
| 134 WebKit::WGC3Dint* value) { |
| 135 if (pname == GL_COMPILE_STATUS) |
| 136 *value = 1; |
| 137 } |
| 138 |
| 139 WebKit::WebString TestWebGraphicsContext3D::getShaderInfoLog( |
| 140 WebKit::WebGLId shader) { |
| 141 return WebKit::WebString(); |
| 142 } |
| 143 |
| 144 WebKit::WebString TestWebGraphicsContext3D::getShaderSource( |
| 145 WebKit::WebGLId shader) { |
| 146 return WebKit::WebString(); |
| 147 } |
| 148 |
| 149 WebKit::WebString TestWebGraphicsContext3D::getString(WebKit::WGC3Denum name) { |
| 150 return WebKit::WebString(); |
| 151 } |
| 152 |
| 153 WebKit::WGC3Dint TestWebGraphicsContext3D::getUniformLocation( |
| 154 WebKit::WebGLId program, |
| 155 const WebKit::WGC3Dchar* name) { |
| 156 return 0; |
| 157 } |
| 158 |
| 159 WebKit::WGC3Dsizeiptr TestWebGraphicsContext3D::getVertexAttribOffset( |
| 160 WebKit::WGC3Duint index, |
| 161 WebKit::WGC3Denum pname) { |
| 162 return 0; |
| 163 } |
| 164 |
| 165 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isBuffer( |
| 166 WebKit::WebGLId buffer) { |
| 167 return false; |
| 168 } |
| 169 |
| 170 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isEnabled( |
| 171 WebKit::WGC3Denum cap) { |
| 172 return false; |
| 173 } |
| 174 |
| 175 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isFramebuffer( |
| 176 WebKit::WebGLId framebuffer) { |
| 177 return false; |
| 178 } |
| 179 |
| 180 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isProgram( |
| 181 WebKit::WebGLId program) { |
| 182 return false; |
| 183 } |
| 184 |
| 185 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isRenderbuffer( |
| 186 WebKit::WebGLId renderbuffer) { |
| 187 return false; |
| 188 } |
| 189 |
| 190 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isShader( |
| 191 WebKit::WebGLId shader) { |
| 192 return false; |
| 193 } |
| 194 |
| 195 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isTexture( |
| 196 WebKit::WebGLId texture) { |
| 197 return false; |
| 198 } |
| 199 |
| 200 WebKit::WebGLId TestWebGraphicsContext3D::createBuffer() { |
| 201 return 1; |
| 202 } |
| 203 |
| 204 WebKit::WebGLId TestWebGraphicsContext3D::createFramebuffer() { |
| 205 return 1; |
| 206 } |
| 207 |
| 208 WebKit::WebGLId TestWebGraphicsContext3D::createProgram() { |
| 209 return 1; |
| 210 } |
| 211 |
| 212 WebKit::WebGLId TestWebGraphicsContext3D::createRenderbuffer() { |
| 213 return 1; |
| 214 } |
| 215 |
| 216 WebKit::WebGLId TestWebGraphicsContext3D::createShader( |
| 217 WebKit::WGC3Denum value) { |
| 218 return 1; |
| 219 } |
| 220 |
| 221 WebKit::WebGLId TestWebGraphicsContext3D::createTexture() { |
| 222 return 1; |
| 223 } |
| 224 |
| 225 } // namespace ui |
OLD | NEW |