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

Side by Side Diff: gpu/tools/compositor_model_bench/shaders.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
« no previous file with comments | « gpu/tools/compositor_model_bench/render_model_utils.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/tools/compositor_model_bench/shaders.h" 5 #include "gpu/tools/compositor_model_bench/shaders.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "gpu/tools/compositor_model_bench/render_model_utils.h" 9 #include "gpu/tools/compositor_model_bench/render_model_utils.h"
10 #include "gpu/tools/compositor_model_bench/render_tree.h" 10 #include "gpu/tools/compositor_model_bench/render_tree.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 229
230 static void ReportAnyShaderCompilationErrors(GLuint shader, ShaderID id) { 230 static void ReportAnyShaderCompilationErrors(GLuint shader, ShaderID id) {
231 GLint status; 231 GLint status;
232 glGetShaderiv(shader, GL_COMPILE_STATUS, &status); 232 glGetShaderiv(shader, GL_COMPILE_STATUS, &status);
233 if (status) 233 if (status)
234 return; 234 return;
235 // Get the length of the log string 235 // Get the length of the log string
236 GLsizei length; 236 GLsizei length;
237 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length); 237 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &length);
238 scoped_array<GLchar> log(new GLchar[length+1]); 238 scoped_ptr<GLchar[]> log(new GLchar[length+1]);
239 glGetShaderInfoLog(shader, length, NULL, log.get()); 239 glGetShaderInfoLog(shader, length, NULL, log.get());
240 LOG(ERROR) << log.get() << " in shader " << ShaderNameFromID(id); 240 LOG(ERROR) << log.get() << " in shader " << ShaderNameFromID(id);
241 } 241 }
242 242
243 static int ActivateShader(ShaderID v, ShaderID f, float* layer_transform) { 243 static int ActivateShader(ShaderID v, ShaderID f, float* layer_transform) {
244 int program_index = GetProgramIdx(v, f); 244 int program_index = GetProgramIdx(v, f);
245 if (!g_program_objects[program_index]) { 245 if (!g_program_objects[program_index]) {
246 g_program_objects[program_index] = glCreateProgramObjectARB(); 246 g_program_objects[program_index] = glCreateProgramObjectARB();
247 GLenum vs = glCreateShaderObjectARB(GL_VERTEX_SHADER); 247 GLenum vs = glCreateShaderObjectARB(GL_VERTEX_SHADER);
248 GLenum fs = glCreateShaderObjectARB(GL_FRAGMENT_SHADER); 248 GLenum fs = glCreateShaderObjectARB(GL_FRAGMENT_SHADER);
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 float center_y = (top+bottom)/2 - g_current_tile_layer_height/2; 441 float center_y = (top+bottom)/2 - g_current_tile_layer_height/2;
442 TranslateInPlace(mv_transform, center_x, center_y, 0.0); 442 TranslateInPlace(mv_transform, center_x, center_y, 0.0);
443 443
444 Project(mv_transform, proj_transform); 444 Project(mv_transform, proj_transform);
445 GLint mat = glGetUniformLocationARB(prog, "matrix"); 445 GLint mat = glGetUniformLocationARB(prog, "matrix");
446 glUniformMatrix4fvARB(mat, 1, GL_TRUE, proj_transform); 446 glUniformMatrix4fvARB(mat, 1, GL_TRUE, proj_transform);
447 447
448 glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); 448 glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
449 } 449 }
450 450
OLDNEW
« no previous file with comments | « gpu/tools/compositor_model_bench/render_model_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698