Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ |
| 6 #define ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ |
| 7 | 7 |
| 8 #include "android_webview/browser/browser_view_renderer_impl.h" | 8 #include "android_webview/browser/browser_view_renderer_impl.h" |
| 9 | 9 |
| 10 #include "content/public/renderer/android/synchronous_compositor_client.h" | 10 #include "content/public/renderer/android/synchronous_compositor_client.h" |
| 11 | 11 |
| 12 namespace content { | 12 namespace content { |
| 13 class SynchronousCompositor; | 13 class SynchronousCompositor; |
| 14 class WebContents; | |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace android_webview { | 17 namespace android_webview { |
| 17 | 18 |
| 18 // Provides RenderViewHost wrapper functionality for sending WebView-specific | 19 // Provides RenderViewHost wrapper functionality for sending WebView-specific |
| 19 // IPC messages to the renderer and from there to WebKit. | 20 // IPC messages to the renderer and from there to WebKit. |
| 20 class InProcessViewRenderer : public BrowserViewRendererImpl, | 21 class InProcessViewRenderer : public BrowserViewRenderer, |
| 21 public content::SynchronousCompositorClient { | 22 public content::SynchronousCompositorClient { |
| 22 public: | 23 public: |
| 23 InProcessViewRenderer(BrowserViewRenderer::Client* client, | 24 InProcessViewRenderer(BrowserViewRenderer::Client* client, |
| 24 JavaHelper* java_helper); | 25 JavaHelper* java_helper); |
| 25 virtual ~InProcessViewRenderer(); | 26 virtual ~InProcessViewRenderer(); |
| 26 | 27 |
| 28 static InProcessViewRenderer* FromWebContents( | |
| 29 content::WebContents* contents); | |
| 30 static InProcessViewRenderer* FromId( | |
| 31 int render_process_id, int render_view_id); | |
| 32 void BindSynchronousCompositor( | |
| 33 content::SynchronousCompositor* compositor); | |
| 34 | |
| 27 // BrowserViewRenderer overrides | 35 // BrowserViewRenderer overrides |
| 28 virtual void BindSynchronousCompositor( | 36 virtual void SetContents( |
| 29 content::SynchronousCompositor* compositor) OVERRIDE; | 37 content::ContentViewCore* content_view_core) OVERRIDE; |
| 30 virtual bool RenderPicture(SkCanvas* canvas) OVERRIDE; | 38 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE; |
| 39 virtual void SetScrollForHWFrame(int x, int y) OVERRIDE; | |
| 40 virtual bool DrawSW(jobject java_canvas, | |
| 41 const gfx::Rect& clip_bounds) OVERRIDE; | |
| 42 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE; | |
| 43 virtual void EnableOnNewPicture(bool enabled) OVERRIDE; | |
| 44 virtual void OnVisibilityChanged( | |
| 45 bool view_visible, bool window_visible) OVERRIDE; | |
| 46 virtual void OnSizeChanged(int width, int height) OVERRIDE; | |
| 47 virtual void OnAttachedToWindow(int width, int height) OVERRIDE; | |
| 48 virtual void OnDetachedFromWindow() OVERRIDE; | |
| 49 virtual bool IsAttachedToWindow() OVERRIDE; | |
| 50 virtual bool IsViewVisible() OVERRIDE; | |
| 51 virtual gfx::Rect GetScreenRect() OVERRIDE; | |
| 31 | 52 |
| 32 // SynchronousCompositorClient overrides | 53 // SynchronousCompositorClient overrides |
| 33 virtual void DidDestroyCompositor( | 54 virtual void DidDestroyCompositor( |
| 34 content::SynchronousCompositor* compositor) OVERRIDE; | 55 content::SynchronousCompositor* compositor) OVERRIDE; |
| 56 virtual void SetContinuousInvalidate(bool invalidate) OVERRIDE; | |
| 57 | |
| 58 void WebContentsGone(); | |
| 35 | 59 |
| 36 private: | 60 private: |
| 61 void Invalidate(); | |
| 62 bool RenderPicture(SkCanvas* canvas); | |
| 63 | |
| 64 content::WebContents* web_contents_; | |
| 37 content::SynchronousCompositor* compositor_; | 65 content::SynchronousCompositor* compositor_; |
| 66 BrowserViewRenderer::Client* client_; | |
| 67 | |
| 68 bool view_visible_; | |
| 69 bool inside_draw_; | |
| 70 bool continuous_invalidate_; | |
|
joth
2013/05/09 10:48:52
comments on these three would be helpful
| |
| 71 | |
| 72 // Used only for detecting Android View System context changes. | |
| 73 // Not to be used between draw calls. | |
| 74 EGLContext last_frame_context_; | |
| 75 | |
| 76 // Last View scroll before hardware rendering is triggered. | |
| 77 gfx::Point hw_rendering_scroll_; | |
| 38 | 78 |
| 39 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); | 79 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); |
| 40 }; | 80 }; |
| 41 | 81 |
| 42 } // namespace android_webview | 82 } // namespace android_webview |
| 43 | 83 |
| 44 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ | 84 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ |
| OLD | NEW |