| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/services/native_viewport/android/mojo_viewport.h" | 5 #include "mojo/services/native_viewport/android/mojo_viewport.h" |
| 6 | 6 |
| 7 #include <android/native_window_jni.h> | 7 #include <android/native_window_jni.h> |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "jni/MojoViewport_jni.h" | 9 #include "jni/MojoViewport_jni.h" |
| 10 #include "ui/gl/gl_bindings.h" | 10 #include "ui/gl/gl_bindings.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 delete init; | 32 delete init; |
| 33 } | 33 } |
| 34 | 34 |
| 35 MojoViewport::~MojoViewport() { | 35 MojoViewport::~MojoViewport() { |
| 36 } | 36 } |
| 37 | 37 |
| 38 void MojoViewport::CreateForActivity( | 38 void MojoViewport::CreateForActivity( |
| 39 jobject activity, | 39 jobject activity, |
| 40 MojoViewportInit* init) { | 40 MojoViewportInit* init) { |
| 41 JNIEnv* env = base::android::AttachCurrentThread(); | 41 JNIEnv* env = base::android::AttachCurrentThread(); |
| 42 Java_MojoViewport_CreateForActivity( | 42 Java_MojoViewport_createForActivity( |
| 43 env, activity, reinterpret_cast<jint>(init)); | 43 env, activity, reinterpret_cast<jint>(init)); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void MojoViewport::Destroy(JNIEnv* env, jobject obj) { | 46 void MojoViewport::Destroy(JNIEnv* env, jobject obj) { |
| 47 delete this; | 47 delete this; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void MojoViewport::SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface) { | 50 void MojoViewport::SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface) { |
| 51 base::android::ScopedJavaLocalRef<jobject> protector(env, jsurface); | 51 base::android::ScopedJavaLocalRef<jobject> protector(env, jsurface); |
| 52 DCHECK(jsurface); | 52 DCHECK(jsurface); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 73 void MojoViewport::SurfaceSetSize( | 73 void MojoViewport::SurfaceSetSize( |
| 74 JNIEnv* env, jobject obj, jint width, jint height) { | 74 JNIEnv* env, jobject obj, jint width, jint height) { |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool MojoViewport::Register(JNIEnv* env) { | 77 bool MojoViewport::Register(JNIEnv* env) { |
| 78 return RegisterNativesImpl(env); | 78 return RegisterNativesImpl(env); |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace services | 81 } // namespace services |
| 82 } // namespace mojo | 82 } // namespace mojo |
| OLD | NEW |