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

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

Issue 7633060: Add option to not generate resources on bind in OpenGL ES (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nacl fix Created 9 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include "base/atomicops.h" 7 #include "base/atomicops.h"
8 #include "gpu/command_buffer/common/gles2_cmd_format.h" 8 #include "gpu/command_buffer/common/gles2_cmd_format.h"
9 #include "gpu/command_buffer/common/gles2_cmd_utils.h" 9 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
10 #include "gpu/command_buffer/common/gl_mock.h" 10 #include "gpu/command_buffer/common/gl_mock.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 GLES2DecoderRGBBackbufferTest() { } 89 GLES2DecoderRGBBackbufferTest() { }
90 90
91 virtual void SetUp() { 91 virtual void SetUp() {
92 InitDecoder( 92 InitDecoder(
93 "", // extensions 93 "", // extensions
94 false, // has alpha 94 false, // has alpha
95 false, // has depth 95 false, // has depth
96 false, // has stencil 96 false, // has stencil
97 false, // request alpha 97 false, // request alpha
98 false, // request depth 98 false, // request depth
99 false); // request stencil 99 false, // request stencil
100 true); // bind generates resource
100 SetupDefaultProgram(); 101 SetupDefaultProgram();
101 } 102 }
102 }; 103 };
103 104
104 class GLES2DecoderManualInitTest : public GLES2DecoderWithShaderTest { 105 class GLES2DecoderManualInitTest : public GLES2DecoderWithShaderTest {
105 public: 106 public:
106 GLES2DecoderManualInitTest() { } 107 GLES2DecoderManualInitTest() { }
107 108
108 // Override default setup so nothing gets setup. 109 // Override default setup so nothing gets setup.
109 virtual void SetUp() { 110 virtual void SetUp() {
(...skipping 3073 matching lines...) Expand 10 before | Expand all | Expand 10 after
3183 } 3184 }
3184 3185
3185 TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) { 3186 TEST_F(GLES2DecoderManualInitTest, ActualAlphaMatchesRequestedAlpha) {
3186 InitDecoder( 3187 InitDecoder(
3187 "", // extensions 3188 "", // extensions
3188 true, // has alpha 3189 true, // has alpha
3189 false, // has depth 3190 false, // has depth
3190 false, // has stencil 3191 false, // has stencil
3191 true, // request alpha 3192 true, // request alpha
3192 false, // request depth 3193 false, // request depth
3193 false); // request stencil 3194 false, // request stencil
3195 true); // bind generates resource
3194 3196
3195 EXPECT_CALL(*gl_, GetError()) 3197 EXPECT_CALL(*gl_, GetError())
3196 .WillOnce(Return(GL_NO_ERROR)) 3198 .WillOnce(Return(GL_NO_ERROR))
3197 .WillOnce(Return(GL_NO_ERROR)) 3199 .WillOnce(Return(GL_NO_ERROR))
3198 .RetiresOnSaturation(); 3200 .RetiresOnSaturation();
3199 typedef GetIntegerv::Result Result; 3201 typedef GetIntegerv::Result Result;
3200 Result* result = static_cast<Result*>(shared_memory_address_); 3202 Result* result = static_cast<Result*>(shared_memory_address_);
3201 EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _)) 3203 EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
3202 .WillOnce(SetArgumentPointee<1>(8)) 3204 .WillOnce(SetArgumentPointee<1>(8))
3203 .RetiresOnSaturation(); 3205 .RetiresOnSaturation();
3204 result->size = 0; 3206 result->size = 0;
3205 GetIntegerv cmd2; 3207 GetIntegerv cmd2;
3206 cmd2.Init(GL_ALPHA_BITS, shared_memory_id_, shared_memory_offset_); 3208 cmd2.Init(GL_ALPHA_BITS, shared_memory_id_, shared_memory_offset_);
3207 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 3209 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
3208 EXPECT_EQ( 3210 EXPECT_EQ(
3209 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS), 3211 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS),
3210 result->GetNumResults()); 3212 result->GetNumResults());
3211 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3213 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3212 EXPECT_EQ(8, result->GetData()[0]); 3214 EXPECT_EQ(8, result->GetData()[0]);
3213 } 3215 }
3214 3216
3215 TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) { 3217 TEST_F(GLES2DecoderManualInitTest, ActualAlphaDoesNotMatchRequestedAlpha) {
3216 InitDecoder( 3218 InitDecoder(
3217 "", // extensions 3219 "", // extensions
3218 true, // has alpha 3220 true, // has alpha
3219 false, // has depth 3221 false, // has depth
3220 false, // has stencil 3222 false, // has stencil
3221 false, // request alpha 3223 false, // request alpha
3222 false, // request depth 3224 false, // request depth
3223 false); // request stencil 3225 false, // request stencil
3226 true); // bind generates resource
3224 3227
3225 EXPECT_CALL(*gl_, GetError()) 3228 EXPECT_CALL(*gl_, GetError())
3226 .WillOnce(Return(GL_NO_ERROR)) 3229 .WillOnce(Return(GL_NO_ERROR))
3227 .WillOnce(Return(GL_NO_ERROR)) 3230 .WillOnce(Return(GL_NO_ERROR))
3228 .RetiresOnSaturation(); 3231 .RetiresOnSaturation();
3229 typedef GetIntegerv::Result Result; 3232 typedef GetIntegerv::Result Result;
3230 Result* result = static_cast<Result*>(shared_memory_address_); 3233 Result* result = static_cast<Result*>(shared_memory_address_);
3231 EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _)) 3234 EXPECT_CALL(*gl_, GetIntegerv(GL_ALPHA_BITS, _))
3232 .WillOnce(SetArgumentPointee<1>(8)) 3235 .WillOnce(SetArgumentPointee<1>(8))
3233 .RetiresOnSaturation(); 3236 .RetiresOnSaturation();
3234 result->size = 0; 3237 result->size = 0;
3235 GetIntegerv cmd2; 3238 GetIntegerv cmd2;
3236 cmd2.Init(GL_ALPHA_BITS, shared_memory_id_, shared_memory_offset_); 3239 cmd2.Init(GL_ALPHA_BITS, shared_memory_id_, shared_memory_offset_);
3237 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 3240 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
3238 EXPECT_EQ( 3241 EXPECT_EQ(
3239 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS), 3242 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_ALPHA_BITS),
3240 result->GetNumResults()); 3243 result->GetNumResults());
3241 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3244 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3242 EXPECT_EQ(0, result->GetData()[0]); 3245 EXPECT_EQ(0, result->GetData()[0]);
3243 } 3246 }
3244 3247
3245 TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) { 3248 TEST_F(GLES2DecoderManualInitTest, ActualDepthMatchesRequestedDepth) {
3246 InitDecoder( 3249 InitDecoder(
3247 "", // extensions 3250 "", // extensions
3248 false, // has alpha 3251 false, // has alpha
3249 true, // has depth 3252 true, // has depth
3250 false, // has stencil 3253 false, // has stencil
3251 false, // request alpha 3254 false, // request alpha
3252 true, // request depth 3255 true, // request depth
3253 false); // request stencil 3256 false, // request stencil
3257 true); // bind generates resource
3254 3258
3255 EXPECT_CALL(*gl_, GetError()) 3259 EXPECT_CALL(*gl_, GetError())
3256 .WillOnce(Return(GL_NO_ERROR)) 3260 .WillOnce(Return(GL_NO_ERROR))
3257 .WillOnce(Return(GL_NO_ERROR)) 3261 .WillOnce(Return(GL_NO_ERROR))
3258 .RetiresOnSaturation(); 3262 .RetiresOnSaturation();
3259 typedef GetIntegerv::Result Result; 3263 typedef GetIntegerv::Result Result;
3260 Result* result = static_cast<Result*>(shared_memory_address_); 3264 Result* result = static_cast<Result*>(shared_memory_address_);
3261 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 3265 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
3262 .WillOnce(SetArgumentPointee<1>(24)) 3266 .WillOnce(SetArgumentPointee<1>(24))
3263 .RetiresOnSaturation(); 3267 .RetiresOnSaturation();
3264 result->size = 0; 3268 result->size = 0;
3265 GetIntegerv cmd2; 3269 GetIntegerv cmd2;
3266 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 3270 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
3267 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 3271 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
3268 EXPECT_EQ( 3272 EXPECT_EQ(
3269 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 3273 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
3270 result->GetNumResults()); 3274 result->GetNumResults());
3271 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3275 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3272 EXPECT_EQ(24, result->GetData()[0]); 3276 EXPECT_EQ(24, result->GetData()[0]);
3273 } 3277 }
3274 3278
3275 TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) { 3279 TEST_F(GLES2DecoderManualInitTest, ActualDepthDoesNotMatchRequestedDepth) {
3276 InitDecoder( 3280 InitDecoder(
3277 "", // extensions 3281 "", // extensions
3278 false, // has alpha 3282 false, // has alpha
3279 true, // has depth 3283 true, // has depth
3280 false, // has stencil 3284 false, // has stencil
3281 false, // request alpha 3285 false, // request alpha
3282 false, // request depth 3286 false, // request depth
3283 false); // request stencil 3287 false, // request stencil
3288 true); // bind generates resource
3284 3289
3285 EXPECT_CALL(*gl_, GetError()) 3290 EXPECT_CALL(*gl_, GetError())
3286 .WillOnce(Return(GL_NO_ERROR)) 3291 .WillOnce(Return(GL_NO_ERROR))
3287 .WillOnce(Return(GL_NO_ERROR)) 3292 .WillOnce(Return(GL_NO_ERROR))
3288 .RetiresOnSaturation(); 3293 .RetiresOnSaturation();
3289 typedef GetIntegerv::Result Result; 3294 typedef GetIntegerv::Result Result;
3290 Result* result = static_cast<Result*>(shared_memory_address_); 3295 Result* result = static_cast<Result*>(shared_memory_address_);
3291 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _)) 3296 EXPECT_CALL(*gl_, GetIntegerv(GL_DEPTH_BITS, _))
3292 .WillOnce(SetArgumentPointee<1>(24)) 3297 .WillOnce(SetArgumentPointee<1>(24))
3293 .RetiresOnSaturation(); 3298 .RetiresOnSaturation();
3294 result->size = 0; 3299 result->size = 0;
3295 GetIntegerv cmd2; 3300 GetIntegerv cmd2;
3296 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_); 3301 cmd2.Init(GL_DEPTH_BITS, shared_memory_id_, shared_memory_offset_);
3297 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 3302 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
3298 EXPECT_EQ( 3303 EXPECT_EQ(
3299 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS), 3304 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_DEPTH_BITS),
3300 result->GetNumResults()); 3305 result->GetNumResults());
3301 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3306 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3302 EXPECT_EQ(0, result->GetData()[0]); 3307 EXPECT_EQ(0, result->GetData()[0]);
3303 } 3308 }
3304 3309
3305 TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) { 3310 TEST_F(GLES2DecoderManualInitTest, ActualStencilMatchesRequestedStencil) {
3306 InitDecoder( 3311 InitDecoder(
3307 "", // extensions 3312 "", // extensions
3308 false, // has alpha 3313 false, // has alpha
3309 false, // has depth 3314 false, // has depth
3310 true, // has stencil 3315 true, // has stencil
3311 false, // request alpha 3316 false, // request alpha
3312 false, // request depth 3317 false, // request depth
3313 true); // request stencil 3318 true, // request stencil
3319 true); // bind generates resource
3314 3320
3315 EXPECT_CALL(*gl_, GetError()) 3321 EXPECT_CALL(*gl_, GetError())
3316 .WillOnce(Return(GL_NO_ERROR)) 3322 .WillOnce(Return(GL_NO_ERROR))
3317 .WillOnce(Return(GL_NO_ERROR)) 3323 .WillOnce(Return(GL_NO_ERROR))
3318 .RetiresOnSaturation(); 3324 .RetiresOnSaturation();
3319 typedef GetIntegerv::Result Result; 3325 typedef GetIntegerv::Result Result;
3320 Result* result = static_cast<Result*>(shared_memory_address_); 3326 Result* result = static_cast<Result*>(shared_memory_address_);
3321 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 3327 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
3322 .WillOnce(SetArgumentPointee<1>(8)) 3328 .WillOnce(SetArgumentPointee<1>(8))
3323 .RetiresOnSaturation(); 3329 .RetiresOnSaturation();
3324 result->size = 0; 3330 result->size = 0;
3325 GetIntegerv cmd2; 3331 GetIntegerv cmd2;
3326 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 3332 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
3327 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 3333 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
3328 EXPECT_EQ( 3334 EXPECT_EQ(
3329 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 3335 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
3330 result->GetNumResults()); 3336 result->GetNumResults());
3331 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3337 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3332 EXPECT_EQ(8, result->GetData()[0]); 3338 EXPECT_EQ(8, result->GetData()[0]);
3333 } 3339 }
3334 3340
3335 TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) { 3341 TEST_F(GLES2DecoderManualInitTest, ActualStencilDoesNotMatchRequestedStencil) {
3336 InitDecoder( 3342 InitDecoder(
3337 "", // extensions 3343 "", // extensions
3338 false, // has alpha 3344 false, // has alpha
3339 false, // has depth 3345 false, // has depth
3340 true, // has stencil 3346 true, // has stencil
3341 false, // request alpha 3347 false, // request alpha
3342 false, // request depth 3348 false, // request depth
3343 false); // request stencil 3349 false, // request stencil
3350 true); // bind generates resource
3344 3351
3345 EXPECT_CALL(*gl_, GetError()) 3352 EXPECT_CALL(*gl_, GetError())
3346 .WillOnce(Return(GL_NO_ERROR)) 3353 .WillOnce(Return(GL_NO_ERROR))
3347 .WillOnce(Return(GL_NO_ERROR)) 3354 .WillOnce(Return(GL_NO_ERROR))
3348 .RetiresOnSaturation(); 3355 .RetiresOnSaturation();
3349 typedef GetIntegerv::Result Result; 3356 typedef GetIntegerv::Result Result;
3350 Result* result = static_cast<Result*>(shared_memory_address_); 3357 Result* result = static_cast<Result*>(shared_memory_address_);
3351 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _)) 3358 EXPECT_CALL(*gl_, GetIntegerv(GL_STENCIL_BITS, _))
3352 .WillOnce(SetArgumentPointee<1>(8)) 3359 .WillOnce(SetArgumentPointee<1>(8))
3353 .RetiresOnSaturation(); 3360 .RetiresOnSaturation();
3354 result->size = 0; 3361 result->size = 0;
3355 GetIntegerv cmd2; 3362 GetIntegerv cmd2;
3356 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_); 3363 cmd2.Init(GL_STENCIL_BITS, shared_memory_id_, shared_memory_offset_);
3357 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2)); 3364 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
3358 EXPECT_EQ( 3365 EXPECT_EQ(
3359 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS), 3366 decoder_->GetGLES2Util()->GLGetNumValuesReturned(GL_STENCIL_BITS),
3360 result->GetNumResults()); 3367 result->GetNumResults());
3361 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3368 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3362 EXPECT_EQ(0, result->GetData()[0]); 3369 EXPECT_EQ(0, result->GetData()[0]);
3363 } 3370 }
3364 3371
3365 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) { 3372 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithDepth) {
3366 InitDecoder( 3373 InitDecoder(
3367 "", // extensions 3374 "", // extensions
3368 false, // has alpha 3375 false, // has alpha
3369 true, // has depth 3376 true, // has depth
3370 false, // has stencil 3377 false, // has stencil
3371 false, // request alpha 3378 false, // request alpha
3372 true, // request depth 3379 true, // request depth
3373 false); // request stencil 3380 false, // request stencil
3381 true); // bind generates resource
3374 3382
3375 Enable cmd; 3383 Enable cmd;
3376 cmd.Init(GL_DEPTH_TEST); 3384 cmd.Init(GL_DEPTH_TEST);
3377 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 3385 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3378 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3386 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3379 3387
3380 SetupDefaultProgram(); 3388 SetupDefaultProgram();
3381 SetupTexture(); 3389 SetupTexture();
3382 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); 3390 AddExpectationsForSimulatedAttrib0(kNumVertices, 0);
3383 SetupExpectationsForApplyingDirtyState( 3391 SetupExpectationsForApplyingDirtyState(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3419 } 3427 }
3420 3428
3421 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) { 3429 TEST_F(GLES2DecoderManualInitTest, DepthEnableWithoutRequestedDepth) {
3422 InitDecoder( 3430 InitDecoder(
3423 "", // extensions 3431 "", // extensions
3424 false, // has alpha 3432 false, // has alpha
3425 true, // has depth 3433 true, // has depth
3426 false, // has stencil 3434 false, // has stencil
3427 false, // request alpha 3435 false, // request alpha
3428 false, // request depth 3436 false, // request depth
3429 false); // request stencil 3437 false, // request stencil
3438 true); // bind generates resource
3430 3439
3431 Enable cmd; 3440 Enable cmd;
3432 cmd.Init(GL_DEPTH_TEST); 3441 cmd.Init(GL_DEPTH_TEST);
3433 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 3442 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3434 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3443 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3435 3444
3436 SetupDefaultProgram(); 3445 SetupDefaultProgram();
3437 SetupTexture(); 3446 SetupTexture();
3438 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); 3447 AddExpectationsForSimulatedAttrib0(kNumVertices, 0);
3439 SetupExpectationsForApplyingDirtyState( 3448 SetupExpectationsForApplyingDirtyState(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3475 } 3484 }
3476 3485
3477 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) { 3486 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithStencil) {
3478 InitDecoder( 3487 InitDecoder(
3479 "", // extensions 3488 "", // extensions
3480 false, // has alpha 3489 false, // has alpha
3481 false, // has depth 3490 false, // has depth
3482 true, // has stencil 3491 true, // has stencil
3483 false, // request alpha 3492 false, // request alpha
3484 false, // request depth 3493 false, // request depth
3485 true); // request stencil 3494 true, // request stencil
3495 true); // bind generates resource
3486 3496
3487 Enable cmd; 3497 Enable cmd;
3488 cmd.Init(GL_STENCIL_TEST); 3498 cmd.Init(GL_STENCIL_TEST);
3489 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 3499 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3490 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3500 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3491 3501
3492 SetupDefaultProgram(); 3502 SetupDefaultProgram();
3493 SetupTexture(); 3503 SetupTexture();
3494 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); 3504 AddExpectationsForSimulatedAttrib0(kNumVertices, 0);
3495 SetupExpectationsForApplyingDirtyState( 3505 SetupExpectationsForApplyingDirtyState(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3531 } 3541 }
3532 3542
3533 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) { 3543 TEST_F(GLES2DecoderManualInitTest, StencilEnableWithoutRequestedStencil) {
3534 InitDecoder( 3544 InitDecoder(
3535 "", // extensions 3545 "", // extensions
3536 false, // has alpha 3546 false, // has alpha
3537 false, // has depth 3547 false, // has depth
3538 true, // has stencil 3548 true, // has stencil
3539 false, // request alpha 3549 false, // request alpha
3540 false, // request depth 3550 false, // request depth
3541 false); // request stencil 3551 false, // request stencil
3552 true); // bind generates resource
3542 3553
3543 Enable cmd; 3554 Enable cmd;
3544 cmd.Init(GL_STENCIL_TEST); 3555 cmd.Init(GL_STENCIL_TEST);
3545 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 3556 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3546 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3557 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3547 3558
3548 SetupDefaultProgram(); 3559 SetupDefaultProgram();
3549 SetupTexture(); 3560 SetupTexture();
3550 AddExpectationsForSimulatedAttrib0(kNumVertices, 0); 3561 AddExpectationsForSimulatedAttrib0(kNumVertices, 0);
3551 SetupExpectationsForApplyingDirtyState( 3562 SetupExpectationsForApplyingDirtyState(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
3587 } 3598 }
3588 3599
3589 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) { 3600 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilReportsCorrectValues) {
3590 InitDecoder( 3601 InitDecoder(
3591 "GL_OES_packed_depth_stencil", // extensions 3602 "GL_OES_packed_depth_stencil", // extensions
3592 false, // has alpha 3603 false, // has alpha
3593 true, // has depth 3604 true, // has depth
3594 true, // has stencil 3605 true, // has stencil
3595 false, // request alpha 3606 false, // request alpha
3596 true, // request depth 3607 true, // request depth
3597 true); // request stencil 3608 true, // request stencil
3609 true); // bind generates resource
3598 3610
3599 EXPECT_CALL(*gl_, GetError()) 3611 EXPECT_CALL(*gl_, GetError())
3600 .WillOnce(Return(GL_NO_ERROR)) 3612 .WillOnce(Return(GL_NO_ERROR))
3601 .WillOnce(Return(GL_NO_ERROR)) 3613 .WillOnce(Return(GL_NO_ERROR))
3602 .WillOnce(Return(GL_NO_ERROR)) 3614 .WillOnce(Return(GL_NO_ERROR))
3603 .WillOnce(Return(GL_NO_ERROR)) 3615 .WillOnce(Return(GL_NO_ERROR))
3604 .RetiresOnSaturation(); 3616 .RetiresOnSaturation();
3605 typedef GetIntegerv::Result Result; 3617 typedef GetIntegerv::Result Result;
3606 Result* result = static_cast<Result*>(shared_memory_address_); 3618 Result* result = static_cast<Result*>(shared_memory_address_);
3607 result->size = 0; 3619 result->size = 0;
(...skipping 22 matching lines...) Expand all
3630 } 3642 }
3631 3643
3632 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) { 3644 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilNoRequestedStencil) {
3633 InitDecoder( 3645 InitDecoder(
3634 "GL_OES_packed_depth_stencil", // extensions 3646 "GL_OES_packed_depth_stencil", // extensions
3635 false, // has alpha 3647 false, // has alpha
3636 true, // has depth 3648 true, // has depth
3637 true, // has stencil 3649 true, // has stencil
3638 false, // request alpha 3650 false, // request alpha
3639 true, // request depth 3651 true, // request depth
3640 false); // request stencil 3652 false, // request stencil
3653 true); // bind generates resource
3641 3654
3642 EXPECT_CALL(*gl_, GetError()) 3655 EXPECT_CALL(*gl_, GetError())
3643 .WillOnce(Return(GL_NO_ERROR)) 3656 .WillOnce(Return(GL_NO_ERROR))
3644 .WillOnce(Return(GL_NO_ERROR)) 3657 .WillOnce(Return(GL_NO_ERROR))
3645 .WillOnce(Return(GL_NO_ERROR)) 3658 .WillOnce(Return(GL_NO_ERROR))
3646 .WillOnce(Return(GL_NO_ERROR)) 3659 .WillOnce(Return(GL_NO_ERROR))
3647 .RetiresOnSaturation(); 3660 .RetiresOnSaturation();
3648 typedef GetIntegerv::Result Result; 3661 typedef GetIntegerv::Result Result;
3649 Result* result = static_cast<Result*>(shared_memory_address_); 3662 Result* result = static_cast<Result*>(shared_memory_address_);
3650 result->size = 0; 3663 result->size = 0;
(...skipping 22 matching lines...) Expand all
3673 } 3686 }
3674 3687
3675 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) { 3688 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferDepth) {
3676 InitDecoder( 3689 InitDecoder(
3677 "GL_OES_packed_depth_stencil", // extensions 3690 "GL_OES_packed_depth_stencil", // extensions
3678 false, // has alpha 3691 false, // has alpha
3679 false, // has depth 3692 false, // has depth
3680 false, // has stencil 3693 false, // has stencil
3681 false, // request alpha 3694 false, // request alpha
3682 false, // request depth 3695 false, // request depth
3683 false); // request stencil 3696 false, // request stencil
3697 true); // bind generates resource
3684 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, 3698 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
3685 kServiceRenderbufferId); 3699 kServiceRenderbufferId);
3686 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, 3700 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
3687 kServiceFramebufferId); 3701 kServiceFramebufferId);
3688 3702
3689 EXPECT_CALL(*gl_, GetError()) 3703 EXPECT_CALL(*gl_, GetError())
3690 .WillOnce(Return(GL_NO_ERROR)) // for RenderbufferStoage 3704 .WillOnce(Return(GL_NO_ERROR)) // for RenderbufferStoage
3691 .WillOnce(Return(GL_NO_ERROR)) 3705 .WillOnce(Return(GL_NO_ERROR))
3692 .WillOnce(Return(GL_NO_ERROR)) // for FramebufferRenderbuffer 3706 .WillOnce(Return(GL_NO_ERROR)) // for FramebufferRenderbuffer
3693 .WillOnce(Return(GL_NO_ERROR)) 3707 .WillOnce(Return(GL_NO_ERROR))
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
3749 } 3763 }
3750 3764
3751 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) { 3765 TEST_F(GLES2DecoderManualInitTest, PackedDepthStencilRenderbufferStencil) {
3752 InitDecoder( 3766 InitDecoder(
3753 "GL_OES_packed_depth_stencil", // extensions 3767 "GL_OES_packed_depth_stencil", // extensions
3754 false, // has alpha 3768 false, // has alpha
3755 false, // has depth 3769 false, // has depth
3756 false, // has stencil 3770 false, // has stencil
3757 false, // request alpha 3771 false, // request alpha
3758 false, // request depth 3772 false, // request depth
3759 false); // request stencil 3773 false, // request stencil
3774 true); // bind generates resource
3760 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, 3775 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
3761 kServiceRenderbufferId); 3776 kServiceRenderbufferId);
3762 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_, 3777 DoBindFramebuffer(GL_FRAMEBUFFER, client_framebuffer_id_,
3763 kServiceFramebufferId); 3778 kServiceFramebufferId);
3764 3779
3765 EXPECT_CALL(*gl_, GetError()) 3780 EXPECT_CALL(*gl_, GetError())
3766 .WillOnce(Return(GL_NO_ERROR)) // for RenderbufferStoage 3781 .WillOnce(Return(GL_NO_ERROR)) // for RenderbufferStoage
3767 .WillOnce(Return(GL_NO_ERROR)) 3782 .WillOnce(Return(GL_NO_ERROR))
3768 .WillOnce(Return(GL_NO_ERROR)) // for FramebufferRenderbuffer 3783 .WillOnce(Return(GL_NO_ERROR)) // for FramebufferRenderbuffer
3769 .WillOnce(Return(GL_NO_ERROR)) 3784 .WillOnce(Return(GL_NO_ERROR))
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
4100 } 4115 }
4101 4116
4102 TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleGLError) { 4117 TEST_F(GLES2DecoderManualInitTest, RenderbufferStorageMultisampleGLError) {
4103 InitDecoder( 4118 InitDecoder(
4104 "GL_EXT_framebuffer_multisample", // extensions 4119 "GL_EXT_framebuffer_multisample", // extensions
4105 false, // has alpha 4120 false, // has alpha
4106 false, // has depth 4121 false, // has depth
4107 false, // has stencil 4122 false, // has stencil
4108 false, // request alpha 4123 false, // request alpha
4109 false, // request depth 4124 false, // request depth
4110 false); // request stencil 4125 false, // request stencil
4126 true); // bind generates resource
4111 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_, 4127 DoBindRenderbuffer(GL_RENDERBUFFER, client_renderbuffer_id_,
4112 kServiceRenderbufferId); 4128 kServiceRenderbufferId);
4113 EXPECT_CALL(*gl_, GetError()) 4129 EXPECT_CALL(*gl_, GetError())
4114 .WillOnce(Return(GL_NO_ERROR)) 4130 .WillOnce(Return(GL_NO_ERROR))
4115 .WillOnce(Return(GL_OUT_OF_MEMORY)) 4131 .WillOnce(Return(GL_OUT_OF_MEMORY))
4116 .RetiresOnSaturation(); 4132 .RetiresOnSaturation();
4117 EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT( 4133 EXPECT_CALL(*gl_, RenderbufferStorageMultisampleEXT(
4118 GL_RENDERBUFFER, 1, GL_RGBA, 100, 50)) 4134 GL_RENDERBUFFER, 1, GL_RGBA, 100, 50))
4119 .Times(1) 4135 .Times(1)
4120 .RetiresOnSaturation(); 4136 .RetiresOnSaturation();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
4162 } 4178 }
4163 4179
4164 TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) { 4180 TEST_F(GLES2DecoderManualInitTest, GetCompressedTextureFormats) {
4165 InitDecoder( 4181 InitDecoder(
4166 "GL_EXT_texture_compression_s3tc", // extensions 4182 "GL_EXT_texture_compression_s3tc", // extensions
4167 false, // has alpha 4183 false, // has alpha
4168 false, // has depth 4184 false, // has depth
4169 false, // has stencil 4185 false, // has stencil
4170 false, // request alpha 4186 false, // request alpha
4171 false, // request depth 4187 false, // request depth
4172 false); // request stencil 4188 false, // request stencil
4189 true); // bind generates resource
4173 4190
4174 EXPECT_CALL(*gl_, GetError()) 4191 EXPECT_CALL(*gl_, GetError())
4175 .WillOnce(Return(GL_NO_ERROR)) 4192 .WillOnce(Return(GL_NO_ERROR))
4176 .WillOnce(Return(GL_NO_ERROR)) 4193 .WillOnce(Return(GL_NO_ERROR))
4177 .WillOnce(Return(GL_NO_ERROR)) 4194 .WillOnce(Return(GL_NO_ERROR))
4178 .WillOnce(Return(GL_NO_ERROR)) 4195 .WillOnce(Return(GL_NO_ERROR))
4179 .RetiresOnSaturation(); 4196 .RetiresOnSaturation();
4180 4197
4181 typedef GetIntegerv::Result Result; 4198 typedef GetIntegerv::Result Result;
4182 Result* result = static_cast<Result*>(shared_memory_address_); 4199 Result* result = static_cast<Result*>(shared_memory_address_);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
4218 } 4235 }
4219 4236
4220 TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) { 4237 TEST_F(GLES2DecoderManualInitTest, GetNoCompressedTextureFormats) {
4221 InitDecoder( 4238 InitDecoder(
4222 "", // extensions 4239 "", // extensions
4223 false, // has alpha 4240 false, // has alpha
4224 false, // has depth 4241 false, // has depth
4225 false, // has stencil 4242 false, // has stencil
4226 false, // request alpha 4243 false, // request alpha
4227 false, // request depth 4244 false, // request depth
4228 false); // request stencil 4245 false, // request stencil
4246 true); // bind generates resource
4229 4247
4230 EXPECT_CALL(*gl_, GetError()) 4248 EXPECT_CALL(*gl_, GetError())
4231 .WillOnce(Return(GL_NO_ERROR)) 4249 .WillOnce(Return(GL_NO_ERROR))
4232 .WillOnce(Return(GL_NO_ERROR)) 4250 .WillOnce(Return(GL_NO_ERROR))
4233 .WillOnce(Return(GL_NO_ERROR)) 4251 .WillOnce(Return(GL_NO_ERROR))
4234 .WillOnce(Return(GL_NO_ERROR)) 4252 .WillOnce(Return(GL_NO_ERROR))
4235 .RetiresOnSaturation(); 4253 .RetiresOnSaturation();
4236 4254
4237 typedef GetIntegerv::Result Result; 4255 typedef GetIntegerv::Result Result;
4238 Result* result = static_cast<Result*>(shared_memory_address_); 4256 Result* result = static_cast<Result*>(shared_memory_address_);
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
4289 } 4307 }
4290 4308
4291 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) { 4309 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalBindTexture) {
4292 InitDecoder( 4310 InitDecoder(
4293 "GL_OES_EGL_image_external", // extensions 4311 "GL_OES_EGL_image_external", // extensions
4294 false, // has alpha 4312 false, // has alpha
4295 false, // has depth 4313 false, // has depth
4296 false, // has stencil 4314 false, // has stencil
4297 false, // request alpha 4315 false, // request alpha
4298 false, // request depth 4316 false, // request depth
4299 false); // request stencil 4317 false, // request stencil
4318 true); // bind generates resource
4300 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId)); 4319 EXPECT_CALL(*gl_, BindTexture(GL_TEXTURE_EXTERNAL_OES, kNewServiceId));
4301 EXPECT_CALL(*gl_, GenTextures(1, _)) 4320 EXPECT_CALL(*gl_, GenTextures(1, _))
4302 .WillOnce(SetArgumentPointee<1>(kNewServiceId)); 4321 .WillOnce(SetArgumentPointee<1>(kNewServiceId));
4303 BindTexture cmd; 4322 BindTexture cmd;
4304 cmd.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId); 4323 cmd.Init(GL_TEXTURE_EXTERNAL_OES, kNewClientId);
4305 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 4324 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4306 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 4325 EXPECT_EQ(GL_NO_ERROR, GetGLError());
4307 TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId); 4326 TextureManager::TextureInfo* info = GetTextureInfo(kNewClientId);
4308 EXPECT_TRUE(info != NULL); 4327 EXPECT_TRUE(info != NULL);
4309 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); 4328 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES);
4310 } 4329 }
4311 4330
4312 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) { 4331 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalGetBinding) {
4313 InitDecoder( 4332 InitDecoder(
4314 "GL_OES_EGL_image_external", // extensions 4333 "GL_OES_EGL_image_external", // extensions
4315 false, // has alpha 4334 false, // has alpha
4316 false, // has depth 4335 false, // has depth
4317 false, // has stencil 4336 false, // has stencil
4318 false, // request alpha 4337 false, // request alpha
4319 false, // request depth 4338 false, // request depth
4320 false); // request stencil 4339 false, // request stencil
4340 true); // bind generates resource
4321 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); 4341 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
4322 4342
4323 EXPECT_CALL(*gl_, GetError()) 4343 EXPECT_CALL(*gl_, GetError())
4324 .WillOnce(Return(GL_NO_ERROR)) 4344 .WillOnce(Return(GL_NO_ERROR))
4325 .WillOnce(Return(GL_NO_ERROR)) 4345 .WillOnce(Return(GL_NO_ERROR))
4326 .RetiresOnSaturation(); 4346 .RetiresOnSaturation();
4327 typedef GetIntegerv::Result Result; 4347 typedef GetIntegerv::Result Result;
4328 Result* result = static_cast<Result*>(shared_memory_address_); 4348 Result* result = static_cast<Result*>(shared_memory_address_);
4329 EXPECT_CALL(*gl_, GetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES, 4349 EXPECT_CALL(*gl_, GetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES,
4330 result->GetData())) 4350 result->GetData()))
(...skipping 11 matching lines...) Expand all
4342 } 4362 }
4343 4363
4344 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) { 4364 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureDefaults) {
4345 InitDecoder( 4365 InitDecoder(
4346 "GL_OES_EGL_image_external", // extensions 4366 "GL_OES_EGL_image_external", // extensions
4347 false, // has alpha 4367 false, // has alpha
4348 false, // has depth 4368 false, // has depth
4349 false, // has stencil 4369 false, // has stencil
4350 false, // request alpha 4370 false, // request alpha
4351 false, // request depth 4371 false, // request depth
4352 false); // request stencil 4372 false, // request stencil
4373 true); // bind generates resource
4353 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); 4374 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
4354 4375
4355 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_); 4376 TextureManager::TextureInfo* info = GetTextureInfo(client_texture_id_);
4356 EXPECT_TRUE(info != NULL); 4377 EXPECT_TRUE(info != NULL);
4357 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES); 4378 EXPECT_TRUE(info->target() == GL_TEXTURE_EXTERNAL_OES);
4358 EXPECT_TRUE(info->min_filter() == GL_LINEAR); 4379 EXPECT_TRUE(info->min_filter() == GL_LINEAR);
4359 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE); 4380 EXPECT_TRUE(info->wrap_s() == GL_CLAMP_TO_EDGE);
4360 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE); 4381 EXPECT_TRUE(info->wrap_t() == GL_CLAMP_TO_EDGE);
4361 } 4382 }
4362 4383
4363 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) { 4384 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParam) {
4364 InitDecoder( 4385 InitDecoder(
4365 "GL_OES_EGL_image_external", // extensions 4386 "GL_OES_EGL_image_external", // extensions
4366 false, // has alpha 4387 false, // has alpha
4367 false, // has depth 4388 false, // has depth
4368 false, // has stencil 4389 false, // has stencil
4369 false, // request alpha 4390 false, // request alpha
4370 false, // request depth 4391 false, // request depth
4371 false); // request stencil 4392 false, // request stencil
4393 true); // bind generates resource
4372 4394
4373 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); 4395 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
4374 4396
4375 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES, 4397 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES,
4376 GL_TEXTURE_MIN_FILTER, 4398 GL_TEXTURE_MIN_FILTER,
4377 GL_NEAREST)); 4399 GL_NEAREST));
4378 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES, 4400 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES,
4379 GL_TEXTURE_MIN_FILTER, 4401 GL_TEXTURE_MIN_FILTER,
4380 GL_LINEAR)); 4402 GL_LINEAR));
4381 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES, 4403 EXPECT_CALL(*gl_, TexParameteri(GL_TEXTURE_EXTERNAL_OES,
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
4418 } 4440 }
4419 4441
4420 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) { 4442 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTextureParamInvalid) {
4421 InitDecoder( 4443 InitDecoder(
4422 "GL_OES_EGL_image_external", // extensions 4444 "GL_OES_EGL_image_external", // extensions
4423 false, // has alpha 4445 false, // has alpha
4424 false, // has depth 4446 false, // has depth
4425 false, // has stencil 4447 false, // has stencil
4426 false, // request alpha 4448 false, // request alpha
4427 false, // request depth 4449 false, // request depth
4428 false); // request stencil 4450 false, // request stencil
4451 true); // bind generates resource
4429 4452
4430 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); 4453 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
4431 4454
4432 TexParameteri cmd; 4455 TexParameteri cmd;
4433 cmd.Init(GL_TEXTURE_EXTERNAL_OES, 4456 cmd.Init(GL_TEXTURE_EXTERNAL_OES,
4434 GL_TEXTURE_MIN_FILTER, 4457 GL_TEXTURE_MIN_FILTER,
4435 GL_NEAREST_MIPMAP_NEAREST); 4458 GL_NEAREST_MIPMAP_NEAREST);
4436 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 4459 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4437 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 4460 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
4438 4461
(...skipping 18 matching lines...) Expand all
4457 } 4480 }
4458 4481
4459 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) { 4482 TEST_F(GLES2DecoderManualInitTest, EGLImageExternalTexImage2DError) {
4460 InitDecoder( 4483 InitDecoder(
4461 "GL_OES_EGL_image_external", // extensions 4484 "GL_OES_EGL_image_external", // extensions
4462 false, // has alpha 4485 false, // has alpha
4463 false, // has depth 4486 false, // has depth
4464 false, // has stencil 4487 false, // has stencil
4465 false, // request alpha 4488 false, // request alpha
4466 false, // request depth 4489 false, // request depth
4467 false); // request stencil 4490 false, // request stencil
4491 true); // bind generates resource
4468 4492
4469 GLenum target = GL_TEXTURE_EXTERNAL_OES; 4493 GLenum target = GL_TEXTURE_EXTERNAL_OES;
4470 GLint level = 0; 4494 GLint level = 0;
4471 GLenum internal_format = GL_RGBA; 4495 GLenum internal_format = GL_RGBA;
4472 GLsizei width = 2; 4496 GLsizei width = 2;
4473 GLsizei height = 4; 4497 GLsizei height = 4;
4474 GLint border = 0; 4498 GLint border = 0;
4475 GLenum format = GL_RGBA; 4499 GLenum format = GL_RGBA;
4476 GLenum type = GL_UNSIGNED_BYTE; 4500 GLenum type = GL_UNSIGNED_BYTE;
4477 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId); 4501 DoBindTexture(GL_TEXTURE_EXTERNAL_OES, client_texture_id_, kServiceTextureId);
4478 ASSERT_TRUE(GetTextureInfo(client_texture_id_) != NULL); 4502 ASSERT_TRUE(GetTextureInfo(client_texture_id_) != NULL);
4479 TexImage2D cmd; 4503 TexImage2D cmd;
4480 cmd.Init(target, level, internal_format, width, height, border, format, 4504 cmd.Init(target, level, internal_format, width, height, border, format,
4481 type, kSharedMemoryId, kSharedMemoryOffset); 4505 type, kSharedMemoryId, kSharedMemoryOffset);
4482 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 4506 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
4483 4507
4484 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets. 4508 // TexImage2D is not allowed with GL_TEXTURE_EXTERNAL_OES targets.
4485 EXPECT_EQ(GL_INVALID_ENUM, GetGLError()); 4509 EXPECT_EQ(GL_INVALID_ENUM, GetGLError());
4486 } 4510 }
4487 4511
4512 TEST_F(GLES2DecoderManualInitTest, BindGeneratesResourceFalse) {
4513 InitDecoder(
4514 "", // extensions
4515 false, // has alpha
4516 false, // has depth
4517 false, // has stencil
4518 false, // request alpha
4519 false, // request depth
4520 false, // request stencil
4521 false); // bind generates resource
4522
4523 BindTexture cmd1;
4524 cmd1.Init(GL_TEXTURE_2D, kInvalidClientId);
4525 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd1));
4526 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4527
4528 BindBuffer cmd2;
4529 cmd2.Init(GL_ARRAY_BUFFER, kInvalidClientId);
4530 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd2));
4531 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4532
4533 BindFramebuffer cmd3;
4534 cmd3.Init(GL_FRAMEBUFFER, kInvalidClientId);
4535 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd3));
4536 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4537
4538 BindRenderbuffer cmd4;
4539 cmd4.Init(GL_RENDERBUFFER, kInvalidClientId);
4540 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd4));
4541 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
4542 }
4543
4488 // TODO(gman): Complete this test. 4544 // TODO(gman): Complete this test.
4489 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) { 4545 // TEST_F(GLES2DecoderTest, CompressedTexImage2DGLError) {
4490 // } 4546 // }
4491 4547
4492 // TODO(gman): BufferData 4548 // TODO(gman): BufferData
4493 4549
4494 // TODO(gman): BufferDataImmediate 4550 // TODO(gman): BufferDataImmediate
4495 4551
4496 // TODO(gman): BufferSubData 4552 // TODO(gman): BufferSubData
4497 4553
(...skipping 16 matching lines...) Expand all
4514 // TODO(gman): TexImage2DImmediate 4570 // TODO(gman): TexImage2DImmediate
4515 4571
4516 // TODO(gman): TexSubImage2DImmediate 4572 // TODO(gman): TexSubImage2DImmediate
4517 4573
4518 // TODO(gman): UseProgram 4574 // TODO(gman): UseProgram
4519 4575
4520 // TODO(gman): SwapBuffers 4576 // TODO(gman): SwapBuffers
4521 4577
4522 } // namespace gles2 4578 } // namespace gles2
4523 } // namespace gpu 4579 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698