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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 // Setting the source in this copy request asks that the layer abort any prior | 377 // Setting the source in this copy request asks that the layer abort any prior |
378 // uncommitted copy requests made on behalf of the same frame subscriber. | 378 // uncommitted copy requests made on behalf of the same frame subscriber. |
379 // This will not affect any of the copy requests spawned elsewhere from | 379 // This will not affect any of the copy requests spawned elsewhere from |
380 // DelegatedFrameHost (e.g., a call to CopyFromCompositingSurface() for | 380 // DelegatedFrameHost (e.g., a call to CopyFromCompositingSurface() for |
381 // screenshots) since those copy requests do not specify |frame_subscriber()| | 381 // screenshots) since those copy requests do not specify |frame_subscriber()| |
382 // as a source. | 382 // as a source. |
383 request->set_source(frame_subscriber()); | 383 request->set_source(frame_subscriber()); |
384 if (subscriber_texture.get()) { | 384 if (subscriber_texture.get()) { |
385 request->SetTextureMailbox(cc::TextureMailbox( | 385 request->SetTextureMailbox(cc::TextureMailbox( |
386 subscriber_texture->mailbox(), subscriber_texture->sync_token(), | 386 subscriber_texture->mailbox(), subscriber_texture->sync_token(), |
387 subscriber_texture->target(), current_frame_size_in_dip_, false, | 387 subscriber_texture->target())); |
388 false)); | |
389 } | 388 } |
390 | 389 |
391 if (surface_factory_.get()) { | 390 if (surface_factory_.get()) { |
392 // To avoid unnecessary composites, go directly to the Surface rather than | 391 // To avoid unnecessary composites, go directly to the Surface rather than |
393 // through RequestCopyOfOutput (which goes through the browser | 392 // through RequestCopyOfOutput (which goes through the browser |
394 // compositor). | 393 // compositor). |
395 if (!request_copy_of_output_callback_for_testing_.is_null()) | 394 if (!request_copy_of_output_callback_for_testing_.is_null()) |
396 request_copy_of_output_callback_for_testing_.Run(std::move(request)); | 395 request_copy_of_output_callback_for_testing_.Run(std::move(request)); |
397 else | 396 else |
398 surface_factory_->RequestCopyOfSurface(local_frame_id_, | 397 surface_factory_->RequestCopyOfSurface(local_frame_id_, |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 new_layer->SetShowSurface( | 906 new_layer->SetShowSurface( |
908 cc::SurfaceId(frame_sink_id_, local_frame_id_), | 907 cc::SurfaceId(frame_sink_id_, local_frame_id_), |
909 base::Bind(&SatisfyCallback, base::Unretained(manager)), | 908 base::Bind(&SatisfyCallback, base::Unretained(manager)), |
910 base::Bind(&RequireCallback, base::Unretained(manager)), | 909 base::Bind(&RequireCallback, base::Unretained(manager)), |
911 current_surface_size_, current_scale_factor_, | 910 current_surface_size_, current_scale_factor_, |
912 current_frame_size_in_dip_); | 911 current_frame_size_in_dip_); |
913 } | 912 } |
914 } | 913 } |
915 | 914 |
916 } // namespace content | 915 } // namespace content |
OLD | NEW |