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_BROWSER_VIEW_RENDERER_IMPL_H_ | 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_IMPL_H_ |
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_IMPL_H_ | 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_IMPL_H_ |
7 | 7 |
8 #include "android_webview/browser/browser_view_renderer.h" | 8 #include "android_webview/browser/browser_view_renderer.h" |
9 #include "android_webview/browser/renderer_host/view_renderer_host.h" | 9 #include "android_webview/browser/renderer_host/view_renderer_host.h" |
10 #include "content/public/browser/android/compositor.h" | 10 #include "content/public/browser/android/compositor.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE; | 50 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE; |
51 virtual void SetScrollForHWFrame(int x, int y) OVERRIDE; | 51 virtual void SetScrollForHWFrame(int x, int y) OVERRIDE; |
52 virtual bool DrawSW(jobject java_canvas, const gfx::Rect& clip) OVERRIDE; | 52 virtual bool DrawSW(jobject java_canvas, const gfx::Rect& clip) OVERRIDE; |
53 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE; | 53 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE; |
54 virtual void EnableOnNewPicture(OnNewPictureMode mode) OVERRIDE; | 54 virtual void EnableOnNewPicture(OnNewPictureMode mode) OVERRIDE; |
55 virtual void OnVisibilityChanged( | 55 virtual void OnVisibilityChanged( |
56 bool view_visible, bool window_visible) OVERRIDE; | 56 bool view_visible, bool window_visible) OVERRIDE; |
57 virtual void OnSizeChanged(int width, int height) OVERRIDE; | 57 virtual void OnSizeChanged(int width, int height) OVERRIDE; |
58 virtual void OnAttachedToWindow(int width, int height) OVERRIDE; | 58 virtual void OnAttachedToWindow(int width, int height) OVERRIDE; |
59 virtual void OnDetachedFromWindow() OVERRIDE; | 59 virtual void OnDetachedFromWindow() OVERRIDE; |
| 60 virtual bool IsAttachedToWindow() OVERRIDE; |
| 61 virtual bool IsViewVisible() OVERRIDE; |
| 62 virtual gfx::Rect GetScreenRect() OVERRIDE; |
60 | 63 |
61 // content::Compositor::Client implementation. | 64 // content::Compositor::Client implementation. |
62 virtual void ScheduleComposite() OVERRIDE; | 65 virtual void ScheduleComposite() OVERRIDE; |
63 | 66 |
64 // ViewRendererHost::Client implementation. | 67 // ViewRendererHost::Client implementation. |
65 virtual void OnPictureUpdated(int process_id, int render_view_id) OVERRIDE; | 68 virtual void OnPictureUpdated(int process_id, int render_view_id) OVERRIDE; |
66 | 69 |
67 protected: | 70 protected: |
68 BrowserViewRendererImpl(BrowserViewRenderer::Client* client, | 71 BrowserViewRendererImpl(BrowserViewRenderer::Client* client, |
69 JavaHelper* java_helper); | 72 JavaHelper* java_helper); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Applies the transformation matrix. | 106 // Applies the transformation matrix. |
104 scoped_refptr<cc::Layer> transform_layer_; | 107 scoped_refptr<cc::Layer> transform_layer_; |
105 | 108 |
106 // Ensures content is drawn within the scissor clip rect provided by the | 109 // Ensures content is drawn within the scissor clip rect provided by the |
107 // Android framework. | 110 // Android framework. |
108 scoped_refptr<cc::Layer> scissor_clip_layer_; | 111 scoped_refptr<cc::Layer> scissor_clip_layer_; |
109 | 112 |
110 // Last View scroll before hardware rendering is triggered. | 113 // Last View scroll before hardware rendering is triggered. |
111 gfx::Point hw_rendering_scroll_; | 114 gfx::Point hw_rendering_scroll_; |
112 | 115 |
| 116 bool view_attached_; |
113 bool view_visible_; | 117 bool view_visible_; |
114 bool compositor_visible_; | 118 bool compositor_visible_; |
115 bool is_composite_pending_; | 119 bool is_composite_pending_; |
116 float dpi_scale_; | 120 float dpi_scale_; |
117 float page_scale_; | 121 float page_scale_; |
118 gfx::Size view_size_; | 122 gfx::Size view_size_; |
119 gfx::SizeF content_size_css_; | 123 gfx::SizeF content_size_css_; |
120 OnNewPictureMode on_new_picture_mode_; | 124 OnNewPictureMode on_new_picture_mode_; |
121 | 125 |
122 // Used only for detecting Android View System context changes. | 126 // Used only for detecting Android View System context changes. |
123 // Not to be used between draw calls. | 127 // Not to be used between draw calls. |
124 EGLContext last_frame_context_; | 128 EGLContext last_frame_context_; |
125 | 129 |
126 // Set via SetContents. Used to recognize updates to the local WebView. | 130 // Set via SetContents. Used to recognize updates to the local WebView. |
127 content::WebContents* web_contents_; | 131 content::WebContents* web_contents_; |
128 | 132 |
129 // Used to observe frame metadata updates. | 133 // Used to observe frame metadata updates. |
130 content::ContentViewCore::UpdateFrameInfoCallback update_frame_info_callback_; | 134 content::ContentViewCore::UpdateFrameInfoCallback update_frame_info_callback_; |
131 | 135 |
132 DISALLOW_COPY_AND_ASSIGN(BrowserViewRendererImpl); | 136 DISALLOW_COPY_AND_ASSIGN(BrowserViewRendererImpl); |
133 }; | 137 }; |
134 | 138 |
135 } // namespace android_webview | 139 } // namespace android_webview |
136 | 140 |
137 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_IMPL_H_ | 141 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_IMPL_H_ |
OLD | NEW |