Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: cc/test/fake_web_graphics_context_3d.cc

Issue 11606012: cc: Unify context losing machinery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 6
7 namespace cc { 7 namespace cc {
8 8
9 bool FakeWebGraphicsContext3D::makeContextCurrent() { 9 bool FakeWebGraphicsContext3D::makeContextCurrent() {
10 return true; 10 return true;
(...skipping 18 matching lines...) Expand all
29 int width, 29 int width,
30 int height) { 30 int height) {
31 return false; 31 return false;
32 } 32 }
33 33
34 WebKit::WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() { 34 WebKit::WebGLId FakeWebGraphicsContext3D::getPlatformTextureId() {
35 return 0; 35 return 0;
36 } 36 }
37 37
38 bool FakeWebGraphicsContext3D::isContextLost() { 38 bool FakeWebGraphicsContext3D::isContextLost() {
39 return false; 39 return m_contextLost;
40 }
41
42 WebKit::WGC3Denum FakeWebGraphicsContext3D::getGraphicsResetStatusARB() {
43 return m_contextLost ? GL_INVALID_VALUE : GL_NO_ERROR;
jamesr 2012/12/18 05:40:11 i don't think GL_INVALID_VALUE is a valid return v
danakj 2012/12/18 21:26:59 Done.
40 } 44 }
41 45
42 void* FakeWebGraphicsContext3D::mapBufferSubDataCHROMIUM( 46 void* FakeWebGraphicsContext3D::mapBufferSubDataCHROMIUM(
43 WebKit::WGC3Denum target, 47 WebKit::WGC3Denum target,
44 WebKit::WGC3Dintptr offset, 48 WebKit::WGC3Dintptr offset,
45 WebKit::WGC3Dsizeiptr size, 49 WebKit::WGC3Dsizeiptr size,
46 WebKit::WGC3Denum access) { 50 WebKit::WGC3Denum access) {
47 return 0; 51 return 0;
48 } 52 }
49 53
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 216 }
213 217
214 WebKit::WebGLId FakeWebGraphicsContext3D::createQueryEXT() { 218 WebKit::WebGLId FakeWebGraphicsContext3D::createQueryEXT() {
215 return 1; 219 return 1;
216 } 220 }
217 221
218 WebKit::WGC3Dboolean FakeWebGraphicsContext3D::isQueryEXT(WebKit::WebGLId) { 222 WebKit::WGC3Dboolean FakeWebGraphicsContext3D::isQueryEXT(WebKit::WebGLId) {
219 return true; 223 return true;
220 } 224 }
221 225
226 void FakeWebGraphicsContext3D::setContextLostCallback(
227 WebGraphicsContextLostCallback* callback) {
228 m_contextLostCallback = callback;
229 }
230
231 void FakeWebGraphicsContext3D::loseContext() {
232 m_contextLost = true;
233 if (m_contextLostCallback)
234 m_contextLostCallback->onContextLost();
235 }
236
222 } // namespace cc 237 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698