This source file includes following definitions.
- browser_loop_
- Destroy
- FrameAvailable
- RegisterSurfaceTextureListener
#include "ui/gl/android/surface_texture_listener.h"
#include "base/location.h"
#include "base/message_loop/message_loop_proxy.h"
#include "jni/SurfaceTextureListener_jni.h"
namespace gfx {
SurfaceTextureListener::SurfaceTextureListener(const base::Closure& callback)
: callback_(callback),
browser_loop_(base::MessageLoopProxy::current()) {
}
SurfaceTextureListener::~SurfaceTextureListener() {
}
void SurfaceTextureListener::Destroy(JNIEnv* env, jobject obj) {
delete this;
}
void SurfaceTextureListener::FrameAvailable(JNIEnv* env, jobject obj) {
if (!browser_loop_->BelongsToCurrentThread()) {
browser_loop_->PostTask(FROM_HERE, callback_);
} else {
callback_.Run();
}
}
bool SurfaceTextureListener::RegisterSurfaceTextureListener(JNIEnv* env) {
return RegisterNativesImpl(env);
}
}