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

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

Issue 10535073: Enforce compressed texture restrictions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 .RetiresOnSaturation(); 728 .RetiresOnSaturation();
729 EXPECT_CALL(*gl_, GetError()) 729 EXPECT_CALL(*gl_, GetError())
730 .WillOnce(Return(GL_NO_ERROR)) 730 .WillOnce(Return(GL_NO_ERROR))
731 .RetiresOnSaturation(); 731 .RetiresOnSaturation();
732 TexImage2D cmd; 732 TexImage2D cmd;
733 cmd.Init(target, level, internal_format, width, height, border, format, 733 cmd.Init(target, level, internal_format, width, height, border, format,
734 type, shared_memory_id, shared_memory_offset); 734 type, shared_memory_id, shared_memory_offset);
735 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 735 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
736 } 736 }
737 737
738 void GLES2DecoderTestBase::DoCompressedTexImage2D(
739 GLenum target, GLint level, GLenum format,
740 GLsizei width, GLsizei height, GLint border,
741 GLsizei size, uint32 bucket_id) {
742 EXPECT_CALL(*gl_, GetError())
743 .WillOnce(Return(GL_NO_ERROR))
744 .RetiresOnSaturation();
745 EXPECT_CALL(*gl_, CompressedTexImage2D(
746 target, level, format, width, height, border, size, _))
747 .Times(1)
748 .RetiresOnSaturation();
749 EXPECT_CALL(*gl_, GetError())
750 .WillOnce(Return(GL_NO_ERROR))
751 .RetiresOnSaturation();
752 CommonDecoder::Bucket* bucket = decoder_->CreateBucket(bucket_id);
753 bucket->SetSize(size);
754 CompressedTexImage2DBucket cmd;
755 cmd.Init(
756 target, level, format, width, height, border,
757 bucket_id);
758 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
759 }
760
738 void GLES2DecoderTestBase::DoTexImage2DSameSize( 761 void GLES2DecoderTestBase::DoTexImage2DSameSize(
739 GLenum target, GLint level, GLenum internal_format, 762 GLenum target, GLint level, GLenum internal_format,
740 GLsizei width, GLsizei height, GLint border, 763 GLsizei width, GLsizei height, GLint border,
741 GLenum format, GLenum type, 764 GLenum format, GLenum type,
742 uint32 shared_memory_id, uint32 shared_memory_offset) { 765 uint32 shared_memory_id, uint32 shared_memory_offset) {
743 if (GLES2Decoder::IsAngle()) 766 if (GLES2Decoder::IsAngle())
744 { 767 {
745 EXPECT_CALL(*gl_, TexSubImage2D( 768 EXPECT_CALL(*gl_, TexSubImage2D(
746 target, level, 0, 0, width, height, format, type, _)) 769 target, level, 0, 0, width, height, format, type, _))
747 .Times(1) 770 .Times(1)
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 num_vertices, buffer_id, GL_NO_ERROR); 1218 num_vertices, buffer_id, GL_NO_ERROR);
1196 } 1219 }
1197 1220
1198 void GLES2DecoderWithShaderTestBase::SetUp() { 1221 void GLES2DecoderWithShaderTestBase::SetUp() {
1199 GLES2DecoderTestBase::SetUp(); 1222 GLES2DecoderTestBase::SetUp();
1200 SetupDefaultProgram(); 1223 SetupDefaultProgram();
1201 } 1224 }
1202 1225
1203 } // namespace gles2 1226 } // namespace gles2
1204 } // namespace gpu 1227 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698