| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/test/fake_web_graphics_context_3d.h" | 5 #include "cc/test/fake_web_graphics_context_3d.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "third_party/khronos/GLES2/gl2.h" | 8 #include "third_party/khronos/GLES2/gl2.h" |
| 9 | 9 |
| 10 using blink::WGC3Dboolean; | 10 using blink::WGC3Dboolean; |
| 11 using blink::WGC3Denum; | 11 using blink::WGC3Denum; |
| 12 using blink::WGC3Dsizei; | 12 using blink::WGC3Dsizei; |
| 13 using blink::WebGLId; | 13 using blink::WebGLId; |
| 14 using blink::WebGraphicsContext3D; | 14 using blink::WebGraphicsContext3D; |
| 15 | 15 |
| 16 namespace cc { | 16 namespace cc { |
| 17 | 17 |
| 18 FakeWebGraphicsContext3D::FakeWebGraphicsContext3D() | 18 FakeWebGraphicsContext3D::FakeWebGraphicsContext3D() {} |
| 19 : blink::WebGraphicsContext3D() { | |
| 20 } | |
| 21 | 19 |
| 22 FakeWebGraphicsContext3D::~FakeWebGraphicsContext3D() { | 20 FakeWebGraphicsContext3D::~FakeWebGraphicsContext3D() {} |
| 23 } | |
| 24 | 21 |
| 25 bool FakeWebGraphicsContext3D::makeContextCurrent() { | 22 bool FakeWebGraphicsContext3D::makeContextCurrent() { |
| 26 return true; | 23 return true; |
| 27 } | 24 } |
| 28 | 25 |
| 29 bool FakeWebGraphicsContext3D::isGLES2Compliant() { | 26 bool FakeWebGraphicsContext3D::isGLES2Compliant() { |
| 30 return false; | 27 return false; |
| 31 } | 28 } |
| 32 | 29 |
| 33 WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() { | 30 WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 64 } | 61 } |
| 65 | 62 |
| 66 WGC3Denum FakeWebGraphicsContext3D::checkFramebufferStatus( | 63 WGC3Denum FakeWebGraphicsContext3D::checkFramebufferStatus( |
| 67 WGC3Denum target) { | 64 WGC3Denum target) { |
| 68 return GL_FRAMEBUFFER_COMPLETE; | 65 return GL_FRAMEBUFFER_COMPLETE; |
| 69 } | 66 } |
| 70 | 67 |
| 71 bool FakeWebGraphicsContext3D::getActiveAttrib( | 68 bool FakeWebGraphicsContext3D::getActiveAttrib( |
| 72 WebGLId program, | 69 WebGLId program, |
| 73 blink::WGC3Duint index, | 70 blink::WGC3Duint index, |
| 74 ActiveInfo&) { | 71 WebGraphicsContext3D::ActiveInfo&) { |
| 75 return false; | 72 return false; |
| 76 } | 73 } |
| 77 | 74 |
| 78 bool FakeWebGraphicsContext3D::getActiveUniform( | 75 bool FakeWebGraphicsContext3D::getActiveUniform( |
| 79 WebGLId program, | 76 WebGLId program, |
| 80 blink::WGC3Duint index, | 77 blink::WGC3Duint index, |
| 81 ActiveInfo&) { | 78 WebGraphicsContext3D::ActiveInfo&) { |
| 82 return false; | 79 return false; |
| 83 } | 80 } |
| 84 | 81 |
| 85 blink::WGC3Dint FakeWebGraphicsContext3D::getAttribLocation( | 82 blink::WGC3Dint FakeWebGraphicsContext3D::getAttribLocation( |
| 86 WebGLId program, | 83 WebGLId program, |
| 87 const blink::WGC3Dchar* name) { | 84 const blink::WGC3Dchar* name) { |
| 88 return 0; | 85 return 0; |
| 89 } | 86 } |
| 90 | 87 |
| 91 WebGraphicsContext3D::Attributes | |
| 92 FakeWebGraphicsContext3D::getContextAttributes() { | |
| 93 return WebGraphicsContext3D::Attributes(); | |
| 94 } | |
| 95 | |
| 96 WGC3Denum FakeWebGraphicsContext3D::getError() { | 88 WGC3Denum FakeWebGraphicsContext3D::getError() { |
| 97 return 0; | 89 return 0; |
| 98 } | 90 } |
| 99 | 91 |
| 100 void FakeWebGraphicsContext3D::getIntegerv( | 92 void FakeWebGraphicsContext3D::getIntegerv( |
| 101 WGC3Denum pname, | 93 WGC3Denum pname, |
| 102 blink::WGC3Dint* value) { | 94 blink::WGC3Dint* value) { |
| 103 if (pname == GL_MAX_TEXTURE_SIZE) | 95 if (pname == GL_MAX_TEXTURE_SIZE) |
| 104 *value = 1024; | 96 *value = 1024; |
| 105 else if (pname == GL_ACTIVE_TEXTURE) | 97 else if (pname == GL_ACTIVE_TEXTURE) |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 void FakeWebGraphicsContext3D::endQueryEXT(blink::WGC3Denum target) { | 333 void FakeWebGraphicsContext3D::endQueryEXT(blink::WGC3Denum target) { |
| 342 } | 334 } |
| 343 | 335 |
| 344 void FakeWebGraphicsContext3D::getQueryObjectuivEXT( | 336 void FakeWebGraphicsContext3D::getQueryObjectuivEXT( |
| 345 blink::WebGLId query, | 337 blink::WebGLId query, |
| 346 blink::WGC3Denum pname, | 338 blink::WGC3Denum pname, |
| 347 blink::WGC3Duint* params) { | 339 blink::WGC3Duint* params) { |
| 348 } | 340 } |
| 349 | 341 |
| 350 void FakeWebGraphicsContext3D::setContextLostCallback( | 342 void FakeWebGraphicsContext3D::setContextLostCallback( |
| 351 WebGraphicsContextLostCallback* callback) { | 343 WebGraphicsContext3D::WebGraphicsContextLostCallback* callback) { |
| 352 } | 344 } |
| 353 | 345 |
| 354 void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, | 346 void FakeWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, |
| 355 WGC3Denum other) { | 347 WGC3Denum other) { |
| 356 } | 348 } |
| 357 | 349 |
| 358 blink::WGC3Duint FakeWebGraphicsContext3D::createImageCHROMIUM( | 350 blink::WGC3Duint FakeWebGraphicsContext3D::createImageCHROMIUM( |
| 359 blink::WGC3Dsizei width, blink::WGC3Dsizei height, | 351 blink::WGC3Dsizei width, blink::WGC3Dsizei height, |
| 360 blink::WGC3Denum internalformat) { | 352 blink::WGC3Denum internalformat) { |
| 361 return 0; | 353 return 0; |
| 362 } | 354 } |
| 363 | 355 |
| 364 void* FakeWebGraphicsContext3D::mapImageCHROMIUM(blink::WGC3Duint image_id, | 356 void* FakeWebGraphicsContext3D::mapImageCHROMIUM(blink::WGC3Duint image_id, |
| 365 blink::WGC3Denum access) { | 357 blink::WGC3Denum access) { |
| 366 return 0; | 358 return 0; |
| 367 } | 359 } |
| 368 | 360 |
| 369 } // namespace cc | 361 } // namespace cc |
| OLD | NEW |