Chromium Code Reviews| 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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 508 const gfx::Rect& damage_rect) { | 508 const gfx::Rect& damage_rect) { |
| 509 // Frame subscribers are only interested in changes to the target surface, so | 509 // Frame subscribers are only interested in changes to the target surface, so |
| 510 // do not attempt capture if |damage_rect| is empty. This prevents the draws | 510 // do not attempt capture if |damage_rect| is empty. This prevents the draws |
| 511 // of parent surfaces from triggering extra frame captures, which can affect | 511 // of parent surfaces from triggering extra frame captures, which can affect |
| 512 // smoothness. | 512 // smoothness. |
| 513 if (id != local_surface_id_ || damage_rect.IsEmpty()) | 513 if (id != local_surface_id_ || damage_rect.IsEmpty()) |
| 514 return; | 514 return; |
| 515 AttemptFrameSubscriberCapture(damage_rect); | 515 AttemptFrameSubscriberCapture(damage_rect); |
| 516 } | 516 } |
| 517 | 517 |
| 518 void DelegatedFrameHost::OnBadFrameReceived() { | |
|
piman
2017/03/17 20:12:41
The callback mechanism seems extremely unfortunate
| |
| 519 client_->ReceivedBadMessage( | |
| 520 bad_message::BadMessageReason::DFH_BAD_EMBEDDER_MESSAGE); | |
| 521 } | |
| 522 | |
| 518 void DelegatedFrameHost::OnBeginFrame(const cc::BeginFrameArgs& args) { | 523 void DelegatedFrameHost::OnBeginFrame(const cc::BeginFrameArgs& args) { |
| 519 begin_frame_source_->OnBeginFrame(args); | 524 begin_frame_source_->OnBeginFrame(args); |
| 520 } | 525 } |
| 521 | 526 |
| 522 void DelegatedFrameHost::EvictDelegatedFrame() { | 527 void DelegatedFrameHost::EvictDelegatedFrame() { |
| 523 if (!has_frame_) | 528 if (!has_frame_) |
| 524 return; | 529 return; |
| 525 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent(); | 530 client_->DelegatedFrameHostGetLayer()->SetShowSolidColorContent(); |
| 526 support_->EvictFrame(); | 531 support_->EvictFrame(); |
| 527 has_frame_ = false; | 532 has_frame_ = false; |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 849 | 854 |
| 850 void DelegatedFrameHost::ResetCompositorFrameSinkSupport() { | 855 void DelegatedFrameHost::ResetCompositorFrameSinkSupport() { |
| 851 if (!support_) | 856 if (!support_) |
| 852 return; | 857 return; |
| 853 if (compositor_) | 858 if (compositor_) |
| 854 compositor_->RemoveFrameSink(frame_sink_id_); | 859 compositor_->RemoveFrameSink(frame_sink_id_); |
| 855 support_.reset(); | 860 support_.reset(); |
| 856 } | 861 } |
| 857 | 862 |
| 858 } // namespace content | 863 } // namespace content |
| OLD | NEW |