diff options
Diffstat (limited to 'chromium/ui/gl/android')
-rw-r--r-- | chromium/ui/gl/android/gl_jni_registrar.cc | 30 | ||||
-rw-r--r-- | chromium/ui/gl/android/gl_jni_registrar.h | 23 | ||||
-rw-r--r-- | chromium/ui/gl/android/scoped_java_surface.cc | 4 | ||||
-rw-r--r-- | chromium/ui/gl/android/scoped_java_surface.h | 4 | ||||
-rw-r--r-- | chromium/ui/gl/android/surface_texture.cc (renamed from chromium/ui/gl/android/surface_texture_bridge.cc) | 44 | ||||
-rw-r--r-- | chromium/ui/gl/android/surface_texture.h (renamed from chromium/ui/gl/android/surface_texture_bridge.h) | 22 | ||||
-rw-r--r-- | chromium/ui/gl/android/surface_texture_listener.cc | 2 | ||||
-rw-r--r-- | chromium/ui/gl/android/surface_texture_listener.h | 2 |
8 files changed, 40 insertions, 91 deletions
diff --git a/chromium/ui/gl/android/gl_jni_registrar.cc b/chromium/ui/gl/android/gl_jni_registrar.cc deleted file mode 100644 index cba90cef77d..00000000000 --- a/chromium/ui/gl/android/gl_jni_registrar.cc +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) 2013 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. - -#include "ui/gl/android/gl_jni_registrar.h" - -#include "base/android/jni_android.h" -#include "base/android/jni_registrar.h" -#include "ui/gl/android/surface_texture_bridge.h" -#include "ui/gl/android/surface_texture_listener.h" - -namespace ui { -namespace gl { -namespace android { - -static base::android::RegistrationMethod kGLRegisteredMethods[] = { - { "SurfaceTextureBridge", - gfx::SurfaceTextureBridge::RegisterSurfaceTextureBridge }, - { "SurfaceTextureListener", - gfx::SurfaceTextureListener::RegisterSurfaceTextureListener }, -}; - -bool RegisterJni(JNIEnv* env) { - return RegisterNativeMethods(env, kGLRegisteredMethods, - arraysize(kGLRegisteredMethods)); -} - -} // namespace android -} // namespace gl -} // namespace ui diff --git a/chromium/ui/gl/android/gl_jni_registrar.h b/chromium/ui/gl/android/gl_jni_registrar.h deleted file mode 100644 index 468557c3e79..00000000000 --- a/chromium/ui/gl/android/gl_jni_registrar.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2013 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. - -#ifndef UI_GL_ANDROID_UI_JNI_REGISTRAR_H_ -#define UI_GL_ANDROID_UI_JNI_REGISTRAR_H_ - -#include <jni.h> - -#include "ui/gl/gl_export.h" - -namespace ui { -namespace gl { -namespace android { - -// Register all JNI bindings necessary for chrome. -GL_EXPORT bool RegisterJni(JNIEnv* env); - -} // namespace android -} // namespace gl -} // namespace ui - -#endif // UI_GL_ANDROID_UI_JNI_REGISTRAR_H_ diff --git a/chromium/ui/gl/android/scoped_java_surface.cc b/chromium/ui/gl/android/scoped_java_surface.cc index fe6a75e9ace..36f635fe01a 100644 --- a/chromium/ui/gl/android/scoped_java_surface.cc +++ b/chromium/ui/gl/android/scoped_java_surface.cc @@ -6,7 +6,7 @@ #include "base/logging.h" #include "jni/Surface_jni.h" -#include "ui/gl/android/surface_texture_bridge.h" +#include "ui/gl/android/surface_texture.h" namespace { @@ -37,7 +37,7 @@ ScopedJavaSurface::ScopedJavaSurface( } ScopedJavaSurface::ScopedJavaSurface( - const SurfaceTextureBridge* surface_texture) + const SurfaceTexture* surface_texture) : auto_release_(true), is_protected_(false) { JNIEnv* env = base::android::AttachCurrentThread(); diff --git a/chromium/ui/gl/android/scoped_java_surface.h b/chromium/ui/gl/android/scoped_java_surface.h index b50485b876f..54ed2a45190 100644 --- a/chromium/ui/gl/android/scoped_java_surface.h +++ b/chromium/ui/gl/android/scoped_java_surface.h @@ -13,7 +13,7 @@ namespace gfx { -class SurfaceTextureBridge; +class SurfaceTexture; // A helper class for holding a scoped reference to a Java Surface instance. // When going out of scope, Surface.release() is called on the Java object to @@ -29,7 +29,7 @@ class GL_EXPORT ScopedJavaSurface { // Creates a Java Surface from a SurfaceTexture and wraps it in a // ScopedJavaSurface. - explicit ScopedJavaSurface(const SurfaceTextureBridge* surface_texture); + explicit ScopedJavaSurface(const SurfaceTexture* surface_texture); // Move constructor. Take the surface from another ScopedJavaSurface object, // the latter no longer owns the surface afterwards. diff --git a/chromium/ui/gl/android/surface_texture_bridge.cc b/chromium/ui/gl/android/surface_texture.cc index 9f2a3372e84..d900972c9d1 100644 --- a/chromium/ui/gl/android/surface_texture_bridge.cc +++ b/chromium/ui/gl/android/surface_texture.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. -#include "ui/gl/android/surface_texture_bridge.h" +#include "ui/gl/android/surface_texture.h" #include <android/native_window_jni.h> @@ -10,7 +10,7 @@ #include "base/android/build_info.h" #include "base/android/jni_android.h" #include "base/logging.h" -#include "jni/SurfaceTextureBridge_jni.h" +#include "jni/SurfaceTexturePlatformWrapper_jni.h" #include "ui/gl/android/scoped_java_surface.h" #include "ui/gl/android/surface_texture_listener.h" #include "ui/gl/gl_bindings.h" @@ -26,36 +26,38 @@ bool GlContextMethodsAvailable() { namespace gfx { -SurfaceTextureBridge::SurfaceTextureBridge(int texture_id) { +SurfaceTexture::SurfaceTexture(int texture_id) { JNIEnv* env = base::android::AttachCurrentThread(); - j_surface_texture_.Reset(Java_SurfaceTextureBridge_create(env, texture_id)); + j_surface_texture_.Reset( + Java_SurfaceTexturePlatformWrapper_create(env, texture_id)); } -SurfaceTextureBridge::~SurfaceTextureBridge() { +SurfaceTexture::~SurfaceTexture() { JNIEnv* env = base::android::AttachCurrentThread(); - Java_SurfaceTextureBridge_destroy(env, j_surface_texture_.obj()); + Java_SurfaceTexturePlatformWrapper_destroy(env, j_surface_texture_.obj()); } -void SurfaceTextureBridge::SetFrameAvailableCallback( +void SurfaceTexture::SetFrameAvailableCallback( const base::Closure& callback) { JNIEnv* env = base::android::AttachCurrentThread(); - Java_SurfaceTextureBridge_setFrameAvailableCallback( + Java_SurfaceTexturePlatformWrapper_setFrameAvailableCallback( env, j_surface_texture_.obj(), reinterpret_cast<int>(new SurfaceTextureListener(callback))); } -void SurfaceTextureBridge::UpdateTexImage() { +void SurfaceTexture::UpdateTexImage() { JNIEnv* env = base::android::AttachCurrentThread(); - Java_SurfaceTextureBridge_updateTexImage(env, j_surface_texture_.obj()); + Java_SurfaceTexturePlatformWrapper_updateTexImage(env, + j_surface_texture_.obj()); } -void SurfaceTextureBridge::GetTransformMatrix(float mtx[16]) { +void SurfaceTexture::GetTransformMatrix(float mtx[16]) { JNIEnv* env = base::android::AttachCurrentThread(); base::android::ScopedJavaLocalRef<jfloatArray> jmatrix( env, env->NewFloatArray(16)); - Java_SurfaceTextureBridge_getTransformMatrix( + Java_SurfaceTexturePlatformWrapper_getTransformMatrix( env, j_surface_texture_.obj(), jmatrix.obj()); jboolean is_copy; @@ -66,11 +68,11 @@ void SurfaceTextureBridge::GetTransformMatrix(float mtx[16]) { env->ReleaseFloatArrayElements(jmatrix.obj(), elements, JNI_ABORT); } -void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) { +void SurfaceTexture::SetDefaultBufferSize(int width, int height) { JNIEnv* env = base::android::AttachCurrentThread(); if (width > 0 && height > 0) { - Java_SurfaceTextureBridge_setDefaultBufferSize( + Java_SurfaceTexturePlatformWrapper_setDefaultBufferSize( env, j_surface_texture_.obj(), static_cast<jint>(width), static_cast<jint>(height)); } else { @@ -79,26 +81,26 @@ void SurfaceTextureBridge::SetDefaultBufferSize(int width, int height) { } } -void SurfaceTextureBridge::AttachToGLContext() { +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_SurfaceTextureBridge_attachToGLContext( + Java_SurfaceTexturePlatformWrapper_attachToGLContext( env, j_surface_texture_.obj(), texture_id); } } -void SurfaceTextureBridge::DetachFromGLContext() { +void SurfaceTexture::DetachFromGLContext() { if (GlContextMethodsAvailable()) { JNIEnv* env = base::android::AttachCurrentThread(); - Java_SurfaceTextureBridge_detachFromGLContext( + Java_SurfaceTexturePlatformWrapper_detachFromGLContext( env, j_surface_texture_.obj()); } } -ANativeWindow* SurfaceTextureBridge::CreateSurface() { +ANativeWindow* SurfaceTexture::CreateSurface() { JNIEnv* env = base::android::AttachCurrentThread(); ScopedJavaSurface surface(this); ANativeWindow* native_window = ANativeWindow_fromSurface( @@ -107,7 +109,7 @@ ANativeWindow* SurfaceTextureBridge::CreateSurface() { } // static -bool SurfaceTextureBridge::RegisterSurfaceTextureBridge(JNIEnv* env) { +bool SurfaceTexture::RegisterSurfaceTexture(JNIEnv* env) { return RegisterNativesImpl(env); } diff --git a/chromium/ui/gl/android/surface_texture_bridge.h b/chromium/ui/gl/android/surface_texture.h index 474f0c22d39..62e375f796f 100644 --- a/chromium/ui/gl/android/surface_texture_bridge.h +++ b/chromium/ui/gl/android/surface_texture.h @@ -1,9 +1,9 @@ -// Copyright (c) 2013 The Chromium Authors. All rights reserved. +// Copyright 2013 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. -#ifndef UI_GL_ANDROID_SURFACE_TEXTURE_BRIDGE_H_ -#define UI_GL_ANDROID_SURFACE_TEXTURE_BRIDGE_H_ +#ifndef UI_GL_ANDROID_SURFACE_TEXTURE_H_ +#define UI_GL_ANDROID_SURFACE_TEXTURE_H_ #include <jni.h> @@ -18,10 +18,10 @@ namespace gfx { // This class serves as a bridge for native code to call java functions inside // android SurfaceTexture class. -class GL_EXPORT SurfaceTextureBridge - : public base::RefCountedThreadSafe<SurfaceTextureBridge>{ +class GL_EXPORT SurfaceTexture + : public base::RefCountedThreadSafe<SurfaceTexture>{ public: - explicit SurfaceTextureBridge(int texture_id); + explicit SurfaceTexture(int texture_id); // Set the listener callback, which will be invoked on the same thread that // is being called from here for registration. @@ -57,18 +57,18 @@ class GL_EXPORT SurfaceTextureBridge return j_surface_texture_; } - static bool RegisterSurfaceTextureBridge(JNIEnv* env); + static bool RegisterSurfaceTexture(JNIEnv* env); private: - friend class base::RefCountedThreadSafe<SurfaceTextureBridge>; - ~SurfaceTextureBridge(); + friend class base::RefCountedThreadSafe<SurfaceTexture>; + ~SurfaceTexture(); // Java SurfaceTexture instance. base::android::ScopedJavaGlobalRef<jobject> j_surface_texture_; - DISALLOW_COPY_AND_ASSIGN(SurfaceTextureBridge); + DISALLOW_COPY_AND_ASSIGN(SurfaceTexture); }; } // namespace gfx -#endif // UI_GL_ANDROID_SURFACE_TEXTURE_BRIDGE_H_ +#endif // UI_GL_ANDROID_SURFACE_TEXTURE_H_ diff --git a/chromium/ui/gl/android/surface_texture_listener.cc b/chromium/ui/gl/android/surface_texture_listener.cc index 39d8468dd4a..8e2f89c5256 100644 --- a/chromium/ui/gl/android/surface_texture_listener.cc +++ b/chromium/ui/gl/android/surface_texture_listener.cc @@ -8,7 +8,7 @@ #include "base/logging.h" #include "base/message_loop/message_loop_proxy.h" #include "jni/SurfaceTextureListener_jni.h" -#include "ui/gl/android/surface_texture_bridge.h" +#include "ui/gl/android/surface_texture.h" namespace gfx { diff --git a/chromium/ui/gl/android/surface_texture_listener.h b/chromium/ui/gl/android/surface_texture_listener.h index 60103aad97d..823bc300642 100644 --- a/chromium/ui/gl/android/surface_texture_listener.h +++ b/chromium/ui/gl/android/surface_texture_listener.h @@ -33,7 +33,7 @@ class GL_EXPORT SurfaceTextureListener { SurfaceTextureListener(const base::Closure& callback); ~SurfaceTextureListener(); - friend class SurfaceTextureBridge; + friend class SurfaceTexture; base::Closure callback_; |