| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "ui/android/delegated_frame_host_android.h" | 5 #include "ui/android/delegated_frame_host_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 | 173 |
| 174 void DelegatedFrameHostAndroid::WillDrawSurface( | 174 void DelegatedFrameHostAndroid::WillDrawSurface( |
| 175 const cc::LocalSurfaceId& local_surface_id, | 175 const cc::LocalSurfaceId& local_surface_id, |
| 176 const gfx::Rect& damage_rect) {} | 176 const gfx::Rect& damage_rect) {} |
| 177 | 177 |
| 178 void DelegatedFrameHostAndroid::OnNeedsBeginFrames(bool needs_begin_frames) { | 178 void DelegatedFrameHostAndroid::OnNeedsBeginFrames(bool needs_begin_frames) { |
| 179 support_->SetNeedsBeginFrame(needs_begin_frames); | 179 support_->SetNeedsBeginFrame(needs_begin_frames); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void DelegatedFrameHostAndroid::OnDidFinishFrame(const cc::BeginFrameAck& ack) { | 182 void DelegatedFrameHostAndroid::OnDidFinishFrame(const cc::BeginFrameAck& ack) { |
| 183 // If there was damage, SubmitCompositorFrame includes the ack. |
| 184 if (!ack.has_damage) |
| 185 support_->BeginFrameDidNotSwap(ack); |
| 183 } | 186 } |
| 184 | 187 |
| 185 void DelegatedFrameHostAndroid::CreateNewCompositorFrameSinkSupport() { | 188 void DelegatedFrameHostAndroid::CreateNewCompositorFrameSinkSupport() { |
| 186 support_.reset(); | 189 support_.reset(); |
| 187 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( | 190 support_ = base::MakeUnique<cc::CompositorFrameSinkSupport>( |
| 188 this, surface_manager_, frame_sink_id_, false /* is_root */, | 191 this, surface_manager_, frame_sink_id_, false /* is_root */, |
| 189 false /* handles_frame_sink_id_invalidation */, | 192 false /* handles_frame_sink_id_invalidation */, |
| 190 true /* needs_sync_points */); | 193 true /* needs_sync_points */); |
| 191 } | 194 } |
| 192 | 195 |
| 193 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { | 196 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { |
| 194 return surface_info_.id(); | 197 return surface_info_.id(); |
| 195 } | 198 } |
| 196 | 199 |
| 197 } // namespace ui | 200 } // namespace ui |
| OLD | NEW |