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 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 client_->DelegatedFrameHostGetLayer()->RequestCopyOfOutput( | 885 client_->DelegatedFrameHostGetLayer()->RequestCopyOfOutput( |
886 std::move(request)); | 886 std::move(request)); |
887 } | 887 } |
888 } | 888 } |
889 | 889 |
890 void DelegatedFrameHost::UnlockResources() { | 890 void DelegatedFrameHost::UnlockResources() { |
891 DCHECK(!local_frame_id_.is_null()); | 891 DCHECK(!local_frame_id_.is_null()); |
892 delegated_frame_evictor_->UnlockFrame(); | 892 delegated_frame_evictor_->UnlockFrame(); |
893 } | 893 } |
894 | 894 |
895 //////////////////////////////////////////////////////////////////////////////// | |
896 // DelegatedFrameHost, ui::LayerOwnerDelegate implementation: | |
897 | |
898 void DelegatedFrameHost::OnLayerRecreated(ui::Layer* old_layer, | |
899 ui::Layer* new_layer) { | |
900 // The new_layer is the one that will be used by our Window, so that's the one | |
901 // that should keep our frame. old_layer will be returned to the | |
902 // RecreateLayer caller, and should have a copy. | |
903 if (!local_frame_id_.is_null()) { | |
904 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | |
905 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | |
906 new_layer->SetShowSurface( | |
907 cc::SurfaceId(frame_sink_id_, local_frame_id_), | |
908 base::Bind(&SatisfyCallback, base::Unretained(manager)), | |
909 base::Bind(&RequireCallback, base::Unretained(manager)), | |
910 current_surface_size_, current_scale_factor_, | |
911 current_frame_size_in_dip_); | |
912 } | |
913 } | |
914 | |
915 } // namespace content | 895 } // namespace content |
OLD | NEW |