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

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

Issue 9307102: Fix TexImage2D clearing too agressively (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 .RetiresOnSaturation(); 655 .RetiresOnSaturation();
656 EXPECT_CALL(*gl_, GetError()) 656 EXPECT_CALL(*gl_, GetError())
657 .WillOnce(Return(GL_NO_ERROR)) 657 .WillOnce(Return(GL_NO_ERROR))
658 .RetiresOnSaturation(); 658 .RetiresOnSaturation();
659 TexImage2D cmd; 659 TexImage2D cmd;
660 cmd.Init(target, level, internal_format, width, height, border, format, 660 cmd.Init(target, level, internal_format, width, height, border, format,
661 type, shared_memory_id, shared_memory_offset); 661 type, shared_memory_id, shared_memory_offset);
662 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 662 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
663 } 663 }
664 664
665 void GLES2DecoderTestBase::DoTexImage2DSameSize(
666 GLenum target, GLint level, GLenum internal_format,
667 GLsizei width, GLsizei height, GLint border,
668 GLenum format, GLenum type,
669 uint32 shared_memory_id, uint32 shared_memory_offset) {
670 if (GLES2Decoder::IsAngle())
671 {
672 EXPECT_CALL(*gl_, TexSubImage2D(
673 target, level, 0, 0, width, height, format, type, _))
674 .Times(1)
675 .RetiresOnSaturation();
676 } else {
677 EXPECT_CALL(*gl_, GetError())
678 .WillOnce(Return(GL_NO_ERROR))
679 .RetiresOnSaturation();
680 EXPECT_CALL(*gl_, TexImage2D(target, level, internal_format,
681 width, height, border, format, type, _))
682 .Times(1)
683 .RetiresOnSaturation();
684 EXPECT_CALL(*gl_, GetError())
685 .WillOnce(Return(GL_NO_ERROR))
686 .RetiresOnSaturation();
687 }
688 TexImage2D cmd;
689 cmd.Init(target, level, internal_format, width, height, border, format,
690 type, shared_memory_id, shared_memory_offset);
691 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
692 }
693
665 void GLES2DecoderTestBase::DoRenderbufferStorage( 694 void GLES2DecoderTestBase::DoRenderbufferStorage(
666 GLenum target, GLenum internal_format, GLenum actual_format, 695 GLenum target, GLenum internal_format, GLenum actual_format,
667 GLsizei width, GLsizei height, GLenum error) { 696 GLsizei width, GLsizei height, GLenum error) {
668 EXPECT_CALL(*gl_, GetError()) 697 EXPECT_CALL(*gl_, GetError())
669 .WillOnce(Return(GL_NO_ERROR)) 698 .WillOnce(Return(GL_NO_ERROR))
670 .RetiresOnSaturation(); 699 .RetiresOnSaturation();
671 EXPECT_CALL(*gl_, RenderbufferStorageEXT( 700 EXPECT_CALL(*gl_, RenderbufferStorageEXT(
672 target, actual_format, width, height)) 701 target, actual_format, width, height))
673 .Times(1) 702 .Times(1)
674 .RetiresOnSaturation(); 703 .RetiresOnSaturation();
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
1131 num_vertices, buffer_id, GL_NO_ERROR); 1160 num_vertices, buffer_id, GL_NO_ERROR);
1132 } 1161 }
1133 1162
1134 void GLES2DecoderWithShaderTestBase::SetUp() { 1163 void GLES2DecoderWithShaderTestBase::SetUp() {
1135 GLES2DecoderTestBase::SetUp(); 1164 GLES2DecoderTestBase::SetUp();
1136 SetupDefaultProgram(); 1165 SetupDefaultProgram();
1137 } 1166 }
1138 1167
1139 } // namespace gles2 1168 } // namespace gles2
1140 } // namespace gpu 1169 } // 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