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

Side by Side 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: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
27 // BrowserViewRenderer overrides 31 // BrowserViewRenderer overrides
32 virtual void SetContents(
33 content::ContentViewCore* content_view_core) OVERRIDE;
28 virtual void BindSynchronousCompositor( 34 virtual void BindSynchronousCompositor(
29 content::SynchronousCompositor* compositor) OVERRIDE; 35 content::SynchronousCompositor* compositor) OVERRIDE;
30 virtual bool RenderPicture(SkCanvas* canvas) OVERRIDE; 36 virtual void DrawGL(AwDrawGLInfo* draw_info) OVERRIDE;
37 virtual void SetScrollForHWFrame(int x, int y) OVERRIDE;
38 virtual bool DrawSW(jobject java_canvas,
39 const gfx::Rect& clip_bounds) OVERRIDE;
40 virtual base::android::ScopedJavaLocalRef<jobject> CapturePicture() OVERRIDE;
41 virtual void EnableOnNewPicture(OnNewPictureMode mode) OVERRIDE;
42 virtual void OnVisibilityChanged(
43 bool view_visible, bool window_visible) OVERRIDE;
44 virtual void OnSizeChanged(int width, int height) OVERRIDE;
45 virtual void OnAttachedToWindow(int width, int height) OVERRIDE;
46 virtual void OnDetachedFromWindow() OVERRIDE;
47 virtual bool IsAttachedToWindow() OVERRIDE;
48 virtual bool IsViewVisible() OVERRIDE;
49 virtual gfx::Rect GetScreenRect() OVERRIDE;
31 50
32 // SynchronousCompositorClient overrides 51 // SynchronousCompositorClient overrides
33 virtual void DidDestroyCompositor( 52 virtual void DidDestroyCompositor(
34 content::SynchronousCompositor* compositor) OVERRIDE; 53 content::SynchronousCompositor* compositor) OVERRIDE;
54 virtual void SetContinuousInvalidate(bool invalidate) OVERRIDE;
55
56 void WebContentsGone();
35 57
36 private: 58 private:
59 void Invalidate();
60 bool RenderPicture(SkCanvas* canvas);
61
62 content::WebContents* web_contents_;
37 content::SynchronousCompositor* compositor_; 63 content::SynchronousCompositor* compositor_;
64 BrowserViewRenderer::Client* client_;
65
66 bool view_visible_;
67 bool about_to_hardware_draw_;
68 bool continuous_invalidate_;
69
70 // Used only for detecting Android View System context changes.
71 // Not to be used between draw calls.
72 EGLContext last_frame_context_;
38 73
39 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer); 74 DISALLOW_COPY_AND_ASSIGN(InProcessViewRenderer);
40 }; 75 };
41 76
42 } // namespace android_webview 77 } // namespace android_webview
43 78
44 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_ 79 #endif // ANDROID_WEBVIEW_BROWSER_IN_PROCESS_IN_PROCESS_VIEW_RENDERER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698