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

Side by Side Diff: media/tools/player_x11/gles_video_renderer.cc

Issue 5305005: Initialize destinations variables before calling GL functions... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | « media/tools/player_x11/gl_video_renderer.cc ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "media/tools/player_x11/gles_video_renderer.h" 5 #include "media/tools/player_x11/gles_video_renderer.h"
6 6
7 #include <dlfcn.h> 7 #include <dlfcn.h>
8 #include <EGL/eglext.h> 8 #include <EGL/eglext.h>
9 #include <X11/Xutil.h> 9 #include <X11/Xutil.h>
10 #include <X11/extensions/Xrender.h> 10 #include <X11/extensions/Xrender.h>
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 GLenum type, 357 GLenum type,
358 const char* source, 358 const char* source,
359 int size) { 359 int size) {
360 GLuint shader = glCreateShader(type); 360 GLuint shader = glCreateShader(type);
361 glShaderSource(shader, 1, &source, &size); 361 glShaderSource(shader, 1, &source, &size);
362 glCompileShader(shader); 362 glCompileShader(shader);
363 int result = GL_FALSE; 363 int result = GL_FALSE;
364 glGetShaderiv(shader, GL_COMPILE_STATUS, &result); 364 glGetShaderiv(shader, GL_COMPILE_STATUS, &result);
365 if (!result) { 365 if (!result) {
366 char log[kErrorSize]; 366 char log[kErrorSize];
367 int len; 367 int len = 0;
368 glGetShaderInfoLog(shader, kErrorSize - 1, &len, log); 368 glGetShaderInfoLog(shader, kErrorSize - 1, &len, log);
369 log[kErrorSize - 1] = 0; 369 log[kErrorSize - 1] = 0;
370 LOG(FATAL) << log; 370 LOG(FATAL) << log;
371 } 371 }
372 glAttachShader(program, shader); 372 glAttachShader(program, shader);
373 glDeleteShader(shader); 373 glDeleteShader(shader);
374 } 374 }
375 375
376 void GlesVideoRenderer::LinkProgram(GLuint program) { 376 void GlesVideoRenderer::LinkProgram(GLuint program) {
377 glLinkProgram(program); 377 glLinkProgram(program);
378 int result = GL_FALSE; 378 int result = GL_FALSE;
379 glGetProgramiv(program, GL_LINK_STATUS, &result); 379 glGetProgramiv(program, GL_LINK_STATUS, &result);
380 if (!result) { 380 if (!result) {
381 char log[kErrorSize]; 381 char log[kErrorSize];
382 int len; 382 int len = 0;
383 glGetProgramInfoLog(program, kErrorSize - 1, &len, log); 383 glGetProgramInfoLog(program, kErrorSize - 1, &len, log);
384 log[kErrorSize - 1] = 0; 384 log[kErrorSize - 1] = 0;
385 LOG(FATAL) << log; 385 LOG(FATAL) << log;
386 } 386 }
387 glUseProgram(program); 387 glUseProgram(program);
388 glDeleteProgram(program); 388 glDeleteProgram(program);
389 } 389 }
390 390
391 void GlesVideoRenderer::CreateTextureAndProgramEgl() { 391 void GlesVideoRenderer::CreateTextureAndProgramEgl() {
392 if (!egl_create_image_khr_) 392 if (!egl_create_image_khr_)
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 507
508 int pos_location = glGetAttribLocation(program, "in_pos"); 508 int pos_location = glGetAttribLocation(program, "in_pos");
509 glEnableVertexAttribArray(pos_location); 509 glEnableVertexAttribArray(pos_location);
510 glVertexAttribPointer(pos_location, 2, GL_FLOAT, GL_FALSE, 0, kVertices); 510 glVertexAttribPointer(pos_location, 2, GL_FLOAT, GL_FALSE, 0, kVertices);
511 511
512 int tc_location = glGetAttribLocation(program, "in_tc"); 512 int tc_location = glGetAttribLocation(program, "in_tc");
513 glEnableVertexAttribArray(tc_location); 513 glEnableVertexAttribArray(tc_location);
514 glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0, 514 glVertexAttribPointer(tc_location, 2, GL_FLOAT, GL_FALSE, 0,
515 kTextureCoords); 515 kTextureCoords);
516 } 516 }
OLDNEW
« no previous file with comments | « media/tools/player_x11/gl_video_renderer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698