summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 22:52:27 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-02 22:52:27 +0000
commit9415cfcea3ea9916841a3b2e0bd76d4f8318f170 (patch)
tree5b5ea0f636bf6afc397030043198bb0de8680a50 /content
parentaa7064276fe6bec755dae50fedfc40048efc5666 (diff)
downloadchromium_src-9415cfcea3ea9916841a3b2e0bd76d4f8318f170.zip
chromium_src-9415cfcea3ea9916841a3b2e0bd76d4f8318f170.tar.gz
chromium_src-9415cfcea3ea9916841a3b2e0bd76d4f8318f170.tar.bz2
Revert "Expose extra SurfaceTextureBridge methods."
This reverts commit c8a6410250f24992ff736733dada1a5050057461. Broke Android compile. BUG= Review URL: https://codereview.chromium.org/11363070 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/android/surface_texture_bridge.cc28
-rw-r--r--content/common/android/surface_texture_bridge.h15
-rw-r--r--content/common/android/surface_texture_listener.cc9
-rw-r--r--content/content.gyp10
4 files changed, 4 insertions, 58 deletions
diff --git a/content/common/android/surface_texture_bridge.cc b/content/common/android/surface_texture_bridge.cc
index bdf54ee..8f640f8 100644
--- a/content/common/android/surface_texture_bridge.cc
+++ b/content/common/android/surface_texture_bridge.cc
@@ -4,13 +4,10 @@
#include "content/common/android/surface_texture_bridge.h"
-#include <android/native_window_jni.h>
-
#include "base/android/jni_android.h"
#include "base/logging.h"
#include "content/common/android/surface_texture_listener.h"
#include "jni/SurfaceTexture_jni.h"
-#include "jni/Surface_jni.h"
using base::android::AttachCurrentThread;
using base::android::CheckException;
@@ -23,7 +20,6 @@ bool g_jni_initialized = false;
void RegisterNativesIfNeeded(JNIEnv* env) {
if (!g_jni_initialized) {
JNI_SurfaceTexture::RegisterNativesImpl(env);
- JNI_Surface::RegisterNativesImpl(env);
g_jni_initialized = true;
}
}
@@ -107,28 +103,4 @@ void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) {
static_cast<jint>(height));
}
-void SurfaceTextureBridge::AttachToGLContext(int texture_id) {
- JNIEnv* env = AttachCurrentThread();
- // Note: This method is only available on JB and greater.
- JNI_SurfaceTexture::Java_SurfaceTexture_attachToGLContext(
- env, j_surface_texture_.obj(), texture_id);
-}
-
-void SurfaceTextureBridge::DetachFromGLContext() {
- JNIEnv* env = AttachCurrentThread();
- // Note: This method is only available on JB and greater.
- JNI_SurfaceTexture::Java_SurfaceTexture_detachFromGLContext(
- env, j_surface_texture_.obj());
-}
-
-ANativeWindow* SurfaceTextureBridge::CreateSurface() {
- JNIEnv* env = AttachCurrentThread();
- ScopedJavaLocalRef<jobject> jsurface(
- JNI_Surface::Java_Surface_Constructor(
- env, j_surface_texture_.obj()));
- DCHECK(!jsurface.is_null());
- ANativeWindow* native_window = ANativeWindow_fromSurface(env, jsurface.obj());
- return native_window;
-}
-
} // namespace content
diff --git a/content/common/android/surface_texture_bridge.h b/content/common/android/surface_texture_bridge.h
index 0779196..97e8ef6 100644
--- a/content/common/android/surface_texture_bridge.h
+++ b/content/common/android/surface_texture_bridge.h
@@ -11,8 +11,6 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
-struct ANativeWindow;
-
namespace content {
// This class serves as a bridge for native code to call java functions inside
@@ -39,19 +37,6 @@ class SurfaceTextureBridge
// Set the default size of the image buffers.
void SetDefaultBufferSize(int width, int height);
- // Attach the SurfaceTexture to the given texture in the GL context that is
- // current on the calling thread.
- void AttachToGLContext(int texture_id);
-
- // Detaches the SurfaceTexture from the context that owns its current GL
- // texture. Must be called with that context current on the calling thread.
- void DetachFromGLContext();
-
- // Creates a native render surface for this surface texture.
- // The caller must release the underlying reference when done with the handle
- // by calling ANativeWindow_release().
- ANativeWindow* CreateSurface();
-
int texture_id() const {
return texture_id_;
}
diff --git a/content/common/android/surface_texture_listener.cc b/content/common/android/surface_texture_listener.cc
index 4440c5c..6ff63b4 100644
--- a/content/common/android/surface_texture_listener.cc
+++ b/content/common/android/surface_texture_listener.cc
@@ -38,11 +38,10 @@ void SurfaceTextureListener::Destroy(JNIEnv* env, jobject obj) {
}
void SurfaceTextureListener::FrameAvailable(JNIEnv* env, jobject obj) {
- if (!browser_loop_->BelongsToCurrentThread()) {
- browser_loop_->PostTask(FROM_HERE, callback_);
- } else {
- callback_.Run();
- }
+ // These notifications should be coming in on a thread private to Java.
+ // Should this ever change, we can try to avoid reposting to the same thread.
+ DCHECK(!browser_loop_->BelongsToCurrentThread());
+ browser_loop_->PostTask(FROM_HERE, callback_);
}
// static
diff --git a/content/content.gyp b/content/content.gyp
index e057fd6..e7da4dc 100644
--- a/content/content.gyp
+++ b/content/content.gyp
@@ -303,16 +303,6 @@
'includes': [ '../build/jar_file_jni_generator.gypi' ],
},
{
- 'target_name': 'surface_jni_headers',
- 'type': 'none',
- 'variables': {
- 'jni_gen_dir': 'content',
- 'input_java_class': 'android/view/Surface.class',
- 'input_jar_file': '<(android_sdk)/android.jar',
- },
- 'includes': [ '../build/jar_file_jni_generator.gypi' ],
- },
- {
'target_name': 'content_jni_headers',
'type': 'none',
'dependencies': [