OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef BLIMP_CLIENT_ANDROID_BLIMP_VIEW_H_ |
| 6 #define BLIMP_CLIENT_ANDROID_BLIMP_VIEW_H_ |
| 7 |
| 8 #include "base/android/jni_android.h" |
| 9 #include "base/macros.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 |
| 12 namespace gfx { |
| 13 class Size; |
| 14 } |
| 15 |
| 16 namespace blimp { |
| 17 |
| 18 class BlimpCompositorAndroid; |
| 19 |
| 20 // The native component of org.chromium.blimp.BlimpView. This builds and |
| 21 // maintains a BlimpCompositorAndroid and handles notifying the compositor of |
| 22 // SurfaceView surface changes (size, creation, destruction, etc.). |
| 23 class BlimpView { |
| 24 public: |
| 25 static bool RegisterJni(JNIEnv* env); |
| 26 |
| 27 BlimpView(JNIEnv* env, |
| 28 jobject jobj, |
| 29 const gfx::Size& physical_size, |
| 30 const gfx::Size& display_size, |
| 31 float dp_to_pixel); |
| 32 |
| 33 // JNI Methods |
| 34 void Destroy(JNIEnv* env, jobject jobj); |
| 35 void SetNeedsComposite(JNIEnv* env, jobject jobj); |
| 36 void SurfaceChanged(JNIEnv* env, |
| 37 jobject jobj, |
| 38 jint format, |
| 39 jint width, |
| 40 jint height, |
| 41 jobject jsurface); |
| 42 void SurfaceCreated(JNIEnv* env, jobject jobj); |
| 43 void SurfaceDestroyed(JNIEnv* env, jobject jobj); |
| 44 void SetVisibility(JNIEnv* env, jobject jobj, jboolean visible); |
| 45 |
| 46 private: |
| 47 virtual ~BlimpView(); |
| 48 |
| 49 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 50 |
| 51 scoped_ptr<BlimpCompositorAndroid> compositor_; |
| 52 int current_surface_format_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(BlimpView); |
| 55 }; |
| 56 |
| 57 } // namespace blimp |
| 58 |
| 59 #endif // BLIMP_CLIENT_ANDROID_BLIMP_VIEW_H_ |
OLD | NEW |