OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/delegated_frame_host.h" | 5 #include "content/browser/renderer_host/delegated_frame_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 client_->DelegatedFrameHostGetLayer()->RequestCopyOfOutput( | 889 client_->DelegatedFrameHostGetLayer()->RequestCopyOfOutput( |
890 std::move(request)); | 890 std::move(request)); |
891 } | 891 } |
892 } | 892 } |
893 | 893 |
894 void DelegatedFrameHost::UnlockResources() { | 894 void DelegatedFrameHost::UnlockResources() { |
895 DCHECK(!local_frame_id_.is_null()); | 895 DCHECK(!local_frame_id_.is_null()); |
896 delegated_frame_evictor_->UnlockFrame(); | 896 delegated_frame_evictor_->UnlockFrame(); |
897 } | 897 } |
898 | 898 |
899 //////////////////////////////////////////////////////////////////////////////// | |
900 // DelegatedFrameHost, ui::LayerOwnerDelegate implementation: | |
901 | |
902 void DelegatedFrameHost::OnLayerRecreated(ui::Layer* old_layer, | |
903 ui::Layer* new_layer) { | |
904 // The new_layer is the one that will be used by our Window, so that's the one | |
905 // that should keep our frame. old_layer will be returned to the | |
906 // RecreateLayer caller, and should have a copy. | |
907 if (!local_frame_id_.is_null()) { | |
908 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | |
909 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | |
910 new_layer->SetShowSurface( | |
911 cc::SurfaceId(frame_sink_id_, local_frame_id_), | |
912 base::Bind(&SatisfyCallback, base::Unretained(manager)), | |
913 base::Bind(&RequireCallback, base::Unretained(manager)), | |
914 current_surface_size_, current_scale_factor_, | |
915 current_frame_size_in_dip_); | |
916 } | |
917 } | |
918 | |
919 } // namespace content | 899 } // namespace content |
OLD | NEW |