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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/cardboard/TextureHelper.java

Issue 2252123002: [Remoting Android] Remove Cardboard Code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reviewer's Feedback - Removed unused const and strings Created 4 years, 4 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
Index: remoting/android/java/src/org/chromium/chromoting/cardboard/TextureHelper.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/cardboard/TextureHelper.java b/remoting/android/java/src/org/chromium/chromoting/cardboard/TextureHelper.java
deleted file mode 100644
index 82b852a113a759338a320b19befa2943ca79e363..0000000000000000000000000000000000000000
--- a/remoting/android/java/src/org/chromium/chromoting/cardboard/TextureHelper.java
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chromoting.cardboard;
-
-import static android.opengl.GLES20.GL_LINEAR;
-import static android.opengl.GLES20.GL_NEAREST;
-import static android.opengl.GLES20.GL_TEXTURE_2D;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP_NEGATIVE_X;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_X;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_Y;
-import static android.opengl.GLES20.GL_TEXTURE_CUBE_MAP_POSITIVE_Z;
-import static android.opengl.GLES20.GL_TEXTURE_MAG_FILTER;
-import static android.opengl.GLES20.GL_TEXTURE_MIN_FILTER;
-import static android.opengl.GLES20.glBindTexture;
-import static android.opengl.GLES20.glDeleteTextures;
-import static android.opengl.GLES20.glGenTextures;
-import static android.opengl.GLES20.glTexParameteri;
-import static android.opengl.GLUtils.texImage2D;
-
-import android.graphics.Bitmap;
-
-/**
- * Helper class for working with OpenGL textures.
- */
-public class TextureHelper {
- /**
- * Create new texture handle.
- * @return New texture handle.
- */
- public static int createTextureHandle() {
- int[] textureDataHandle = new int[1];
- glGenTextures(1, textureDataHandle, 0);
- if (textureDataHandle[0] != 0) {
- return textureDataHandle[0];
- } else {
- throw new RuntimeException("Error generating texture handle.");
- }
- }
-
- /**
- * Link desktop texture with a handle.
- * @param textureDataHandle the handle to attach texture to
- */
- public static void linkTexture(int textureDataHandle, Bitmap bitmap) {
- // Delete previously attached texture.
- glDeleteTextures(1, new int[]{textureDataHandle}, 0);
-
- // Bind to the texture in OpenGL.
- glBindTexture(GL_TEXTURE_2D, textureDataHandle);
-
- glTexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_MIN_FILTER, GL_NEAREST);
- glTexParameteri(GL_TEXTURE_2D,
- GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- // Load the bitmap into the bound texture.
- texImage2D(GL_TEXTURE_2D, 0, bitmap, 0);
- }
-
- /**
- * Link the cubemap images with a given texture handle.
- */
- public static void linkCubeMap(int textureDataHandle, Bitmap[] cubeBitmaps) {
- glBindTexture(GL_TEXTURE_CUBE_MAP, textureDataHandle);
-
- // Linear filtering for minification and magnification.
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
- // Link left, right, bottom, top, back and front image in order.
- texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_X, 0, cubeBitmaps[0], 0);
- texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X, 0, cubeBitmaps[1], 0);
-
- texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, cubeBitmaps[2], 0);
- texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Y, 0, cubeBitmaps[3], 0);
-
- texImage2D(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, cubeBitmaps[4], 0);
- texImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_Z, 0, cubeBitmaps[5], 0);
- }
-}
« no previous file with comments | « remoting/android/java/src/org/chromium/chromoting/cardboard/ShaderHelper.java ('k') | remoting/android/remoting_apk_tmpl.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698