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

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

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

Powered by Google App Engine
This is Rietveld 408576698