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

Unified Diff: android_webview/browser/in_process_renderer/in_process_view_renderer.h

Issue 14888002: Android WebView Merged-Thread Hardware Draw (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/browser/in_process_renderer/in_process_view_renderer.h
diff --git a/android_webview/browser/in_process_renderer/in_process_view_renderer.h b/android_webview/browser/in_process_renderer/in_process_view_renderer.h
index d2c0c24d1ac27e380765fed9675f27b868760cc7..87322ad12ac106f81cab7cdcaa3c8ed2dc6f32d8 100644
--- a/android_webview/browser/in_process_renderer/in_process_view_renderer.h
+++ b/android_webview/browser/in_process_renderer/in_process_view_renderer.h
@@ -11,30 +11,76 @@
namespace content {
class SynchronousCompositor;
+class WebContents;
}
namespace android_webview {
// Provides RenderViewHost wrapper functionality for sending WebView-specific
// IPC messages to the renderer and from there to WebKit.
-class InProcessViewRenderer : public BrowserViewRendererImpl,
+class InProcessViewRenderer : public BrowserViewRenderer,
public content::SynchronousCompositorClient {
public:
InProcessViewRenderer(BrowserViewRenderer::Client* client,
JavaHelper* java_helper);
virtual ~InProcessViewRenderer();
+ static InProcessViewRenderer* FromWebContents(
+ content::WebContents* contents);
+ static InProcessViewRenderer* FromId(
+ int render_process_id, int render_view_id);
+ void BindSynchronousCompositor(
+ content::SynchronousCompositor* compositor);
+
// BrowserViewRenderer overrides
- virtual void BindSynchronousCompositor(
- content::SynchronousCompositor* compositor) OVERRIDE;
- virtual bool RenderPicture(SkCanvas* canvas) OVERRIDE;
+ virtual void SetContents(
+ content::ContentViewCore* content_view_core) OVERRIDE;
+ virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE;
+ virtual void SetScrollForHWFrame(int x, int y) OVERRIDE;
+ virtual bool DrawSW(jobject java_canvas,
+ const gfx::Rect& clip_bounds) OVERRIDE;
+ virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE;
+ virtual void EnableOnNewPicture(bool enabled) OVERRIDE;
+ virtual void OnVisibilityChanged(
+ bool view_visible, bool window_visible) OVERRIDE;
+ virtual void OnSizeChanged(int width, int height) OVERRIDE;
+ virtual void OnAttachedToWindow(int width, int height) OVERRIDE;
+ virtual void OnDetachedFromWindow() OVERRIDE;
+ virtual bool IsAttachedToWindow() OVERRIDE;
+ virtual bool IsViewVisible() OVERRIDE;
+ virtual gfx::Rect GetScreenRect() OVERRIDE;
// SynchronousCompositorClient overrides
- virtual void DidDestroyCompositor(
+ virtual void DidDestroyCompositor(
content::SynchronousCompositor* compositor) OVERRIDE;
+ virtual void SetContinuousInvalidate(bool invalidate) OVERRIDE;
+
+ void WebContentsGone();
private:
+ void Invalidate();
+ bool RenderPicture(SkCanvas* canvas);
+
+ content::WebContents* web_contents_;
content::SynchronousCompositor* compositor_;
+ BrowserViewRenderer::Client* client_;
+
+ bool view_visible_;
+
+ // Set while inside DrawGL right before vsync so that we do not unnecessarily
+ // trigger invalidates.
+ bool inside_draw_;
+
+ // When true, we should continuously invalidate and keep drawing, for example
+ // to drive animation.
+ bool continuous_invalidate_;
+
+ // Used only for detecting Android View System context changes.
+ // Not to be used between draw calls.
+ EGLContext last_frame_context_;
+
+ // Last View scroll before hardware rendering is triggered.
+ gfx::Point hw_rendering_scroll_;
DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer);
};

Powered by Google App Engine
This is Rietveld 408576698