| OLD | NEW |
| 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 1065 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1076 SendReclaimCompositorResources(last_compositor_frame_sink_id_, | 1076 SendReclaimCompositorResources(last_compositor_frame_sink_id_, |
| 1077 false /* is_swap_ack */); | 1077 false /* is_swap_ack */); |
| 1078 | 1078 |
| 1079 last_compositor_frame_sink_id_ = compositor_frame_sink_id; | 1079 last_compositor_frame_sink_id_ = compositor_frame_sink_id; |
| 1080 } | 1080 } |
| 1081 | 1081 |
| 1082 void RenderWidgetHostViewAndroid::InternalSwapCompositorFrame( | 1082 void RenderWidgetHostViewAndroid::InternalSwapCompositorFrame( |
| 1083 uint32_t compositor_frame_sink_id, | 1083 uint32_t compositor_frame_sink_id, |
| 1084 cc::CompositorFrame frame) { | 1084 cc::CompositorFrame frame) { |
| 1085 last_scroll_offset_ = frame.metadata.root_scroll_offset; | 1085 last_scroll_offset_ = frame.metadata.root_scroll_offset; |
| 1086 DCHECK(frame.delegated_frame_data); | |
| 1087 DCHECK(delegated_frame_host_); | 1086 DCHECK(delegated_frame_host_); |
| 1088 | 1087 |
| 1089 if (locks_on_frame_count_ > 0) { | 1088 if (locks_on_frame_count_ > 0) { |
| 1090 DCHECK(HasValidFrame()); | 1089 DCHECK(HasValidFrame()); |
| 1091 RetainFrame(compositor_frame_sink_id, std::move(frame)); | 1090 RetainFrame(compositor_frame_sink_id, std::move(frame)); |
| 1092 return; | 1091 return; |
| 1093 } | 1092 } |
| 1094 | 1093 |
| 1095 DCHECK(!frame.delegated_frame_data->render_pass_list.empty()); | 1094 DCHECK(!frame.render_pass_list.empty()); |
| 1096 | 1095 |
| 1097 cc::RenderPass* root_pass = | 1096 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); |
| 1098 frame.delegated_frame_data->render_pass_list.back().get(); | |
| 1099 current_surface_size_ = root_pass->output_rect.size(); | 1097 current_surface_size_ = root_pass->output_rect.size(); |
| 1100 bool is_transparent = root_pass->has_transparent_background; | 1098 bool is_transparent = root_pass->has_transparent_background; |
| 1101 | 1099 |
| 1102 cc::CompositorFrameMetadata metadata = frame.metadata.Clone(); | 1100 cc::CompositorFrameMetadata metadata = frame.metadata.Clone(); |
| 1103 | 1101 |
| 1104 CheckCompositorFrameSinkChanged(compositor_frame_sink_id); | 1102 CheckCompositorFrameSinkChanged(compositor_frame_sink_id); |
| 1105 bool has_content = !current_surface_size_.IsEmpty(); | 1103 bool has_content = !current_surface_size_.IsEmpty(); |
| 1106 | 1104 |
| 1107 base::Closure ack_callback = | 1105 base::Closure ack_callback = |
| 1108 base::Bind(&RenderWidgetHostViewAndroid::SendReclaimCompositorResources, | 1106 base::Bind(&RenderWidgetHostViewAndroid::SendReclaimCompositorResources, |
| (...skipping 881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1990 case ui::MotionEvent::ACTION_UP: | 1988 case ui::MotionEvent::ACTION_UP: |
| 1991 case ui::MotionEvent::ACTION_POINTER_UP: | 1989 case ui::MotionEvent::ACTION_POINTER_UP: |
| 1992 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 1990 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 1993 delta.InMicroseconds(), 1, 1000000, 50); | 1991 delta.InMicroseconds(), 1, 1000000, 50); |
| 1994 default: | 1992 default: |
| 1995 return; | 1993 return; |
| 1996 } | 1994 } |
| 1997 } | 1995 } |
| 1998 | 1996 |
| 1999 } // namespace content | 1997 } // namespace content |
| OLD | NEW |