Fix build break
[chromium-blink-merge.git] / ui / compositor / test_web_graphics_context_3d.cc
blob7778d56c80a1aee7b82f6bf31fa10c4e27df26f0
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.
5 #include "ui/compositor/test_web_graphics_context_3d.h"
7 #include "ui/gl/gl_bindings.h"
8 #include "ui/gl/gl_context_stub.h"
9 #include "ui/gl/gl_surface_stub.h"
11 namespace ui {
13 TestWebGraphicsContext3D::TestWebGraphicsContext3D()
14 : next_texture_id_(1) {}
16 TestWebGraphicsContext3D::~TestWebGraphicsContext3D() {}
18 void TestWebGraphicsContext3D::Initialize() {
19 gl_surface_ = new gfx::GLSurfaceStub;
20 gl_context_ = new gfx::GLContextStub;
21 gl_context_->MakeCurrent(gl_surface_.get());
24 bool TestWebGraphicsContext3D::makeContextCurrent() {
25 return true;
28 int TestWebGraphicsContext3D::width() {
29 return 0;
32 int TestWebGraphicsContext3D::height() {
33 return 0;
36 bool TestWebGraphicsContext3D::isGLES2Compliant() {
37 return false;
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;
49 WebKit::WebGLId TestWebGraphicsContext3D::getPlatformTextureId() {
50 return 0;
53 bool TestWebGraphicsContext3D::isContextLost() {
54 return false;
57 void* TestWebGraphicsContext3D::mapBufferSubDataCHROMIUM(
58 WebKit::WGC3Denum target,
59 WebKit::WGC3Dintptr offset,
60 WebKit::WGC3Dsizeiptr size,
61 WebKit::WGC3Denum access) {
62 return 0;
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;
78 WebKit::WebString TestWebGraphicsContext3D::getRequestableExtensionsCHROMIUM() {
79 return WebKit::WebString();
82 WebKit::WGC3Denum TestWebGraphicsContext3D::checkFramebufferStatus(
83 WebKit::WGC3Denum target) {
84 return GL_FRAMEBUFFER_COMPLETE;
87 bool TestWebGraphicsContext3D::getActiveAttrib(WebKit::WebGLId program,
88 WebKit::WGC3Duint index,
89 ActiveInfo& info) {
90 return false;
93 bool TestWebGraphicsContext3D::getActiveUniform(WebKit::WebGLId program,
94 WebKit::WGC3Duint index,
95 ActiveInfo& info) {
96 return false;
99 WebKit::WGC3Dint TestWebGraphicsContext3D::getAttribLocation(
100 WebKit::WebGLId program,
101 const WebKit::WGC3Dchar* name) {
102 return 0;
105 TestWebGraphicsContext3D::Attributes
106 TestWebGraphicsContext3D::getContextAttributes() {
107 return Attributes();
110 WebKit::WGC3Denum TestWebGraphicsContext3D::getError() {
111 return 0;
114 void TestWebGraphicsContext3D::getIntegerv(WebKit::WGC3Denum pname,
115 WebKit::WGC3Dint* value) {
116 if (pname == GL_MAX_TEXTURE_SIZE)
117 *value = 1024;
120 void TestWebGraphicsContext3D::getProgramiv(WebKit::WebGLId program,
121 WebKit::WGC3Denum pname,
122 WebKit::WGC3Dint* value) {
123 if (pname == GL_LINK_STATUS)
124 *value = 1;
127 WebKit::WebString TestWebGraphicsContext3D::getProgramInfoLog(
128 WebKit::WebGLId program) {
129 return WebKit::WebString();
132 void TestWebGraphicsContext3D::getShaderiv(WebKit::WebGLId shader,
133 WebKit::WGC3Denum pname,
134 WebKit::WGC3Dint* value) {
135 if (pname == GL_COMPILE_STATUS)
136 *value = 1;
139 WebKit::WebString TestWebGraphicsContext3D::getShaderInfoLog(
140 WebKit::WebGLId shader) {
141 return WebKit::WebString();
144 WebKit::WebString TestWebGraphicsContext3D::getShaderSource(
145 WebKit::WebGLId shader) {
146 return WebKit::WebString();
149 WebKit::WebString TestWebGraphicsContext3D::getString(WebKit::WGC3Denum name) {
150 return WebKit::WebString();
153 WebKit::WGC3Dint TestWebGraphicsContext3D::getUniformLocation(
154 WebKit::WebGLId program,
155 const WebKit::WGC3Dchar* name) {
156 return 0;
159 WebKit::WGC3Dsizeiptr TestWebGraphicsContext3D::getVertexAttribOffset(
160 WebKit::WGC3Duint index,
161 WebKit::WGC3Denum pname) {
162 return 0;
165 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isBuffer(
166 WebKit::WebGLId buffer) {
167 return false;
170 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isEnabled(
171 WebKit::WGC3Denum cap) {
172 return false;
175 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isFramebuffer(
176 WebKit::WebGLId framebuffer) {
177 return false;
180 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isProgram(
181 WebKit::WebGLId program) {
182 return false;
185 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isRenderbuffer(
186 WebKit::WebGLId renderbuffer) {
187 return false;
190 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isShader(
191 WebKit::WebGLId shader) {
192 return false;
195 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isTexture(
196 WebKit::WebGLId texture) {
197 return false;
200 WebKit::WebGLId TestWebGraphicsContext3D::createBuffer() {
201 return 1;
204 WebKit::WebGLId TestWebGraphicsContext3D::createFramebuffer() {
205 return 1;
208 WebKit::WebGLId TestWebGraphicsContext3D::createProgram() {
209 return 1;
212 WebKit::WebGLId TestWebGraphicsContext3D::createRenderbuffer() {
213 return 1;
216 WebKit::WebGLId TestWebGraphicsContext3D::createShader(
217 WebKit::WGC3Denum value) {
218 return 1;
221 WebKit::WebGLId TestWebGraphicsContext3D::createTexture() {
222 return next_texture_id_++;
225 WebKit::WebGLId TestWebGraphicsContext3D::createQueryEXT()
227 return 1;
230 WebKit::WGC3Dboolean TestWebGraphicsContext3D::isQueryEXT(WebKit::WebGLId)
232 return true;
235 } // namespace ui