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

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

Issue 1943963003: WIP Handle AwContents needing multiple live functors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
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 <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
11 #include <set>
11 12
12 #include "android_webview/browser/compositor_frame_producer.h" 13 #include "android_webview/browser/compositor_frame_producer.h"
13 #include "android_webview/browser/parent_compositor_draw_constraints.h" 14 #include "android_webview/browser/parent_compositor_draw_constraints.h"
14 #include "base/callback.h" 15 #include "base/callback.h"
15 #include "base/cancelable_callback.h" 16 #include "base/cancelable_callback.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/trace_event/trace_event.h" 18 #include "base/trace_event/trace_event.h"
18 #include "content/public/browser/android/synchronous_compositor.h" 19 #include "content/public/browser/android/synchronous_compositor.h"
19 #include "content/public/browser/android/synchronous_compositor_client.h" 20 #include "content/public/browser/android/synchronous_compositor_client.h"
20 #include "third_party/skia/include/core/SkRefCnt.h" 21 #include "third_party/skia/include/core/SkRefCnt.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 const gfx::Vector2dF& max_scroll_offset_dip, 118 const gfx::Vector2dF& max_scroll_offset_dip,
118 const gfx::SizeF& scrollable_size_dip, 119 const gfx::SizeF& scrollable_size_dip,
119 float page_scale_factor, 120 float page_scale_factor,
120 float min_page_scale_factor, 121 float min_page_scale_factor,
121 float max_page_scale_factor) override; 122 float max_page_scale_factor) override;
122 void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll, 123 void DidOverscroll(const gfx::Vector2dF& accumulated_overscroll,
123 const gfx::Vector2dF& latest_overscroll_delta, 124 const gfx::Vector2dF& latest_overscroll_delta,
124 const gfx::Vector2dF& current_fling_velocity) override; 125 const gfx::Vector2dF& current_fling_velocity) override;
125 126
126 // CompositorFrameProducer overrides 127 // CompositorFrameProducer overrides
127 void OnParentDrawConstraintsUpdated() override; 128 void OnParentDrawConstraintsUpdated(
128 void OnCompositorFrameConsumerWillDestroy() override; 129 CompositorFrameConsumer* compositor_frame_consumer) override;
130 void RemoveCompositorFrameConsumer(
131 CompositorFrameConsumer* compositor_frame_consumer) override;
129 132
130 private: 133 private:
131 void SetTotalRootLayerScrollOffset(const gfx::Vector2dF& new_value_dip); 134 void SetTotalRootLayerScrollOffset(const gfx::Vector2dF& new_value_dip);
132 bool CanOnDraw(); 135 bool CanOnDraw();
133 void UpdateCompositorIsActive(); 136 void UpdateCompositorIsActive();
134 bool CompositeSW(SkCanvas* canvas); 137 bool CompositeSW(SkCanvas* canvas);
135 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> 138 std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
136 RootLayerStateAsValue(const gfx::Vector2dF& total_scroll_offset_dip, 139 RootLayerStateAsValue(const gfx::Vector2dF& total_scroll_offset_dip,
137 const gfx::SizeF& scrollable_size_dip); 140 const gfx::SizeF& scrollable_size_dip);
138 141
139 void ReturnUnusedResource(std::unique_ptr<ChildFrame> frame); 142 void ReturnUnusedResource(std::unique_ptr<ChildFrame> frame);
140 void ReturnResourceFromParent( 143 void ReturnResourceFromParent(
141 CompositorFrameConsumer* compositor_frame_consumer); 144 CompositorFrameConsumer* compositor_frame_consumer);
142 void ReleaseHardware(); 145 void ReleaseHardware();
143 146
144 gfx::Vector2d max_scroll_offset() const; 147 gfx::Vector2d max_scroll_offset() const;
145 148
146 void UpdateMemoryPolicy(); 149 void UpdateMemoryPolicy();
147 150
148 uint32_t GetCompositorID(content::SynchronousCompositor* compositor); 151 uint32_t GetCompositorID(content::SynchronousCompositor* compositor);
149 // For debug tracing or logging. Return the string representation of this 152 // For debug tracing or logging. Return the string representation of this
150 // view renderer's state. 153 // view renderer's state.
151 std::string ToString() const; 154 std::string ToString() const;
152 155
153 BrowserViewRendererClient* const client_; 156 BrowserViewRendererClient* const client_;
154 const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; 157 const scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
155 CompositorFrameConsumer* compositor_frame_consumer_; 158 CompositorFrameConsumer* current_compositor_frame_consumer_;
159 std::set<CompositorFrameConsumer*> compositor_frame_consumers_;
156 160
157 // The current compositor that's owned by the current RVH. 161 // The current compositor that's owned by the current RVH.
158 content::SynchronousCompositor* compositor_; 162 content::SynchronousCompositor* compositor_;
159 // A map from compositor's per-WebView unique ID to the compositor's raw 163 // A map from compositor's per-WebView unique ID to the compositor's raw
160 // pointer. A raw pointer here is fine because the entry will be erased when 164 // pointer. A raw pointer here is fine because the entry will be erased when
161 // a compositor is destroyed. 165 // a compositor is destroyed.
162 std::map<size_t, content::SynchronousCompositor*> compositor_map_; 166 std::map<size_t, content::SynchronousCompositor*> compositor_map_;
163 167
164 bool is_paused_; 168 bool is_paused_;
165 bool view_visible_; 169 bool view_visible_;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 uint32_t next_compositor_id_; 203 uint32_t next_compositor_id_;
200 204
201 ParentCompositorDrawConstraints external_draw_constraints_; 205 ParentCompositorDrawConstraints external_draw_constraints_;
202 206
203 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer); 207 DISALLOW_COPY_AND_ASSIGN(BrowserViewRenderer);
204 }; 208 };
205 209
206 } // namespace android_webview 210 } // namespace android_webview
207 211
208 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_ 212 #endif // ANDROID_WEBVIEW_BROWSER_BROWSER_VIEW_RENDERER_H_
OLDNEW
« 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