| 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/test_web_graphics_context_3d.h" | 5 #include "cc/test/test_web_graphics_context_3d.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 context_lost_callback_ = callback; | 295 context_lost_callback_ = callback; |
| 296 } | 296 } |
| 297 | 297 |
| 298 void TestWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, | 298 void TestWebGraphicsContext3D::loseContextCHROMIUM(WGC3Denum current, |
| 299 WGC3Denum other) { | 299 WGC3Denum other) { |
| 300 if (context_lost_) | 300 if (context_lost_) |
| 301 return; | 301 return; |
| 302 context_lost_ = true; | 302 context_lost_ = true; |
| 303 if (context_lost_callback_) | 303 if (context_lost_callback_) |
| 304 context_lost_callback_->onContextLost(); | 304 context_lost_callback_->onContextLost(); |
| 305 |
| 306 for (size_t i = 0; i < shared_contexts_.size(); ++i) |
| 307 shared_contexts_[i]->loseContextCHROMIUM(current, other); |
| 308 shared_contexts_.clear(); |
| 305 } | 309 } |
| 306 | 310 |
| 307 WebKit::WebGLId TestWebGraphicsContext3D::NextTextureId() { | 311 WebKit::WebGLId TestWebGraphicsContext3D::NextTextureId() { |
| 308 WebGLId texture_id = next_texture_id_++; | 312 WebGLId texture_id = next_texture_id_++; |
| 309 DCHECK(texture_id < (1 << 16)); | 313 DCHECK(texture_id < (1 << 16)); |
| 310 texture_id |= context_id_ << 16; | 314 texture_id |= context_id_ << 16; |
| 311 return texture_id; | 315 return texture_id; |
| 312 } | 316 } |
| 313 | 317 |
| 314 } // namespace cc | 318 } // namespace cc |
| OLD | NEW |