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

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

Issue 2263043002: android_webview: Let AwContents manage TouchHandleDrawable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DestroyAllDrawables Created 4 years, 3 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 #include "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "cc/surfaces/surface.h" 31 #include "cc/surfaces/surface.h"
32 #include "cc/surfaces/surface_factory.h" 32 #include "cc/surfaces/surface_factory.h"
33 #include "cc/surfaces/surface_id_allocator.h" 33 #include "cc/surfaces/surface_id_allocator.h"
34 #include "cc/surfaces/surface_manager.h" 34 #include "cc/surfaces/surface_manager.h"
35 #include "cc/trees/layer_tree_host.h" 35 #include "cc/trees/layer_tree_host.h"
36 #include "components/display_compositor/gl_helper.h" 36 #include "components/display_compositor/gl_helper.h"
37 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 37 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
38 #include "content/browser/android/composited_touch_handle_drawable.h" 38 #include "content/browser/android/composited_touch_handle_drawable.h"
39 #include "content/browser/android/content_view_core_impl.h" 39 #include "content/browser/android/content_view_core_impl.h"
40 #include "content/browser/android/overscroll_controller_android.h" 40 #include "content/browser/android/overscroll_controller_android.h"
41 #include "content/browser/android/popup_touch_handle_drawable.h"
42 #include "content/browser/android/synchronous_compositor_host.h" 41 #include "content/browser/android/synchronous_compositor_host.h"
43 #include "content/browser/devtools/render_frame_devtools_agent_host.h" 42 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
44 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 43 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
45 #include "content/browser/gpu/compositor_util.h" 44 #include "content/browser/gpu/compositor_util.h"
46 #include "content/browser/gpu/gpu_data_manager_impl.h" 45 #include "content/browser/gpu/gpu_data_manager_impl.h"
47 #include "content/browser/gpu/gpu_process_host_ui_shim.h" 46 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
48 #include "content/browser/media/android/media_web_contents_observer_android.h" 47 #include "content/browser/media/android/media_web_contents_observer_android.h"
49 #include "content/browser/renderer_host/compositor_impl_android.h" 48 #include "content/browser/renderer_host/compositor_impl_android.h"
50 #include "content/browser/renderer_host/dip_util.h" 49 #include "content/browser/renderer_host/dip_util.h"
51 #include "content/browser/renderer_host/frame_metadata_util.h" 50 #include "content/browser/renderer_host/frame_metadata_util.h"
52 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h " 51 #include "content/browser/renderer_host/input/synthetic_gesture_target_android.h "
53 #include "content/browser/renderer_host/input/web_input_event_builders_android.h " 52 #include "content/browser/renderer_host/input/web_input_event_builders_android.h "
54 #include "content/browser/renderer_host/render_process_host_impl.h" 53 #include "content/browser/renderer_host/render_process_host_impl.h"
55 #include "content/browser/renderer_host/render_view_host_impl.h" 54 #include "content/browser/renderer_host/render_view_host_impl.h"
56 #include "content/browser/renderer_host/render_widget_host_impl.h" 55 #include "content/browser/renderer_host/render_widget_host_impl.h"
57 #include "content/common/gpu_host_messages.h" 56 #include "content/common/gpu_host_messages.h"
58 #include "content/common/input_messages.h" 57 #include "content/common/input_messages.h"
59 #include "content/common/view_messages.h" 58 #include "content/common/view_messages.h"
60 #include "content/public/browser/android/compositor.h" 59 #include "content/public/browser/android/compositor.h"
60 #include "content/public/browser/android/synchronous_compositor_client.h"
61 #include "content/public/browser/browser_thread.h" 61 #include "content/public/browser/browser_thread.h"
62 #include "content/public/browser/devtools_agent_host.h" 62 #include "content/public/browser/devtools_agent_host.h"
63 #include "content/public/browser/render_view_host.h" 63 #include "content/public/browser/render_view_host.h"
64 #include "content/public/browser/render_widget_host_iterator.h" 64 #include "content/public/browser/render_widget_host_iterator.h"
65 #include "content/public/common/content_switches.h" 65 #include "content/public/common/content_switches.h"
66 #include "gpu/command_buffer/client/gles2_implementation.h" 66 #include "gpu/command_buffer/client/gles2_implementation.h"
67 #include "gpu/command_buffer/client/gles2_interface.h" 67 #include "gpu/command_buffer/client/gles2_interface.h"
68 #include "gpu/config/gpu_driver_bug_workaround_type.h" 68 #include "gpu/config/gpu_driver_bug_workaround_type.h"
69 #include "ipc/ipc_message_macros.h" 69 #include "ipc/ipc_message_macros.h"
70 #include "ipc/ipc_message_start.h" 70 #include "ipc/ipc_message_start.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 &view_, cached_background_color_, 314 &view_, cached_background_color_,
315 base::Bind(&RenderWidgetHostViewAndroid::ReturnResources, 315 base::Bind(&RenderWidgetHostViewAndroid::ReturnResources,
316 weak_ptr_factory_.GetWeakPtr()))); 316 weak_ptr_factory_.GetWeakPtr())));
317 } 317 }
318 318
319 host_->SetView(this); 319 host_->SetView(this);
320 SetContentViewCore(content_view_core); 320 SetContentViewCore(content_view_core);
321 } 321 }
322 322
323 RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() { 323 RenderWidgetHostViewAndroid::~RenderWidgetHostViewAndroid() {
324 if (using_browser_compositor_ && sync_compositor_) {
325 sync_compositor_->client()->DestroyAllDrawables();
boliu 2016/08/26 20:28:02 this is equivalent to awcontents.destroy (in most
Jinsuk Kim 2016/08/26 22:50:50 Done. Passed the list to popup handle for it to re
326 }
324 if (content_view_core_) 327 if (content_view_core_)
325 content_view_core_->RemoveObserver(this); 328 content_view_core_->RemoveObserver(this);
326 SetContentViewCore(NULL); 329 SetContentViewCore(NULL);
327 DCHECK(ack_callbacks_.empty()); 330 DCHECK(ack_callbacks_.empty());
328 DCHECK(!delegated_frame_host_); 331 DCHECK(!delegated_frame_host_);
329 } 332 }
330 333
331 void RenderWidgetHostViewAndroid::Blur() { 334 void RenderWidgetHostViewAndroid::Blur() {
332 host_->Blur(); 335 host_->Blur();
333 if (overscroll_controller_) 336 if (overscroll_controller_)
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1084 ResetGestureDetection(); 1087 ResetGestureDetection();
1085 } 1088 }
1086 content_view_core_->OnSelectionEvent( 1089 content_view_core_->OnSelectionEvent(
1087 event, selection_controller_->GetStartPosition(), 1090 event, selection_controller_->GetStartPosition(),
1088 GetSelectionRect(*selection_controller_)); 1091 GetSelectionRect(*selection_controller_));
1089 } 1092 }
1090 1093
1091 std::unique_ptr<ui::TouchHandleDrawable> 1094 std::unique_ptr<ui::TouchHandleDrawable>
1092 RenderWidgetHostViewAndroid::CreateDrawable() { 1095 RenderWidgetHostViewAndroid::CreateDrawable() {
1093 DCHECK(content_view_core_); 1096 DCHECK(content_view_core_);
1094 if (!using_browser_compositor_) 1097 if (!using_browser_compositor_) {
1095 return PopupTouchHandleDrawable::Create( 1098 if (!sync_compositor_)
1096 content_view_core_, ui::GetScaleFactorForNativeView(GetNativeView())); 1099 return nullptr;
1097 1100 return std::unique_ptr<ui::TouchHandleDrawable>(
1101 sync_compositor_->client()->CreateDrawable());
1102 }
1098 return std::unique_ptr< 1103 return std::unique_ptr<
1099 ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable( 1104 ui::TouchHandleDrawable>(new CompositedTouchHandleDrawable(
1100 content_view_core_->GetViewAndroid()->GetLayer(), 1105 content_view_core_->GetViewAndroid()->GetLayer(),
1101 ui::GetScaleFactorForNativeView(GetNativeView()), 1106 ui::GetScaleFactorForNativeView(GetNativeView()),
1102 // Use the activity context (instead of the application context) to ensure 1107 // Use the activity context (instead of the application context) to ensure
1103 // proper handle theming. 1108 // proper handle theming.
1104 content_view_core_->GetContext().obj())); 1109 content_view_core_->GetContext().obj()));
1105 } 1110 }
1106 1111
1107 void RenderWidgetHostViewAndroid::SynchronousCopyContents( 1112 void RenderWidgetHostViewAndroid::SynchronousCopyContents(
(...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after
1862 case ui::MotionEvent::ACTION_UP: 1867 case ui::MotionEvent::ACTION_UP:
1863 case ui::MotionEvent::ACTION_POINTER_UP: 1868 case ui::MotionEvent::ACTION_POINTER_UP:
1864 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", 1869 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED",
1865 delta.InMicroseconds(), 1, 1000000, 50); 1870 delta.InMicroseconds(), 1, 1000000, 50);
1866 default: 1871 default:
1867 return; 1872 return;
1868 } 1873 }
1869 } 1874 }
1870 1875
1871 } // namespace content 1876 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698