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

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc

Issue 2009073002: command_buffer: Guard on extension and profiles in the decoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check for GL errors in the unittest Created 4 years, 7 months 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 .Times(1) 337 .Times(1)
338 .RetiresOnSaturation(); 338 .RetiresOnSaturation();
339 } 339 }
340 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0)) 340 EXPECT_CALL(*gl_, ActiveTexture(GL_TEXTURE0))
341 .Times(1) 341 .Times(1)
342 .RetiresOnSaturation(); 342 .RetiresOnSaturation();
343 343
344 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, 0)) 344 EXPECT_CALL(*gl_, BindFramebufferEXT(GL_FRAMEBUFFER, 0))
345 .Times(1) 345 .Times(1)
346 .RetiresOnSaturation(); 346 .RetiresOnSaturation();
347 EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _)) 347
348 .WillOnce(SetArgumentPointee<1>(normalized_init.has_alpha ? 8 : 0)) 348 if (group_->feature_info()->gl_version_info().is_desktop_core_profile) {
349 .RetiresOnSaturation(); 349 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
350 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 350 GL_FRAMEBUFFER, GL_BACK_LEFT,
351 .WillOnce(SetArgumentPointee<1>(normalized_init.has_depth ? 24 : 0)) 351 GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, _))
352 .RetiresOnSaturation(); 352 .WillOnce(SetArgumentPointee<3>(normalized_init.has_alpha ? 8 : 0))
353 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 353 .RetiresOnSaturation();
354 .WillOnce(SetArgumentPointee<1>(normalized_init.has_stencil ? 8 : 0)) 354 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
355 .RetiresOnSaturation(); 355 GL_FRAMEBUFFER, GL_DEPTH,
356 GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, _))
357 .WillOnce(SetArgumentPointee<3>(normalized_init.has_depth ? 24 : 0))
358 .RetiresOnSaturation();
359 EXPECT_CALL(*gl_, GetFramebufferAttachmentParameterivEXT(
360 GL_FRAMEBUFFER, GL_STENCIL,
361 GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, _))
362 .WillOnce(SetArgumentPointee<3>(normalized_init.has_stencil ? 8 : 0))
363 .RetiresOnSaturation();
364 } else {
365 EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
366 .WillOnce(SetArgumentPointee<1>(normalized_init.has_alpha ? 8 : 0))
367 .RetiresOnSaturation();
368 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
369 .WillOnce(SetArgumentPointee<1>(normalized_init.has_depth ? 24 : 0))
370 .RetiresOnSaturation();
371 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
372 .WillOnce(SetArgumentPointee<1>(normalized_init.has_stencil ? 8 : 0))
373 .RetiresOnSaturation();
374 }
356 375
357 if (!group_->feature_info()->gl_version_info().BehavesLikeGLES()) { 376 if (!group_->feature_info()->gl_version_info().BehavesLikeGLES()) {
358 EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE)) 377 EXPECT_CALL(*gl_, Enable(GL_VERTEX_PROGRAM_POINT_SIZE))
359 .Times(1) 378 .Times(1)
360 .RetiresOnSaturation(); 379 .RetiresOnSaturation();
361 380
362 EXPECT_CALL(*gl_, Enable(GL_POINT_SPRITE)) 381 EXPECT_CALL(*gl_, Enable(GL_POINT_SPRITE))
363 .Times(1) 382 .Times(1)
364 .RetiresOnSaturation(); 383 .RetiresOnSaturation();
384 } else if (group_->feature_info()
385 ->gl_version_info()
386 .is_desktop_core_profile) {
387 EXPECT_CALL(*gl_, Enable(GL_PROGRAM_POINT_SIZE))
388 .Times(1)
389 .RetiresOnSaturation();
365 } 390 }
366 391
367 if (group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) { 392 if (group_->feature_info()->gl_version_info().IsAtLeastGL(3, 2)) {
368 EXPECT_CALL(*gl_, Enable(GL_TEXTURE_CUBE_MAP_SEAMLESS)) 393 EXPECT_CALL(*gl_, Enable(GL_TEXTURE_CUBE_MAP_SEAMLESS))
369 .Times(1) 394 .Times(1)
370 .RetiresOnSaturation(); 395 .RetiresOnSaturation();
371 } 396 }
372 397
373 static GLint max_viewport_dims[] = { 398 static GLint max_viewport_dims[] = {
374 kMaxViewportWidth, 399 kMaxViewportWidth,
(...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after
2055 SetupDefaultProgram(); 2080 SetupDefaultProgram();
2056 } 2081 }
2057 2082
2058 // Include the auto-generated part of this file. We split this because it means 2083 // Include the auto-generated part of this file. We split this because it means
2059 // we can easily edit the non-auto generated parts right here in this file 2084 // we can easily edit the non-auto generated parts right here in this file
2060 // instead of having to edit some template or the code generator. 2085 // instead of having to edit some template or the code generator.
2061 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" 2086 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h"
2062 2087
2063 } // namespace gles2 2088 } // namespace gles2
2064 } // namespace gpu 2089 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698