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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 WGC3Denum target, WebGLId framebuffer) { | 247 WGC3Denum target, WebGLId framebuffer) { |
248 if (!framebuffer) | 248 if (!framebuffer) |
249 return; | 249 return; |
250 EXPECT_EQ(kFramebufferId | context_id_ << 16, framebuffer); | 250 EXPECT_EQ(kFramebufferId | context_id_ << 16, framebuffer); |
251 } | 251 } |
252 | 252 |
253 void TestWebGraphicsContext3D::bindRenderbuffer( | 253 void TestWebGraphicsContext3D::bindRenderbuffer( |
254 WGC3Denum target, WebGLId renderbuffer) { | 254 WGC3Denum target, WebGLId renderbuffer) { |
255 if (!renderbuffer) | 255 if (!renderbuffer) |
256 return; | 256 return; |
257 EXPECT_EQ(kRenderbufferId | context_id_ << 16, renderbuffer); | 257 EXPECT_EQ(kRenderbufferId | context_id_ << 16, renderbuffer); |
258 } | 258 } |
259 | 259 |
260 void TestWebGraphicsContext3D::bindTexture( | 260 void TestWebGraphicsContext3D::bindTexture( |
261 WGC3Denum target, WebGLId texture_id) { | 261 WGC3Denum target, WebGLId texture_id) { |
262 if (times_bind_texture_succeeds_ >= 0) { | 262 if (times_bind_texture_succeeds_ >= 0) { |
263 if (!times_bind_texture_succeeds_) { | 263 if (!times_bind_texture_succeeds_) { |
264 loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, | 264 loseContextCHROMIUM(GL_GUILTY_CONTEXT_RESET_ARB, |
265 GL_INNOCENT_CONTEXT_RESET_ARB); | 265 GL_INNOCENT_CONTEXT_RESET_ARB); |
266 } | 266 } |
267 --times_bind_texture_succeeds_; | 267 --times_bind_texture_succeeds_; |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 314 } |
315 | 315 |
316 WebGLId TestWebGraphicsContext3D::NextTextureId() { | 316 WebGLId TestWebGraphicsContext3D::NextTextureId() { |
317 WebGLId texture_id = next_texture_id_++; | 317 WebGLId texture_id = next_texture_id_++; |
318 DCHECK(texture_id < (1 << 16)); | 318 DCHECK(texture_id < (1 << 16)); |
319 texture_id |= context_id_ << 16; | 319 texture_id |= context_id_ << 16; |
320 return texture_id; | 320 return texture_id; |
321 } | 321 } |
322 | 322 |
323 } // namespace cc | 323 } // namespace cc |
OLD | NEW |