Chromium Code Reviews| Index: chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc |
| diff --git a/chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc b/chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc |
| index 0972c3e4268cf2d2f1e430568b302c477400a4f6..5f5abfd6a3a95260317c42fae4a3f4b9a4d6aa10 100644 |
| --- a/chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc |
| +++ b/chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc |
| @@ -28,8 +28,8 @@ |
| namespace { |
| +/* clang-format off */ |
| const char kQuadCopyVertex[] = SHADER( |
| - /* clang-format off */ |
| attribute vec4 a_Position; |
| attribute vec2 a_TexCoordinate; |
| varying vec2 v_TexCoordinate; |
| @@ -37,26 +37,25 @@ const char kQuadCopyVertex[] = SHADER( |
| v_TexCoordinate = a_TexCoordinate; |
| gl_Position = a_Position; |
| } |
| -); /* clang-format on */ |
| +); |
| const char kQuadCopyFragment[] = SHADER( |
| - /* clang-format off */ |
| precision highp float; |
| uniform sampler2D u_Texture; |
| varying vec2 v_TexCoordinate; |
| void main() { |
| gl_FragColor = texture2D(u_Texture, v_TexCoordinate); |
| } |
| -); /* clang-format on */ |
| +); |
| const float kQuadVertices[] = { |
| - // clang-format off |
| // x y u, v |
| -1.f, 1.f, 0.f, 1.f, |
| -1.f, -1.f, 0.f, 0.f, |
| 1.f, -1.f, 1.f, 0.f, |
| 1.f, 1.f, 1.f, 1.f}; |
| static constexpr int kQuadVerticesSize = sizeof(kQuadVertices); |
| +/* clang-format on */ |
|
mthiesse
2017/03/20 20:39:22
nit: move this a line up?
klausw
2017/03/20 21:33:12
Done.
|
| GLuint CompileShader(gpu::gles2::GLES2Interface* gl, |
| GLenum shader_type, |
| @@ -239,6 +238,7 @@ bool MailboxToSurfaceBridge::CopyMailboxToSurfaceAndSwap( |
| GLuint sourceTexture = ConsumeTexture(gl_, mailbox); |
| DrawQuad(sourceTexture); |
| + gl_->DeleteTextures(1, &sourceTexture); |
| gl_->SwapBuffers(); |
| return true; |
| } |