| 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 "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1010 return scoped_ptr<SyntheticGestureTarget>(new SyntheticGestureTargetAndroid( | 1010 return scoped_ptr<SyntheticGestureTarget>(new SyntheticGestureTargetAndroid( |
| 1011 host_, content_view_core_->CreateTouchEventSynthesizer())); | 1011 host_, content_view_core_->CreateTouchEventSynthesizer())); |
| 1012 } | 1012 } |
| 1013 | 1013 |
| 1014 void RenderWidgetHostViewAndroid::SendDelegatedFrameAck( | 1014 void RenderWidgetHostViewAndroid::SendDelegatedFrameAck( |
| 1015 uint32 output_surface_id) { | 1015 uint32 output_surface_id) { |
| 1016 DCHECK(host_); | 1016 DCHECK(host_); |
| 1017 cc::CompositorFrameAck ack; | 1017 cc::CompositorFrameAck ack; |
| 1018 if (resource_collection_.get()) | 1018 if (resource_collection_.get()) |
| 1019 resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); | 1019 resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); |
| 1020 RenderWidgetHostImpl::SendSwapCompositorFrameAck(host_->GetRoutingID(), | 1020 host_->Send(new ViewMsg_SwapCompositorFrameAck(host_->GetRoutingID(), |
| 1021 output_surface_id, | 1021 output_surface_id, ack)); |
| 1022 host_->GetProcess()->GetID(), | |
| 1023 ack); | |
| 1024 } | 1022 } |
| 1025 | 1023 |
| 1026 void RenderWidgetHostViewAndroid::SendReturnedDelegatedResources( | 1024 void RenderWidgetHostViewAndroid::SendReturnedDelegatedResources( |
| 1027 uint32 output_surface_id) { | 1025 uint32 output_surface_id) { |
| 1028 DCHECK(resource_collection_.get()); | 1026 DCHECK(resource_collection_.get()); |
| 1029 | 1027 |
| 1030 cc::CompositorFrameAck ack; | 1028 cc::CompositorFrameAck ack; |
| 1031 resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); | 1029 resource_collection_->TakeUnusedResourcesForChildCompositor(&ack.resources); |
| 1032 DCHECK(!ack.resources.empty()); | 1030 DCHECK(!ack.resources.empty()); |
| 1033 | 1031 |
| 1034 RenderWidgetHostImpl::SendReclaimCompositorResources( | 1032 host_->Send(new ViewMsg_ReclaimCompositorResources(host_->GetRoutingID(), |
| 1035 host_->GetRoutingID(), | 1033 output_surface_id, ack)); |
| 1036 output_surface_id, | |
| 1037 host_->GetProcess()->GetID(), | |
| 1038 ack); | |
| 1039 } | 1034 } |
| 1040 | 1035 |
| 1041 void RenderWidgetHostViewAndroid::UnusedResourcesAreAvailable() { | 1036 void RenderWidgetHostViewAndroid::UnusedResourcesAreAvailable() { |
| 1042 if (ack_callbacks_.size()) | 1037 if (ack_callbacks_.size()) |
| 1043 return; | 1038 return; |
| 1044 SendReturnedDelegatedResources(last_output_surface_id_); | 1039 SendReturnedDelegatedResources(last_output_surface_id_); |
| 1045 } | 1040 } |
| 1046 | 1041 |
| 1047 void RenderWidgetHostViewAndroid::DestroyDelegatedContent() { | 1042 void RenderWidgetHostViewAndroid::DestroyDelegatedContent() { |
| 1048 RemoveLayers(); | 1043 RemoveLayers(); |
| (...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1940 results->orientationAngle = display.RotationAsDegree(); | 1935 results->orientationAngle = display.RotationAsDegree(); |
| 1941 results->orientationType = | 1936 results->orientationType = |
| 1942 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); | 1937 RenderWidgetHostViewBase::GetOrientationTypeForMobile(display); |
| 1943 gfx::DeviceDisplayInfo info; | 1938 gfx::DeviceDisplayInfo info; |
| 1944 results->depth = info.GetBitsPerPixel(); | 1939 results->depth = info.GetBitsPerPixel(); |
| 1945 results->depthPerComponent = info.GetBitsPerComponent(); | 1940 results->depthPerComponent = info.GetBitsPerComponent(); |
| 1946 results->isMonochrome = (results->depthPerComponent == 0); | 1941 results->isMonochrome = (results->depthPerComponent == 0); |
| 1947 } | 1942 } |
| 1948 | 1943 |
| 1949 } // namespace content | 1944 } // namespace content |
| OLD | NEW |