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

Side by Side Diff: android_webview/browser/browser_view_renderer.h

Issue 950973003: Remove android_webview/browser layer's dependency on native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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
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_BROWSER_VIEW_RENDERER_H_ 5 #ifndef ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 6 #define ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
7 7
8 #include "android_webview/browser/parent_compositor_draw_constraints.h" 8 #include "android_webview/browser/parent_compositor_draw_constraints.h"
9 #include "android_webview/browser/shared_renderer_state.h" 9 #include "android_webview/browser/shared_renderer_state.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/cancelable_callback.h" 11 #include "base/cancelable_callback.h"
12 #include "base/trace_event/trace_event.h" 12 #include "base/trace_event/trace_event.h"
13 #include "content/public/browser/android/synchronous_compositor.h" 13 #include "content/public/browser/android/synchronous_compositor.h"
14 #include "content/public/browser/android/synchronous_compositor_client.h" 14 #include "content/public/browser/android/synchronous_compositor_client.h"
15 #include "ui/gfx/geometry/rect.h" 15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/vector2d_f.h" 16 #include "ui/gfx/geometry/vector2d_f.h"
17 17
18 class SkCanvas; 18 class SkCanvas;
19 class SkPicture; 19 class SkPicture;
20 20
21 namespace content {
22 class WebContents;
23 }
24
21 namespace android_webview { 25 namespace android_webview {
22 26
23 class BrowserViewRendererClient; 27 class BrowserViewRendererClient;
24 28
25 // Interface for all the WebView-specific content rendering operations. 29 // Interface for all the WebView-specific content rendering operations.
26 // Provides software and hardware rendering and the Capture Picture API. 30 // Provides software and hardware rendering and the Capture Picture API.
27 class BrowserViewRenderer : public content::SynchronousCompositorClient { 31 class BrowserViewRenderer : public content::SynchronousCompositorClient {
28 public: 32 public:
29 static void CalculateTileMemoryPolicy(); 33 static void CalculateTileMemoryPolicy();
34 static BrowserViewRenderer* FromWebContents(
35 content::WebContents* web_contents);
30 36
31 BrowserViewRenderer( 37 BrowserViewRenderer(
32 BrowserViewRendererClient* client, 38 BrowserViewRendererClient* client,
33 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner); 39 const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner);
34 40
35 ~BrowserViewRenderer() override; 41 ~BrowserViewRenderer() override;
36 42
43 void RegisterWithWebContents(content::WebContents* web_contents);
44
37 SharedRendererState* GetAwDrawGLViewContext(); 45 SharedRendererState* GetAwDrawGLViewContext();
38 bool RequestDrawGL(bool wait_for_completion); 46 bool RequestDrawGL(bool wait_for_completion);
39 47
40 // Called before either OnDrawHardware or OnDrawSoftware to set the view 48 // Called before either OnDrawHardware or OnDrawSoftware to set the view
41 // state of this frame. |scroll| is the view's current scroll offset. 49 // state of this frame. |scroll| is the view's current scroll offset.
42 // |global_visible_rect| is the intersection of the view size and the window 50 // |global_visible_rect| is the intersection of the view size and the window
43 // in window coordinates. 51 // in window coordinates.
44 void PrepareToDraw(const gfx::Vector2d& scroll, 52 void PrepareToDraw(const gfx::Vector2d& scroll,
45 const gfx::Rect& global_visible_rect); 53 const gfx::Rect& global_visible_rect);
46 54
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // visible skew (especially noticeable when scrolling up and down in the same 200 // visible skew (especially noticeable when scrolling up and down in the same
193 // spot over a period of time). 201 // spot over a period of time).
194 gfx::Vector2dF overscroll_rounding_error_; 202 gfx::Vector2dF overscroll_rounding_error_;
195 203
196 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); 204 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer);
197 }; 205 };
198 206
199 } // namespace android_webview 207 } // namespace android_webview
200 208
201 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 209 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
OLDNEW
« no previous file with comments | « android_webview/browser/aw_dev_tools_manager_delegate.cc ('k') | android_webview/browser/browser_view_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698