| 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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 current_surface_size_ = texture_size_in_layer_; | 1017 current_surface_size_ = texture_size_in_layer_; |
| 1018 location_bar_content_translation_ = | 1018 location_bar_content_translation_ = |
| 1019 frame.metadata.location_bar_content_translation; | 1019 frame.metadata.location_bar_content_translation; |
| 1020 current_viewport_selection_ = frame.metadata.selection; | 1020 current_viewport_selection_ = frame.metadata.selection; |
| 1021 AttachLayers(); | 1021 AttachLayers(); |
| 1022 } | 1022 } |
| 1023 | 1023 |
| 1024 cc::SurfaceFactory::DrawCallback ack_callback = | 1024 cc::SurfaceFactory::DrawCallback ack_callback = |
| 1025 base::Bind(&RenderWidgetHostViewAndroid::RunAckCallbacks, | 1025 base::Bind(&RenderWidgetHostViewAndroid::RunAckCallbacks, |
| 1026 weak_ptr_factory_.GetWeakPtr()); | 1026 weak_ptr_factory_.GetWeakPtr()); |
| 1027 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); | 1027 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame), |
| 1028 *frame_copy = std::move(frame); | |
| 1029 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame_copy), | |
| 1030 ack_callback); | 1028 ack_callback); |
| 1031 } | 1029 } |
| 1032 | 1030 |
| 1033 void RenderWidgetHostViewAndroid::SwapDelegatedFrame( | 1031 void RenderWidgetHostViewAndroid::SwapDelegatedFrame( |
| 1034 uint32_t output_surface_id, | 1032 uint32_t output_surface_id, |
| 1035 cc::CompositorFrame frame) { | 1033 cc::CompositorFrame frame) { |
| 1036 CheckOutputSurfaceChanged(output_surface_id); | 1034 CheckOutputSurfaceChanged(output_surface_id); |
| 1037 bool has_content = !texture_size_in_layer_.IsEmpty(); | 1035 bool has_content = !texture_size_in_layer_.IsEmpty(); |
| 1038 | 1036 |
| 1039 // DelegatedRendererLayerImpl applies the inverse device_scale_factor of the | 1037 // DelegatedRendererLayerImpl applies the inverse device_scale_factor of the |
| (...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2022 case ui::MotionEvent::ACTION_UP: | 2020 case ui::MotionEvent::ACTION_UP: |
| 2023 case ui::MotionEvent::ACTION_POINTER_UP: | 2021 case ui::MotionEvent::ACTION_POINTER_UP: |
| 2024 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", | 2022 UMA_HISTOGRAM_CUSTOM_COUNTS("Event.Latency.OS.TOUCH_RELEASED", |
| 2025 delta.InMicroseconds(), 1, 1000000, 50); | 2023 delta.InMicroseconds(), 1, 1000000, 50); |
| 2026 default: | 2024 default: |
| 2027 return; | 2025 return; |
| 2028 } | 2026 } |
| 2029 } | 2027 } |
| 2030 | 2028 |
| 2031 } // namespace content | 2029 } // namespace content |
| OLD | NEW |