| 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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 884 std::move(request)); | 883 std::move(request)); |
| 885 } | 884 } |
| 886 } | 885 } |
| 887 | 886 |
| 888 void DelegatedFrameHost::UnlockResources() { | 887 void DelegatedFrameHost::UnlockResources() { |
| 889 DCHECK(!local_frame_id_.is_null()); | 888 DCHECK(!local_frame_id_.is_null()); |
| 890 delegated_frame_evictor_->UnlockFrame(); | 889 delegated_frame_evictor_->UnlockFrame(); |
| 891 } | 890 } |
| 892 | 891 |
| 893 } // namespace content | 892 } // namespace content |
| OLD | NEW |