Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(620)

Side by Side Diff: content/browser/android/content_view_render_view.h

Issue 26753005: Adding compositor callbacks to RenderWidgetHostViewAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed blank lines Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 13
14 namespace content { 14 namespace content {
15 class Compositor; 15 class Compositor;
16 16
17 class ContentViewRenderView : public CompositorClient { 17 class ContentViewRenderView : public CompositorClient {
18 public: 18 public:
19 // Registers the JNI methods for ContentViewRender. 19 // Registers the JNI methods for ContentViewRender.
20 static bool RegisterContentViewRenderView(JNIEnv* env); 20 static bool RegisterContentViewRenderView(JNIEnv* env);
21 21
22 ContentViewRenderView(JNIEnv* env, jobject obj); 22 ContentViewRenderView(JNIEnv* env, jobject obj);
23 23
24 // Methods called from Java via JNI ----------------------------------------- 24 // Methods called from Java via JNI -----------------------------------------
25 void Destroy(JNIEnv* env, jobject obj); 25 void Destroy(JNIEnv* env, jobject obj);
26 void SetCurrentContentView(JNIEnv* env, jobject obj, int native_content_view); 26 void SetCurrentContentView(JNIEnv* env, jobject obj, int native_content_view);
27 void RemovePreviousContentView(JNIEnv* env,
28 jobject obj,
29 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 34
32 // CompositorClient --------------------------------------------------------- 35 // CompositorClient ---------------------------------------------------------
33 virtual void ScheduleComposite() OVERRIDE; 36 virtual void ScheduleComposite() OVERRIDE;
34 virtual void OnSwapBuffersPosted() OVERRIDE; 37 virtual void OnSwapBuffersPosted() OVERRIDE;
35 virtual void OnSwapBuffersCompleted() OVERRIDE; 38 virtual void OnSwapBuffersCompleted() OVERRIDE;
36 39
37 private: 40 private:
38 virtual ~ContentViewRenderView(); 41 virtual ~ContentViewRenderView();
39 42
40 void InitCompositor(); 43 void InitCompositor();
41 44
42 bool buffers_swapped_during_composite_; 45 bool buffers_swapped_during_composite_;
43 46
44 base::android::ScopedJavaGlobalRef<jobject> java_obj_; 47 base::android::ScopedJavaGlobalRef<jobject> java_obj_;
45 48
46 scoped_ptr<content::Compositor> compositor_; 49 scoped_ptr<content::Compositor> compositor_;
47 50
48 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView); 51 DISALLOW_COPY_AND_ASSIGN(ContentViewRenderView);
49 }; 52 };
50 53
51 54
52 55
53 } 56 }
54 57
55 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_ 58 #endif // CONTENT_BROWSER_ANDROID_CONTENT_VIEW_RENDER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698