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/sys_utils.h" | 9 #include "base/android/sys_utils.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 801 |
802 void RenderWidgetHostViewAndroid::SwapDelegatedFrame( | 802 void RenderWidgetHostViewAndroid::SwapDelegatedFrame( |
803 uint32 output_surface_id, | 803 uint32 output_surface_id, |
804 scoped_ptr<cc::DelegatedFrameData> frame_data) { | 804 scoped_ptr<cc::DelegatedFrameData> frame_data) { |
805 bool has_content = !texture_size_in_layer_.IsEmpty(); | 805 bool has_content = !texture_size_in_layer_.IsEmpty(); |
806 | 806 |
807 if (output_surface_id != last_output_surface_id_) { | 807 if (output_surface_id != last_output_surface_id_) { |
808 // Drop the cc::DelegatedFrameResourceCollection so that we will not return | 808 // Drop the cc::DelegatedFrameResourceCollection so that we will not return |
809 // any resources from the old output surface with the new output surface id. | 809 // any resources from the old output surface with the new output surface id. |
810 if (resource_collection_.get()) { | 810 if (resource_collection_.get()) { |
| 811 resource_collection_->SetClient(NULL); |
811 if (resource_collection_->LoseAllResources()) | 812 if (resource_collection_->LoseAllResources()) |
812 SendReturnedDelegatedResources(last_output_surface_id_); | 813 SendReturnedDelegatedResources(last_output_surface_id_); |
813 | |
814 resource_collection_->SetClient(NULL); | |
815 resource_collection_ = NULL; | 814 resource_collection_ = NULL; |
816 } | 815 } |
817 DestroyDelegatedContent(); | 816 DestroyDelegatedContent(); |
818 | 817 |
819 last_output_surface_id_ = output_surface_id; | 818 last_output_surface_id_ = output_surface_id; |
820 } | 819 } |
821 | 820 |
822 if (!has_content) { | 821 if (!has_content) { |
823 DestroyDelegatedContent(); | 822 DestroyDelegatedContent(); |
824 } else { | 823 } else { |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 results->availableRect = display.work_area(); | 1454 results->availableRect = display.work_area(); |
1456 results->deviceScaleFactor = display.device_scale_factor(); | 1455 results->deviceScaleFactor = display.device_scale_factor(); |
1457 results->orientationAngle = display.RotationAsDegree(); | 1456 results->orientationAngle = display.RotationAsDegree(); |
1458 gfx::DeviceDisplayInfo info; | 1457 gfx::DeviceDisplayInfo info; |
1459 results->depth = info.GetBitsPerPixel(); | 1458 results->depth = info.GetBitsPerPixel(); |
1460 results->depthPerComponent = info.GetBitsPerComponent(); | 1459 results->depthPerComponent = info.GetBitsPerComponent(); |
1461 results->isMonochrome = (results->depthPerComponent == 0); | 1460 results->isMonochrome = (results->depthPerComponent == 0); |
1462 } | 1461 } |
1463 | 1462 |
1464 } // namespace content | 1463 } // namespace content |
OLD | NEW |