| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "remoting/client/gl_canvas.h" | 5 #include "remoting/client/gl_canvas.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "remoting/client/gl_helpers.h" | 8 #include "remoting/client/gl_helpers.h" |
| 9 | 9 |
| 10 namespace { | 10 namespace { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 glDisable(GL_BLEND); | 77 glDisable(GL_BLEND); |
| 78 glDisableVertexAttribArray(tex_cord_location_); | 78 glDisableVertexAttribArray(tex_cord_location_); |
| 79 glDisableVertexAttribArray(position_location_); | 79 glDisableVertexAttribArray(position_location_); |
| 80 glDeleteProgram(program_); | 80 glDeleteProgram(program_); |
| 81 glDeleteShader(vertex_shader_); | 81 glDeleteShader(vertex_shader_); |
| 82 glDeleteShader(fragment_shader_); | 82 glDeleteShader(fragment_shader_); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void GlCanvas::SetNormalizedTransformation(const std::array<float, 9>& matrix) { | 85 void GlCanvas::SetNormalizedTransformation(const std::array<float, 9>& matrix) { |
| 86 DCHECK(thread_checker_.CalledOnValidThread()); | 86 DCHECK(thread_checker_.CalledOnValidThread()); |
| 87 glUniformMatrix3fv(transform_location_, 1, GL_TRUE, matrix.data()); | 87 glUniformMatrix3fv(transform_location_, 1, GL_FALSE, matrix.data()); |
| 88 transformation_set_ = true; | 88 transformation_set_ = true; |
| 89 } | 89 } |
| 90 | 90 |
| 91 void GlCanvas::DrawTexture(int texture_id, | 91 void GlCanvas::DrawTexture(int texture_id, |
| 92 GLuint texture_handle, | 92 GLuint texture_handle, |
| 93 GLuint vertex_buffer, | 93 GLuint vertex_buffer, |
| 94 float alpha_multiplier) { | 94 float alpha_multiplier) { |
| 95 DCHECK(thread_checker_.CalledOnValidThread()); | 95 DCHECK(thread_checker_.CalledOnValidThread()); |
| 96 if (!transformation_set_) { | 96 if (!transformation_set_) { |
| 97 return; | 97 return; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 110 glDrawArrays(GL_TRIANGLE_STRIP, 0, kVertexCount); | 110 glDrawArrays(GL_TRIANGLE_STRIP, 0, kVertexCount); |
| 111 glBindBuffer(GL_ARRAY_BUFFER, 0); | 111 glBindBuffer(GL_ARRAY_BUFFER, 0); |
| 112 glBindTexture(GL_TEXTURE_2D, 0); | 112 glBindTexture(GL_TEXTURE_2D, 0); |
| 113 } | 113 } |
| 114 | 114 |
| 115 int GlCanvas::GetGlVersion() const { | 115 int GlCanvas::GetGlVersion() const { |
| 116 return gl_version_; | 116 return gl_version_; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace remoting | 119 } // namespace remoting |
| OLD | NEW |