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

Unified Diff: android_webview/browser/browser_view_renderer.h

Issue 1816283005: Move SharedRendererState ownership to AwContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Begin to disentangle SRS and BVR Created 4 years, 9 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/browser_view_renderer.h
diff --git a/android_webview/browser/browser_view_renderer.h b/android_webview/browser/browser_view_renderer.h
index 60ba7022ef9eca48189e86e11bcd656e018c85c4..cfd79e956894ace67714fe79f3d9000afb84f484 100644
--- a/android_webview/browser/browser_view_renderer.h
+++ b/android_webview/browser/browser_view_renderer.h
@@ -51,6 +51,7 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
void RegisterWithWebContents(content::WebContents* web_contents);
+ void SetSharedRendererState(SharedRendererState* shared_renderer_state);
SharedRendererState* GetAwDrawGLViewContext();
bool RequestDrawGL(bool wait_for_completion);
@@ -63,7 +64,8 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
// Main handlers for view drawing. A false return value indicates no new
// frame is produced.
- bool OnDrawHardware();
+ scoped_ptr<ChildFrame> OnDrawHardware(
+ const ParentCompositorDrawConstraints& parent_draw_constraints);
bool OnDrawSoftware(SkCanvas* canvas);
// CapturePicture API methods.
@@ -73,6 +75,9 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
void ClearView();
void SetOffscreenPreRaster(bool enabled);
+ bool offscreen_pre_raster() {
+ return offscreen_pre_raster_;
+ }
// View update notifications.
void SetIsPaused(bool paused);
@@ -97,7 +102,6 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
bool attached_to_window() const { return attached_to_window_; }
bool hardware_enabled() const { return hardware_enabled_; }
gfx::Size size() const { return size_; }
- void ReleaseHardware();
bool IsClientVisible() const;
void TrimMemory(const int level, const bool visible);
@@ -123,6 +127,18 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
void UpdateParentDrawConstraints();
void DetachFunctorFromView();
+ gfx::Vector2d last_on_draw_scroll_offset() {
boliu 2016/03/23 20:42:32 I was wrong. last_on_draw_scroll_offset_ can be re
Tobias Sargeant 2016/03/24 16:53:05 Done.
+ return last_on_draw_scroll_offset_;
+ }
+
+ gfx::Rect GetInterestRect(bool is_layer) const;
+ void UpdateMemoryPolicy(gfx::Rect interest_rect);
boliu 2016/03/23 20:42:32 GetInterestRect and UpdateMemoryPolicy can be merg
boliu 2016/03/23 20:46:11 As in SetParentDrawConstraints will also do the Up
+
+ void ReturnUnusedResource(scoped_ptr<ChildFrame> frame);
+ void ReturnResourceFromParent(uint32_t compositor_id,
+ uint32_t output_surface_id,
+ cc::ReturnedResourceArray* resources);
+
private:
void SetTotalRootLayerScrollOffset(const gfx::Vector2dF& new_value_dip);
bool CanOnDraw();
@@ -132,20 +148,15 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
const gfx::Vector2dF& total_scroll_offset_dip,
const gfx::SizeF& scrollable_size_dip);
- void ReturnUnusedResource(scoped_ptr<ChildFrame> frame);
- void ReturnResourceFromParent();
-
gfx::Vector2d max_scroll_offset() const;
- void UpdateMemoryPolicy();
-
uint32_t GetCompositorID(content::SynchronousCompositor* compositor);
// For debug tracing or logging. Return the string representation of this
// view renderer's state.
std::string ToString() const;
BrowserViewRendererClient* client_;
- SharedRendererState shared_renderer_state_;
+ SharedRendererState* shared_renderer_state_;
boliu 2016/03/23 20:42:32 should remove this from this patch, only one usage
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
bool disable_page_visibility_;
@@ -186,7 +197,8 @@ class BrowserViewRenderer : public content::SynchronousCompositorClient {
gfx::Vector2dF max_scroll_offset_dip_;
// Used to prevent rounding errors from accumulating enough to generate
- // visible skew (especially noticeable when scrolling up and down in the same
+ // visible skew (especially noticeable when scrolling up and down in the
+ // same
boliu 2016/03/23 20:42:32 undo this change
Tobias Sargeant 2016/03/24 16:53:05 Done.
// spot over a period of time).
// TODO(miletus): Make overscroll_rounding_error_ a gfx::ScrollOffset.
gfx::Vector2dF overscroll_rounding_error_;
« no previous file with comments | « no previous file | android_webview/browser/browser_view_renderer.cc » ('j') | android_webview/browser/browser_view_renderer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698