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

Unified Diff: ui/gl/android/surface_texture.cc

Issue 1060233002: Remove ICS support from SurfaceTexture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove CreateSingleBuffered Created 5 years, 8 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 | « ui/gl/android/surface_texture.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/android/surface_texture.cc
diff --git a/ui/gl/android/surface_texture.cc b/ui/gl/android/surface_texture.cc
index a9f52dc5630e7cb439d9c9ca3bcb0fdb79cd8ecb..232705d6fab026478029d1b647ed10b49a0ccc5e 100644
--- a/ui/gl/android/surface_texture.cc
+++ b/ui/gl/android/surface_texture.cc
@@ -6,8 +6,6 @@
#include <android/native_window_jni.h>
-// TODO(boliu): Remove this include when we move off ICS.
-#include "base/android/build_info.h"
#include "base/android/jni_android.h"
#include "base/logging.h"
#include "jni/SurfaceTexturePlatformWrapper_jni.h"
@@ -15,14 +13,6 @@
#include "ui/gl/android/surface_texture_listener.h"
#include "ui/gl/gl_bindings.h"
-// TODO(boliu): Remove this method when Chromium stops supporting ICS.
-bool GlContextMethodsAvailable() {
- bool available = base::android::BuildInfo::GetInstance()->sdk_int() >= 16;
- if (!available)
- LOG(WARNING) << "Running on unsupported device: rendering may not work";
- return available;
-}
-
namespace gfx {
scoped_refptr<SurfaceTexture> SurfaceTexture::Create(int texture_id) {
@@ -31,14 +21,6 @@ scoped_refptr<SurfaceTexture> SurfaceTexture::Create(int texture_id) {
Java_SurfaceTexturePlatformWrapper_create(env, texture_id));
}
-scoped_refptr<SurfaceTexture> SurfaceTexture::CreateSingleBuffered(
- int texture_id) {
- DCHECK(IsSingleBufferModeSupported());
- JNIEnv* env = base::android::AttachCurrentThread();
- return new SurfaceTexture(
- Java_SurfaceTexturePlatformWrapper_createSingleBuffered(env, texture_id));
-}
-
SurfaceTexture::SurfaceTexture(
const base::android::ScopedJavaLocalRef<jobject>& j_surface_texture) {
j_surface_texture_.Reset(j_surface_texture);
@@ -64,13 +46,6 @@ void SurfaceTexture::UpdateTexImage() {
j_surface_texture_.obj());
}
-void SurfaceTexture::ReleaseTexImage() {
- DCHECK(IsSingleBufferModeSupported());
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_SurfaceTexturePlatformWrapper_releaseTexImage(env,
- j_surface_texture_.obj());
-}
-
void SurfaceTexture::GetTransformMatrix(float mtx[16]) {
JNIEnv* env = base::android::AttachCurrentThread();
@@ -88,22 +63,18 @@ void SurfaceTexture::GetTransformMatrix(float mtx[16]) {
}
void SurfaceTexture::AttachToGLContext() {
- if (GlContextMethodsAvailable()) {
- int texture_id;
- glGetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES, &texture_id);
- DCHECK(texture_id);
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_SurfaceTexturePlatformWrapper_attachToGLContext(
- env, j_surface_texture_.obj(), texture_id);
- }
+ int texture_id;
+ glGetIntegerv(GL_TEXTURE_BINDING_EXTERNAL_OES, &texture_id);
+ DCHECK(texture_id);
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_SurfaceTexturePlatformWrapper_attachToGLContext(
+ env, j_surface_texture_.obj(), texture_id);
}
void SurfaceTexture::DetachFromGLContext() {
- if (GlContextMethodsAvailable()) {
- JNIEnv* env = base::android::AttachCurrentThread();
- Java_SurfaceTexturePlatformWrapper_detachFromGLContext(
- env, j_surface_texture_.obj());
- }
+ JNIEnv* env = base::android::AttachCurrentThread();
+ Java_SurfaceTexturePlatformWrapper_detachFromGLContext(
+ env, j_surface_texture_.obj());
}
ANativeWindow* SurfaceTexture::CreateSurface() {
@@ -118,11 +89,6 @@ ANativeWindow* SurfaceTexture::CreateSurface() {
return native_window;
}
-// static
-bool SurfaceTexture::IsSingleBufferModeSupported() {
- return base::android::BuildInfo::GetInstance()->sdk_int() >= 19;
-}
-
bool SurfaceTexture::RegisterSurfaceTexture(JNIEnv* env) {
return RegisterNativesImpl(env);
}
« no previous file with comments | « ui/gl/android/surface_texture.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698