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

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

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

Powered by Google App Engine
This is Rietveld 408576698