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

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

Issue 650533004: Reset DelegatedFrameHost SurfaceFactory when output_surface_id changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/compositor/delegated_frame_host.h" 5 #include "content/browser/compositor/delegated_frame_host.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "cc/output/compositor_frame.h" 9 #include "cc/output/compositor_frame.h"
10 #include "cc/output/compositor_frame_ack.h" 10 #include "cc/output/compositor_frame_ack.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 if (output_surface_id != last_output_surface_id_) { 342 if (output_surface_id != last_output_surface_id_) {
343 // Resource ids are scoped by the output surface. 343 // Resource ids are scoped by the output surface.
344 // If the originating output surface doesn't match the last one, it 344 // If the originating output surface doesn't match the last one, it
345 // indicates the renderer's output surface may have been recreated, in which 345 // indicates the renderer's output surface may have been recreated, in which
346 // case we should recreate the DelegatedRendererLayer, to avoid matching 346 // case we should recreate the DelegatedRendererLayer, to avoid matching
347 // resources from the old one with resources from the new one which would 347 // resources from the old one with resources from the new one which would
348 // have the same id. Changing the layer to showing painted content destroys 348 // have the same id. Changing the layer to showing painted content destroys
349 // the DelegatedRendererLayer. 349 // the DelegatedRendererLayer.
350 EvictDelegatedFrame(); 350 EvictDelegatedFrame();
351 351
352 surface_factory_.reset();
353 if (!surface_returned_resources_.empty())
354 SendReturnedDelegatedResources(last_output_surface_id_);
355
352 // Drop the cc::DelegatedFrameResourceCollection so that we will not return 356 // Drop the cc::DelegatedFrameResourceCollection so that we will not return
353 // any resources from the old output surface with the new output surface id. 357 // any resources from the old output surface with the new output surface id.
354 if (resource_collection_.get()) { 358 if (resource_collection_.get()) {
355 resource_collection_->SetClient(NULL); 359 resource_collection_->SetClient(NULL);
356 360
357 if (resource_collection_->LoseAllResources()) 361 if (resource_collection_->LoseAllResources())
358 SendReturnedDelegatedResources(last_output_surface_id_); 362 SendReturnedDelegatedResources(last_output_surface_id_);
359 363
360 resource_collection_ = NULL; 364 resource_collection_ = NULL;
361 } 365 }
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 if (frame_provider_.get()) { 996 if (frame_provider_.get()) {
993 new_layer->SetShowDelegatedContent(frame_provider_.get(), 997 new_layer->SetShowDelegatedContent(frame_provider_.get(),
994 current_frame_size_in_dip_); 998 current_frame_size_in_dip_);
995 } 999 }
996 if (!surface_id_.is_null()) { 1000 if (!surface_id_.is_null()) {
997 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_); 1001 new_layer->SetShowSurface(surface_id_, current_frame_size_in_dip_);
998 } 1002 }
999 } 1003 }
1000 1004
1001 } // namespace content 1005 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698