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

Unified Diff: chrome/browser/android/vr_shell/mailbox_to_surface_bridge.cc

Issue 2759943003: WebVR: add explicit texture delete, fix formatting (Closed)
Patch Set: Move clang format comment. Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..18e2ec21b512b4e89d76e6e1cebcabdee4652276 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,25 +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};
+/* clang-format on */
+
static constexpr int kQuadVerticesSize = sizeof(kQuadVertices);
GLuint CompileShader(gpu::gles2::GLES2Interface* gl,
@@ -239,6 +239,7 @@ bool MailboxToSurfaceBridge::CopyMailboxToSurfaceAndSwap(
GLuint sourceTexture = ConsumeTexture(gl_, mailbox);
DrawQuad(sourceTexture);
+ gl_->DeleteTextures(1, &sourceTexture);
gl_->SwapBuffers();
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698