Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 2383263002: Generalize layer mirroring for phantom windows (Closed)
Patch Set: Rebase Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698