| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 5 #ifndef CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 6 #define CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_weak_ref.h" | 8 #include "base/android/jni_weak_ref.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class ContentViewRenderView : public CompositorClient { | 22 class ContentViewRenderView : public CompositorClient { |
| 23 public: | 23 public: |
| 24 // Registers the JNI methods for ContentViewRender. | 24 // Registers the JNI methods for ContentViewRender. |
| 25 static bool RegisterContentViewRenderView(JNIEnv* env); | 25 static bool RegisterContentViewRenderView(JNIEnv* env); |
| 26 | 26 |
| 27 ContentViewRenderView(JNIEnv* env, | 27 ContentViewRenderView(JNIEnv* env, |
| 28 jobject obj, | 28 jobject obj, |
| 29 gfx::NativeWindow root_window); | 29 gfx::NativeWindow root_window); |
| 30 | 30 |
| 31 // Methods called from Java via JNI ----------------------------------------- | 31 // Methods called from Java via JNI ----------------------------------------- |
| 32 void Destroy(JNIEnv* env, jobject obj); | 32 void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj); |
| 33 void SetCurrentContentViewCore(JNIEnv* env, jobject obj, | 33 void SetCurrentContentViewCore( |
| 34 jlong native_content_view_core); | 34 JNIEnv* env, |
| 35 void SurfaceCreated(JNIEnv* env, jobject obj); | 35 const base::android::JavaParamRef<jobject>& obj, |
| 36 void SurfaceDestroyed(JNIEnv* env, jobject obj); | 36 jlong native_content_view_core); |
| 37 void SurfaceChanged(JNIEnv* env, jobject obj, | 37 void SurfaceCreated(JNIEnv* env, |
| 38 jint format, jint width, jint height, jobject surface); | 38 const base::android::JavaParamRef<jobject>& obj); |
| 39 void SetOverlayVideoMode(JNIEnv* env, jobject obj, bool enabled); | 39 void SurfaceDestroyed(JNIEnv* env, |
| 40 void SetNeedsComposite(JNIEnv* env, jobject obj); | 40 const base::android::JavaParamRef<jobject>& obj); |
| 41 void SurfaceChanged(JNIEnv* env, |
| 42 const base::android::JavaParamRef<jobject>& obj, |
| 43 jint format, |
| 44 jint width, |
| 45 jint height, |
| 46 const base::android::JavaParamRef<jobject>& surface); |
| 47 void SetOverlayVideoMode(JNIEnv* env, |
| 48 const base::android::JavaParamRef<jobject>& obj, |
| 49 bool enabled); |
| 50 void SetNeedsComposite(JNIEnv* env, |
| 51 const base::android::JavaParamRef<jobject>& obj); |
| 41 | 52 |
| 42 // TODO(yusufo): Remove this once the compositor code is | 53 // TODO(yusufo): Remove this once the compositor code is |
| 43 // refactored to use a unified system. | 54 // refactored to use a unified system. |
| 44 jlong GetUIResourceProvider(JNIEnv* env, jobject obj); | 55 jlong GetUIResourceProvider(JNIEnv* env, |
| 56 const base::android::JavaParamRef<jobject>& obj); |
| 45 | 57 |
| 46 // CompositorClient implementation | 58 // CompositorClient implementation |
| 47 void UpdateLayerTreeHost() override; | 59 void UpdateLayerTreeHost() override; |
| 48 void OnSwapBuffersCompleted(int pending_swap_buffers) override; | 60 void OnSwapBuffersCompleted(int pending_swap_buffers) override; |
| 49 | 61 |
| 50 private: | 62 private: |
| 51 ~ContentViewRenderView() override; | 63 ~ContentViewRenderView() override; |
| 52 | 64 |
| 53 void InitCompositor(); | 65 void InitCompositor(); |
| 54 | 66 |
| 55 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 67 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 56 | 68 |
| 57 scoped_ptr<content::Compositor> compositor_; | 69 scoped_ptr<content::Compositor> compositor_; |
| 58 | 70 |
| 59 gfx::NativeWindow root_window_; | 71 gfx::NativeWindow root_window_; |
| 60 int current_surface_format_; | 72 int current_surface_format_; |
| 61 | 73 |
| 62 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); | 74 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); |
| 63 }; | 75 }; |
| 64 | 76 |
| 65 | 77 |
| 66 | 78 |
| 67 } | 79 } |
| 68 | 80 |
| 69 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 81 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| OLD | NEW |