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