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

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

Issue 1949303003: Improve indexed gl state related GL commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tex
Patch Set: fix a DCHECK failure 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <limits.h> 7 #include <limits.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 3238 matching lines...) Expand 10 before | Expand all | Expand 10 after
3249 .Times(0); 3249 .Times(0);
3250 EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(1).RetiresOnSaturation(); 3250 EXPECT_CALL(*gl_, GetIntegerv(_, _)).Times(1).RetiresOnSaturation();
3251 cmd.Init(GL_IMPLEMENTATION_COLOR_READ_TYPE, 3251 cmd.Init(GL_IMPLEMENTATION_COLOR_READ_TYPE,
3252 shared_memory_id_, 3252 shared_memory_id_,
3253 shared_memory_offset_); 3253 shared_memory_offset_);
3254 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 3254 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3255 EXPECT_EQ(1, result->GetNumResults()); 3255 EXPECT_EQ(1, result->GetNumResults());
3256 EXPECT_EQ(GL_NO_ERROR, GetGLError()); 3256 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3257 } 3257 }
3258 3258
3259 TEST_P(GLES3DecoderTest, FramebufferTextureLayerNoBoundFramebuffer) {
3260 DoBindTexture(GL_TEXTURE_3D, client_texture_id_, kServiceTextureId);
3261 EXPECT_CALL(*gl_, FramebufferTextureLayer(_, _, _, _, _)).Times(0);
3262 cmds::FramebufferTextureLayer cmd;
3263 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5);
3264 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3265 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
3266 }
3267
3268 TEST_P(GLES3DecoderTest, FramebufferTextureLayerInvalidTextureTarget) {
3269 DoBindFramebuffer(
3270 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
3271 DoBindTexture(GL_TEXTURE_2D, client_texture_id_, kServiceTextureId);
3272 EXPECT_CALL(*gl_, FramebufferTextureLayer(_, _, _, _, _)).Times(0);
3273 cmds::FramebufferTextureLayer cmd;
3274 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5);
3275 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3276 EXPECT_EQ(GL_INVALID_OPERATION, GetGLError());
3277 }
3278
3279 TEST_P(GLES3DecoderTest, FramebufferTextureLayerValidArgs) {
3280 DoBindFramebuffer(
3281 GL_FRAMEBUFFER, client_framebuffer_id_, kServiceFramebufferId);
3282 DoBindTexture(GL_TEXTURE_3D, client_texture_id_, kServiceTextureId);
3283 EXPECT_CALL(*gl_, FramebufferTextureLayer(GL_FRAMEBUFFER,
3284 GL_COLOR_ATTACHMENT0,
3285 kServiceTextureId, 4, 5))
3286 .Times(1)
3287 .RetiresOnSaturation();
3288 cmds::FramebufferTextureLayer cmd;
3289 cmd.Init(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, client_texture_id_, 4, 5);
3290 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
3291 EXPECT_EQ(GL_NO_ERROR, GetGLError());
3292 }
3293
3259 // TODO(gman): PixelStorei 3294 // TODO(gman): PixelStorei
3260 3295
3261 // TODO(gman): SwapBuffers 3296 // TODO(gman): SwapBuffers
3262 3297
3263 } // namespace gles2 3298 } // namespace gles2
3264 } // namespace gpu 3299 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698