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 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 | 479 |
480 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); | 480 gfx::Size desired_size = client_->DelegatedFrameHostDesiredSizeInDIP(); |
481 if (desired_size != frame_size_in_dip && !desired_size.IsEmpty()) | 481 if (desired_size != frame_size_in_dip && !desired_size.IsEmpty()) |
482 skip_frame = true; | 482 skip_frame = true; |
483 | 483 |
484 cc::SurfaceFactory::DrawCallback ack_callback; | 484 cc::SurfaceFactory::DrawCallback ack_callback; |
485 if (compositor_ && !skip_frame) { | 485 if (compositor_ && !skip_frame) { |
486 ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn, AsWeakPtr(), | 486 ack_callback = base::Bind(&DelegatedFrameHost::SurfaceDrawn, AsWeakPtr(), |
487 output_surface_id); | 487 output_surface_id); |
488 } | 488 } |
489 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame), | 489 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); |
| 490 *frame_copy = std::move(frame); |
| 491 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame_copy), |
490 ack_callback); | 492 ack_callback); |
491 } | 493 } |
492 released_front_lock_ = NULL; | 494 released_front_lock_ = NULL; |
493 current_frame_size_in_dip_ = frame_size_in_dip; | 495 current_frame_size_in_dip_ = frame_size_in_dip; |
494 CheckResizeLock(); | 496 CheckResizeLock(); |
495 | 497 |
496 UpdateGutters(); | 498 UpdateGutters(); |
497 | 499 |
498 if (!damage_rect_in_dip.IsEmpty()) | 500 if (!damage_rect_in_dip.IsEmpty()) |
499 client_->DelegatedFrameHostGetLayer()->OnDelegatedFrameDamage( | 501 client_->DelegatedFrameHostGetLayer()->OnDelegatedFrameDamage( |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 897 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
896 new_layer->SetShowSurface( | 898 new_layer->SetShowSurface( |
897 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 899 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
898 base::Bind(&RequireCallback, base::Unretained(manager)), | 900 base::Bind(&RequireCallback, base::Unretained(manager)), |
899 current_surface_size_, current_scale_factor_, | 901 current_surface_size_, current_scale_factor_, |
900 current_frame_size_in_dip_); | 902 current_frame_size_in_dip_); |
901 } | 903 } |
902 } | 904 } |
903 | 905 |
904 } // namespace content | 906 } // namespace content |
OLD | NEW |