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

Side by Side Diff: gpu/command_buffer/tests/gl_unittests.cc

Issue 13454036: Rewrite scoped_array<T> to scoped_ptr<T[]> in gpu/, Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yikes Created 7 years, 8 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) 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 <GLES2/gl2.h> 5 #include <GLES2/gl2.h>
6 #include <GLES2/gl2ext.h> 6 #include <GLES2/gl2ext.h>
7 7
8 #include "gpu/command_buffer/tests/gl_manager.h" 8 #include "gpu/command_buffer/tests/gl_manager.h"
9 #include "gpu/command_buffer/tests/gl_test_utils.h" 9 #include "gpu/command_buffer/tests/gl_test_utils.h"
10 #include "testing/gmock/include/gmock/gmock.h" 10 #include "testing/gmock/include/gmock/gmock.h"
(...skipping 22 matching lines...) Expand all
33 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected)); 33 EXPECT_TRUE(GLTestHelper::CheckPixels(0, 0, 1, 1, 0, expected));
34 GLTestHelper::CheckGLError("no errors", __LINE__); 34 GLTestHelper::CheckGLError("no errors", __LINE__);
35 } 35 }
36 36
37 TEST_F(GLTest, BasicFBO) { 37 TEST_F(GLTest, BasicFBO) {
38 GLuint tex = 0; 38 GLuint tex = 0;
39 glGenTextures(1, &tex); 39 glGenTextures(1, &tex);
40 GLuint fbo = 0; 40 GLuint fbo = 0;
41 glGenFramebuffers(1, &fbo); 41 glGenFramebuffers(1, &fbo);
42 glBindTexture(GL_TEXTURE_2D, tex); 42 glBindTexture(GL_TEXTURE_2D, tex);
43 scoped_array<uint8> pixels(new uint8 [16*16*4]); 43 scoped_ptr<uint8[]> pixels(new uint8 [16*16*4]);
44 memset(pixels.get(), 0, 16*16*4); 44 memset(pixels.get(), 0, 16*16*4);
45 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE, 45 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 16, 16, 0, GL_RGBA, GL_UNSIGNED_BYTE,
46 pixels.get()); 46 pixels.get());
47 glGenerateMipmap(GL_TEXTURE_2D); 47 glGenerateMipmap(GL_TEXTURE_2D);
48 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); 48 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
49 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); 49 glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
50 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 50 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
51 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 51 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
52 glBindFramebuffer(GL_FRAMEBUFFER, fbo); 52 glBindFramebuffer(GL_FRAMEBUFFER, fbo);
53 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 53 glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 EXPECT_STREQ( 102 EXPECT_STREQ(
103 "Chromium", 103 "Chromium",
104 reinterpret_cast<const char*>(glGetString(GL_RENDERER))); 104 reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
105 EXPECT_STREQ( 105 EXPECT_STREQ(
106 "Chromium", 106 "Chromium",
107 reinterpret_cast<const char*>(glGetString(GL_VENDOR))); 107 reinterpret_cast<const char*>(glGetString(GL_VENDOR)));
108 } 108 }
109 109
110 } // namespace gpu 110 } // namespace gpu
111 111
OLDNEW
« no previous file with comments | « gpu/command_buffer/tests/gl_test_utils.cc ('k') | gpu/tools/compositor_model_bench/render_model_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698