| 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_helper.h" | 8 #include "base/android/jni_helper.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 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 class Compositor; | 16 class Compositor; |
| 16 | 17 |
| 17 class ContentViewRenderView : public CompositorClient { | 18 class ContentViewRenderView : public CompositorClient { |
| 18 public: | 19 public: |
| 19 // Registers the JNI methods for ContentViewRender. | 20 // Registers the JNI methods for ContentViewRender. |
| 20 static bool RegisterContentViewRenderView(JNIEnv* env); | 21 static bool RegisterContentViewRenderView(JNIEnv* env); |
| 21 | 22 |
| 22 ContentViewRenderView(JNIEnv* env, jobject obj); | 23 ContentViewRenderView(JNIEnv* env, |
| 24 jobject obj, |
| 25 gfx::NativeWindow root_window); |
| 23 | 26 |
| 24 // Methods called from Java via JNI ----------------------------------------- | 27 // Methods called from Java via JNI ----------------------------------------- |
| 25 void Destroy(JNIEnv* env, jobject obj); | 28 void Destroy(JNIEnv* env, jobject obj); |
| 26 void SetCurrentContentView(JNIEnv* env, jobject obj, int native_content_view); | 29 void SetCurrentContentView(JNIEnv* env, jobject obj, int native_content_view); |
| 27 void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface); | 30 void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface); |
| 28 void SurfaceDestroyed(JNIEnv* env, jobject obj); | 31 void SurfaceDestroyed(JNIEnv* env, jobject obj); |
| 29 void SurfaceSetSize(JNIEnv* env, jobject obj, jint width, jint height); | 32 void SurfaceSetSize(JNIEnv* env, jobject obj, jint width, jint height); |
| 30 jboolean Composite(JNIEnv* env, jobject obj); | 33 jboolean Composite(JNIEnv* env, jobject obj); |
| 31 jboolean CompositeToBitmap(JNIEnv* env, jobject obj, jobject java_bitmap); | 34 jboolean CompositeToBitmap(JNIEnv* env, jobject obj, jobject java_bitmap); |
| 32 | 35 |
| 33 // CompositorClient --------------------------------------------------------- | 36 // CompositorClient --------------------------------------------------------- |
| 34 virtual void ScheduleComposite() OVERRIDE; | 37 virtual void ScheduleComposite() OVERRIDE; |
| 35 virtual void OnSwapBuffersPosted() OVERRIDE; | 38 virtual void OnSwapBuffersPosted() OVERRIDE; |
| 36 virtual void OnSwapBuffersCompleted() OVERRIDE; | 39 virtual void OnSwapBuffersCompleted() OVERRIDE; |
| 37 | 40 |
| 38 private: | 41 private: |
| 39 virtual ~ContentViewRenderView(); | 42 virtual ~ContentViewRenderView(); |
| 40 | 43 |
| 41 void InitCompositor(); | 44 void InitCompositor(); |
| 42 | 45 |
| 43 bool buffers_swapped_during_composite_; | 46 bool buffers_swapped_during_composite_; |
| 44 | 47 |
| 45 base::android::ScopedJavaGlobalRef<jobject> java_obj_; | 48 base::android::ScopedJavaGlobalRef<jobject> java_obj_; |
| 46 | 49 |
| 47 scoped_ptr<content::Compositor> compositor_; | 50 scoped_ptr<content::Compositor> compositor_; |
| 48 | 51 |
| 52 gfx::NativeWindow root_window_; |
| 53 |
| 49 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); | 54 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); |
| 50 }; | 55 }; |
| 51 | 56 |
| 52 | 57 |
| 53 | 58 |
| 54 } | 59 } |
| 55 | 60 |
| 56 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ | 61 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ |
| OLD | NEW |