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

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

Issue 10543125: gpu: Add support for GLX_EXT_texture_from_pixmap extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add kGLImplementationMockGL case to gl_image_android.cc. Created 8 years, 2 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/texture_manager.cc ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | 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/texture_manager.h" 5 #include "gpu/command_buffer/service/texture_manager.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "gpu/command_buffer/common/gl_mock.h" 8 #include "gpu/command_buffer/common/gl_mock.h"
9 #include "gpu/command_buffer/service/feature_info.h" 9 #include "gpu/command_buffer/service/feature_info.h"
10 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h" 10 #include "gpu/command_buffer/service/gles2_cmd_decoder_mock.h"
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 manager_.SetLevelInfo(info, 992 manager_.SetLevelInfo(info,
993 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, false); 993 GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, false);
994 EXPECT_TRUE(manager_.CanRender(info)); 994 EXPECT_TRUE(manager_.CanRender(info));
995 EXPECT_FALSE(manager_.HaveUnrenderableTextures()); 995 EXPECT_FALSE(manager_.HaveUnrenderableTextures());
996 EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService2Id))) 996 EXPECT_CALL(*gl_, DeleteTextures(1, ::testing::Pointee(kService2Id)))
997 .Times(1) 997 .Times(1)
998 .RetiresOnSaturation(); 998 .RetiresOnSaturation();
999 info = NULL; 999 info = NULL;
1000 } 1000 }
1001 1001
1002 TEST_F(TextureInfoTest, GetLevelImage) {
1003 manager_.SetInfoTarget(info_, GL_TEXTURE_2D);
1004 manager_.SetLevelInfo(info_,
1005 GL_TEXTURE_2D, 1, GL_RGBA, 2, 2, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, true);
1006 EXPECT_TRUE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
1007 // Set image.
1008 manager_.SetLevelImage(info_,
1009 GL_TEXTURE_2D, 1, gfx::GLImage::CreateGLImage(0));
1010 EXPECT_FALSE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
1011 // Remove it.
1012 manager_.SetLevelImage(info_, GL_TEXTURE_2D, 1, NULL);
1013 EXPECT_TRUE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
1014 manager_.SetLevelImage(info_,
1015 GL_TEXTURE_2D, 1, gfx::GLImage::CreateGLImage(0));
1016 // Image should be reset when SetLevelInfo is called.
1017 manager_.SetLevelInfo(info_,
1018 GL_TEXTURE_2D, 1, GL_RGBA, 2, 2, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, true);
1019 EXPECT_TRUE(info_->GetLevelImage(GL_TEXTURE_2D, 1) == NULL);
1020 }
1021
1002 } // namespace gles2 1022 } // namespace gles2
1003 } // namespace gpu 1023 } // namespace gpu
1004 1024
1005 1025
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/texture_manager.cc ('k') | gpu/command_buffer/tests/gl_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698