| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 #include "third_party/khronos/GLES2/gl2ext.h" |
| 6 | 7 |
| 7 namespace cc { | 8 namespace cc { |
| 8 | 9 |
| 9 bool FakeWebGraphicsContext3D::makeContextCurrent() { | 10 bool FakeWebGraphicsContext3D::makeContextCurrent() { |
| 10 return true; | 11 return true; |
| 11 } | 12 } |
| 12 | 13 |
| 13 int FakeWebGraphicsContext3D::width() { | 14 int FakeWebGraphicsContext3D::width() { |
| 14 return 0; | 15 return 0; |
| 15 } | 16 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 29 int width, | 30 int width, |
| 30 int height) { | 31 int height) { |
| 31 return false; | 32 return false; |
| 32 } | 33 } |
| 33 | 34 |
| 34 WebKit::WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() { | 35 WebKit::WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() { |
| 35 return 0; | 36 return 0; |
| 36 } | 37 } |
| 37 | 38 |
| 38 bool FakeWebGraphicsContext3D::isContextLost() { | 39 bool FakeWebGraphicsContext3D::isContextLost() { |
| 39 return false; | 40 return m_contextLost; |
| 41 } |
| 42 |
| 43 WebKit::WGC3Denum FakeWebGraphicsContext3D::getGraphicsResetStatusARB() { |
| 44 return m_contextLost ? GL_UNKNOWN_CONTEXT_RESET_ARB : GL_NO_ERROR; |
| 40 } | 45 } |
| 41 | 46 |
| 42 void* FakeWebGraphicsContext3D::mapBufferSubDataCHROMIUM( | 47 void* FakeWebGraphicsContext3D::mapBufferSubDataCHROMIUM( |
| 43 WebKit::WGC3Denum target, | 48 WebKit::WGC3Denum target, |
| 44 WebKit::WGC3Dintptr offset, | 49 WebKit::WGC3Dintptr offset, |
| 45 WebKit::WGC3Dsizeiptr size, | 50 WebKit::WGC3Dsizeiptr size, |
| 46 WebKit::WGC3Denum access) { | 51 WebKit::WGC3Denum access) { |
| 47 return 0; | 52 return 0; |
| 48 } | 53 } |
| 49 | 54 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 } | 217 } |
| 213 | 218 |
| 214 WebKit::WebGLId FakeWebGraphicsContext3D::createQueryEXT() { | 219 WebKit::WebGLId FakeWebGraphicsContext3D::createQueryEXT() { |
| 215 return 1; | 220 return 1; |
| 216 } | 221 } |
| 217 | 222 |
| 218 WebKit::WGC3Dboolean FakeWebGraphicsContext3D::isQueryEXT(WebKit::WebGLId) { | 223 WebKit::WGC3Dboolean FakeWebGraphicsContext3D::isQueryEXT(WebKit::WebGLId) { |
| 219 return true; | 224 return true; |
| 220 } | 225 } |
| 221 | 226 |
| 227 void FakeWebGraphicsContext3D::setContextLostCallback( |
| 228 WebGraphicsContextLostCallback* callback) { |
| 229 m_contextLostCallback = callback; |
| 230 } |
| 231 |
| 232 void FakeWebGraphicsContext3D::loseContext() { |
| 233 m_contextLost = true; |
| 234 if (m_contextLostCallback) |
| 235 m_contextLostCallback->onContextLost(); |
| 236 } |
| 237 |
| 222 } // namespace cc | 238 } // namespace cc |
| OLD | NEW |