Index: android_webview/native/aw_contents.h |
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h |
index c2b7e499f6244c9cdd1e21b8043a669ec64df807..4b67bef0a1dac260fe46afc7faf84247e649317b 100644 |
--- a/android_webview/native/aw_contents.h |
+++ b/android_webview/native/aw_contents.h |
@@ -8,28 +8,19 @@ |
#include <jni.h> |
#include <string> |
+#include "android_webview/browser/browser_view_renderer.h" |
#include "android_webview/browser/find_helper.h" |
#include "android_webview/browser/icon_helper.h" |
#include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
-#include "android_webview/public/browser/draw_gl.h" |
#include "base/android/scoped_java_ref.h" |
#include "base/android/jni_helper.h" |
#include "base/memory/scoped_ptr.h" |
-#include "content/public/browser/android/compositor.h" |
#include "content/public/browser/javascript_dialog_manager.h" |
-#include "skia/ext/refptr.h" |
-#include "third_party/skia/include/core/SkPicture.h" |
-typedef void* EGLContext; |
class SkBitmap; |
class TabContents; |
-namespace cc { |
-class Layer; |
-} |
- |
namespace content { |
-class Compositor; |
class WebContents; |
} |
@@ -44,8 +35,7 @@ class AwWebContentsDelegate; |
// level of indirection provided by the AwContentsContainer abstraction. |
class AwContents : public FindHelper::Listener, |
public IconHelper::Listener, |
- public content::Compositor::Client, |
- public AwRenderViewHostExt::Client { |
+ public BrowserViewRenderer::Client { |
public: |
enum OnNewPictureMode { |
kOnNewPictureDisabled = 0, |
@@ -61,15 +51,6 @@ class AwContents : public FindHelper::Listener, |
jobject web_contents_delegate); |
virtual ~AwContents(); |
- void DrawGL(AwDrawGLInfo* draw_info); |
- bool DrawSW(JNIEnv* env, |
- jobject obj, |
- jobject canvas, |
- jint clip_x, |
- jint clip_y, |
- jint clip_w, |
- jint clip_h); |
- |
void RunJavaScriptDialog( |
content::JavaScriptMessageType message_type, |
const GURL& origin_url, |
@@ -116,9 +97,17 @@ class AwContents : public FindHelper::Listener, |
base::android::ScopedJavaLocalRef<jbyteArray> GetOpaqueState( |
JNIEnv* env, jobject obj); |
jboolean RestoreFromOpaqueState(JNIEnv* env, jobject obj, jbyteArray state); |
+ void FocusFirstNode(JNIEnv* env, jobject obj); |
+ bool DrawSW(JNIEnv* env, |
+ jobject obj, |
+ jobject canvas, |
+ jint clip_x, |
+ jint clip_y, |
+ jint clip_w, |
+ jint clip_h); |
void SetScrollForHWFrame(JNIEnv* env, jobject obj, |
int scroll_x, int scroll_y); |
- void FocusFirstNode(JNIEnv* env, jobject obj); |
+ jint GetAwDrawGLViewContext(JNIEnv* env, jobject obj); |
base::android::ScopedJavaLocalRef<jobject> CapturePicture(JNIEnv* env, |
jobject obj); |
void EnableOnNewPicture(JNIEnv* env, |
@@ -138,8 +127,6 @@ class AwContents : public FindHelper::Listener, |
void FindAllAsync(JNIEnv* env, jobject obj, jstring search_string); |
void FindNext(JNIEnv* env, jobject obj, jboolean forward); |
void ClearMatches(JNIEnv* env, jobject obj); |
- void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); |
- |
FindHelper* GetFindHelper(); |
// FindHelper::Listener implementation. |
@@ -151,29 +138,17 @@ class AwContents : public FindHelper::Listener, |
virtual void OnReceivedTouchIconUrl(const std::string& url, |
const bool precomposed) OVERRIDE; |
- // content::Compositor::Client implementation. |
- virtual void ScheduleComposite() OVERRIDE; |
- virtual void OnSwapBuffersCompleted() OVERRIDE; |
+ // BrowserViewRenderer::Client implementation. |
+ virtual void Invalidate() OVERRIDE; |
+ virtual void OnNewPicture( |
+ const base::android::JavaRef<jobject>& picture) OVERRIDE; |
+ void ClearCache(JNIEnv* env, jobject obj, jboolean include_disk_files); |
void SetPendingWebContentsForPopup(scoped_ptr<content::WebContents> pending); |
jint ReleasePopupWebContents(JNIEnv* env, jobject obj); |
- // AwRenderViewHostExt::Client implementation. |
- virtual void OnPictureUpdated(int process_id, int render_view_id) OVERRIDE; |
- |
- // Returns the latest locally available picture if any. |
- // If none is available will synchronously request the latest one |
- // and block until the result is received. |
- skia::RefPtr<SkPicture> GetLastCapturedPicture(); |
- |
private: |
- void Invalidate(); |
void SetWebContents(content::WebContents* web_contents); |
- void SetCompositorVisibility(bool visible); |
- void ResetCompositor(); |
- void AttachLayerTree(); |
- bool RenderSW(SkCanvas* canvas); |
- bool RenderPicture(SkCanvas* canvas); |
JavaObjectWeakGlobalRef java_ref_; |
scoped_ptr<content::WebContents> web_contents_; |
@@ -182,23 +157,7 @@ class AwContents : public FindHelper::Listener, |
scoped_ptr<FindHelper> find_helper_; |
scoped_ptr<IconHelper> icon_helper_; |
scoped_ptr<content::WebContents> pending_contents_; |
- |
- // Compositor-specific state. |
- scoped_ptr<content::Compositor> compositor_; |
- scoped_refptr<cc::Layer> scissor_clip_layer_; |
- scoped_refptr<cc::Layer> transform_layer_; |
- scoped_refptr<cc::Layer> view_clip_layer_; |
- gfx::Point hw_rendering_scroll_; |
- gfx::Size view_size_; |
- bool view_visible_; |
- bool compositor_visible_; |
- bool is_composite_pending_; |
- float dpi_scale_; |
- OnNewPictureMode on_new_picture_mode_; |
- |
- // Used only for detecting Android View System context changes. |
- // Not to be used between draw calls. |
- EGLContext last_frame_context_; |
+ scoped_ptr<BrowserViewRenderer> browser_view_renderer_; |
DISALLOW_COPY_AND_ASSIGN(AwContents); |
}; |