Chromium Code Reviews| 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" |
| 11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "content/public/browser/android/compositor_client.h" | 12 #include "content/public/browser/android/compositor_client.h" |
| 13 #include "ui/gfx/native_widget_types.h" | 13 #include "ui/gfx/native_widget_types.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 class CopyOutputResult; | |
|
danakj
2014/05/13 23:11:09
oops some leftovers in here... *^^*
danakj
2014/05/13 23:14:04
Fixed.
| |
| 16 class Layer; | 17 class Layer; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 class Compositor; | 21 class Compositor; |
| 21 class LayerTreeBuildHelper; | 22 class LayerTreeBuildHelper; |
| 22 | 23 |
| 23 class ContentViewRenderView : public CompositorClient { | 24 class ContentViewRenderView : public CompositorClient { |
| 24 public: | 25 public: |
| 25 // Registers the JNI methods for ContentViewRender. | 26 // Registers the JNI methods for ContentViewRender. |
| 26 static bool RegisterContentViewRenderView(JNIEnv* env); | 27 static bool RegisterContentViewRenderView(JNIEnv* env); |
| 27 | 28 |
| 28 ContentViewRenderView(JNIEnv* env, | 29 ContentViewRenderView(JNIEnv* env, |
| 29 jobject obj, | 30 jobject obj, |
| 30 gfx::NativeWindow root_window); | 31 gfx::NativeWindow root_window); |
| 31 | 32 |
| 32 // Methods called from Java via JNI ----------------------------------------- | 33 // Methods called from Java via JNI ----------------------------------------- |
| 33 void Destroy(JNIEnv* env, jobject obj); | 34 void Destroy(JNIEnv* env, jobject obj); |
| 34 void SetCurrentContentViewCore(JNIEnv* env, jobject obj, | 35 void SetCurrentContentViewCore(JNIEnv* env, jobject obj, |
| 35 jlong native_content_view_core); | 36 jlong native_content_view_core); |
| 36 void SetLayerTreeBuildHelper( | 37 void SetLayerTreeBuildHelper( |
| 37 JNIEnv* env, jobject obj, jlong native_build_helper); | 38 JNIEnv* env, jobject obj, jlong native_build_helper); |
| 38 void SurfaceCreated(JNIEnv* env, jobject obj); | 39 void SurfaceCreated(JNIEnv* env, jobject obj); |
| 39 void SurfaceDestroyed(JNIEnv* env, jobject obj); | 40 void SurfaceDestroyed(JNIEnv* env, jobject obj); |
| 40 void SurfaceChanged(JNIEnv* env, jobject obj, | 41 void SurfaceChanged(JNIEnv* env, jobject obj, |
| 41 jint format, jint width, jint height, jobject surface); | 42 jint format, jint width, jint height, jobject surface); |
| 42 jboolean Composite(JNIEnv* env, jobject obj); | 43 jboolean Composite(JNIEnv* env, jobject obj); |
| 43 jboolean CompositeToBitmap(JNIEnv* env, jobject obj, jobject java_bitmap); | |
| 44 void SetOverlayVideoMode(JNIEnv* env, jobject obj, bool enabled); | 44 void SetOverlayVideoMode(JNIEnv* env, jobject obj, bool enabled); |
| 45 | 45 |
| 46 // CompositorClient implementation | 46 // CompositorClient implementation |
| 47 virtual void Layout() OVERRIDE; | 47 virtual void Layout() OVERRIDE; |
| 48 virtual void OnSwapBuffersCompleted(int pending_swap_buffers) OVERRIDE; | 48 virtual void OnSwapBuffersCompleted(int pending_swap_buffers) OVERRIDE; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 virtual ~ContentViewRenderView(); | 51 virtual ~ContentViewRenderView(); |
| 52 | 52 |
| 53 void InitCompositor(); | 53 void InitCompositor(); |
| 54 | 54 |
| 55 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 55 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 56 scoped_ptr<LayerTreeBuildHelper> layer_tree_build_helper_; | 56 scoped_ptr<LayerTreeBuildHelper> layer_tree_build_helper_; |
| 57 | 57 |
| 58 scoped_ptr<content::Compositor> compositor_; | 58 scoped_ptr<content::Compositor> compositor_; |
| 59 | 59 |
| 60 gfx::NativeWindow root_window_; | 60 gfx::NativeWindow root_window_; |
| 61 int current_surface_format_; | 61 int current_surface_format_; |
| 62 | 62 |
| 63 base::WeakPtrFactory<ContentViewRenderView> weak_ptr_factory_; | |
| 64 | |
| 63 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); | 65 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); |
| 64 }; | 66 }; |
| 65 | 67 |
| 66 | 68 |
| 67 | 69 |
| 68 } | 70 } |
| 69 | 71 |
| 70 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 72 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| OLD | NEW |