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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.h

Issue 457913002: Android WebView: flush input events during onVSync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: subscriberTypes + postInvalidate during VSync Created 6 years, 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 10
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 void SetOverlayVideoMode(bool enabled); 241 void SetOverlayVideoMode(bool enabled);
242 242
243 typedef base::Callback< 243 typedef base::Callback<
244 void(const base::string16& content, int start_offset, int end_offset)> 244 void(const base::string16& content, int start_offset, int end_offset)>
245 TextSurroundingSelectionCallback; 245 TextSurroundingSelectionCallback;
246 void SetTextSurroundingSelectionCallback( 246 void SetTextSurroundingSelectionCallback(
247 const TextSurroundingSelectionCallback& callback); 247 const TextSurroundingSelectionCallback& callback);
248 248
249 private: 249 private:
250 enum VSyncSubscriberType {
251 INPUT = 1,
252 BEGIN_FRAME = 2
boliu 2014/08/20 02:54:17 ehh, 1 << 0, 1 << 1, 1 << 2....
hush (inactive) 2014/08/20 03:47:21 Done.
253 // Next Type will be 4 because VSyncSubscriberType is used in a bit field.
254 };
255
250 // TouchSelectionControllerClient implementation. 256 // TouchSelectionControllerClient implementation.
251 virtual bool SupportsAnimation() const OVERRIDE; 257 virtual bool SupportsAnimation() const OVERRIDE;
252 virtual void SetNeedsAnimate() OVERRIDE; 258 virtual void SetNeedsAnimate() OVERRIDE;
253 virtual void MoveCaret(const gfx::PointF& position) OVERRIDE; 259 virtual void MoveCaret(const gfx::PointF& position) OVERRIDE;
254 virtual void SelectBetweenCoordinates(const gfx::PointF& start, 260 virtual void SelectBetweenCoordinates(const gfx::PointF& start,
255 const gfx::PointF& end) OVERRIDE; 261 const gfx::PointF& end) OVERRIDE;
256 virtual void OnSelectionEvent(SelectionEventType event, 262 virtual void OnSelectionEvent(SelectionEventType event,
257 const gfx::PointF& anchor_position) OVERRIDE; 263 const gfx::PointF& anchor_position) OVERRIDE;
258 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE; 264 virtual scoped_ptr<TouchHandleDrawable> CreateDrawable() OVERRIDE;
259 265
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 void InternalSwapCompositorFrame(uint32 output_surface_id, 316 void InternalSwapCompositorFrame(uint32 output_surface_id,
311 scoped_ptr<cc::CompositorFrame> frame); 317 scoped_ptr<cc::CompositorFrame> frame);
312 318
313 bool Animate(base::TimeTicks frame_time); 319 bool Animate(base::TimeTicks frame_time);
314 320
315 void OnContentScrollingChange(); 321 void OnContentScrollingChange();
316 bool IsContentScrolling() const; 322 bool IsContentScrolling() const;
317 323
318 float GetDpiScale() const; 324 float GetDpiScale() const;
319 325
326 // type is a bit field containing one or more VSyncSubscriberType.
327 void SubscribeToVSync(int type);
328
320 // The model object. 329 // The model object.
321 RenderWidgetHostImpl* host_; 330 RenderWidgetHostImpl* host_;
322 331
323 // Used to track whether this render widget needs a BeginFrame. 332 // Used to track whether this render widget needs a BeginFrame.
324 bool needs_begin_frame_; 333 bool needs_begin_frame_;
325 334
326 bool is_showing_; 335 bool is_showing_;
327 336
328 // ContentViewCoreImpl is our interface to the view system. 337 // ContentViewCoreImpl is our interface to the view system.
329 ContentViewCoreImpl* content_view_core_; 338 ContentViewCoreImpl* content_view_core_;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 381
373 bool flush_input_requested_; 382 bool flush_input_requested_;
374 383
375 int accelerated_surface_route_id_; 384 int accelerated_surface_route_id_;
376 385
377 // Size to use if we have no backing ContentViewCore 386 // Size to use if we have no backing ContentViewCore
378 gfx::Size default_size_; 387 gfx::Size default_size_;
379 388
380 const bool using_synchronous_compositor_; 389 const bool using_synchronous_compositor_;
381 390
391 int vsync_subscribers_;
boliu 2014/08/20 02:54:16 use uint32 or something, to specificy the number o
hush (inactive) 2014/08/20 03:47:21 Done.
392
382 scoped_ptr<DelegatedFrameEvictor> frame_evictor_; 393 scoped_ptr<DelegatedFrameEvictor> frame_evictor_;
383 394
384 size_t locks_on_frame_count_; 395 size_t locks_on_frame_count_;
385 bool observing_root_window_; 396 bool observing_root_window_;
386 397
387 struct LastFrameInfo { 398 struct LastFrameInfo {
388 LastFrameInfo(uint32 output_id, 399 LastFrameInfo(uint32 output_id,
389 scoped_ptr<cc::CompositorFrame> output_frame); 400 scoped_ptr<cc::CompositorFrame> output_frame);
390 ~LastFrameInfo(); 401 ~LastFrameInfo();
391 uint32 output_surface_id; 402 uint32 output_surface_id;
392 scoped_ptr<cc::CompositorFrame> frame; 403 scoped_ptr<cc::CompositorFrame> frame;
393 }; 404 };
394 405
395 scoped_ptr<LastFrameInfo> last_frame_info_; 406 scoped_ptr<LastFrameInfo> last_frame_info_;
396 407
397 TextSurroundingSelectionCallback text_surrounding_selection_callback_; 408 TextSurroundingSelectionCallback text_surrounding_selection_callback_;
398 409
399 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid); 410 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewAndroid);
400 }; 411 };
401 412
402 } // namespace content 413 } // namespace content
403 414
404 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_ 415 #endif // CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698