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 std::unique_ptr<cc::CompositorFrame> frame_copy(new cc::CompositorFrame); | 489 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame), |
490 *frame_copy = std::move(frame); | |
491 surface_factory_->SubmitCompositorFrame(surface_id_, std::move(frame_copy), | |
492 ack_callback); | 490 ack_callback); |
493 } | 491 } |
494 released_front_lock_ = NULL; | 492 released_front_lock_ = NULL; |
495 current_frame_size_in_dip_ = frame_size_in_dip; | 493 current_frame_size_in_dip_ = frame_size_in_dip; |
496 CheckResizeLock(); | 494 CheckResizeLock(); |
497 | 495 |
498 UpdateGutters(); | 496 UpdateGutters(); |
499 | 497 |
500 if (!damage_rect_in_dip.IsEmpty()) | 498 if (!damage_rect_in_dip.IsEmpty()) |
501 client_->DelegatedFrameHostGetLayer()->OnDelegatedFrameDamage( | 499 client_->DelegatedFrameHostGetLayer()->OnDelegatedFrameDamage( |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 895 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
898 new_layer->SetShowSurface( | 896 new_layer->SetShowSurface( |
899 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 897 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
900 base::Bind(&RequireCallback, base::Unretained(manager)), | 898 base::Bind(&RequireCallback, base::Unretained(manager)), |
901 current_surface_size_, current_scale_factor_, | 899 current_surface_size_, current_scale_factor_, |
902 current_frame_size_in_dip_); | 900 current_frame_size_in_dip_); |
903 } | 901 } |
904 } | 902 } |
905 | 903 |
906 } // namespace content | 904 } // namespace content |
OLD | NEW |