| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 if (local_surface_id != surface_info_.id().local_surface_id()) { | 78 if (local_surface_id != surface_info_.id().local_surface_id()) { |
| 79 DestroyDelegatedContent(); | 79 DestroyDelegatedContent(); |
| 80 DCHECK(!content_layer_); | 80 DCHECK(!content_layer_); |
| 81 | 81 |
| 82 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); | 82 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); |
| 83 gfx::Size frame_size = root_pass->output_rect.size(); | 83 gfx::Size frame_size = root_pass->output_rect.size(); |
| 84 surface_info_ = cc::SurfaceInfo( | 84 surface_info_ = cc::SurfaceInfo( |
| 85 cc::SurfaceId(frame_sink_id_, local_surface_id), 1.f, frame_size); | 85 cc::SurfaceId(frame_sink_id_, local_surface_id), 1.f, frame_size); |
| 86 has_transparent_background_ = root_pass->has_transparent_background; | 86 has_transparent_background_ = root_pass->has_transparent_background; |
| 87 | 87 |
| 88 bool result = | 88 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); |
| 89 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | |
| 90 DCHECK(result); | |
| 91 | |
| 92 content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, | 89 content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, |
| 93 !has_transparent_background_); | 90 !has_transparent_background_); |
| 94 view_->GetLayer()->AddChild(content_layer_); | 91 view_->GetLayer()->AddChild(content_layer_); |
| 95 } else { | 92 } else { |
| 96 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | 93 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); |
| 97 } | 94 } |
| 98 } | 95 } |
| 99 | 96 |
| 100 void DelegatedFrameHostAndroid::DidNotProduceFrame( | 97 void DelegatedFrameHostAndroid::DidNotProduceFrame( |
| 101 const cc::BeginFrameAck& ack) { | 98 const cc::BeginFrameAck& ack) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 support_ = cc::CompositorFrameSinkSupport::Create( | 196 support_ = cc::CompositorFrameSinkSupport::Create( |
| 200 this, surface_manager_, frame_sink_id_, is_root, | 197 this, surface_manager_, frame_sink_id_, is_root, |
| 201 handles_frame_sink_id_invalidation, needs_sync_points); | 198 handles_frame_sink_id_invalidation, needs_sync_points); |
| 202 } | 199 } |
| 203 | 200 |
| 204 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { | 201 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { |
| 205 return surface_info_.id(); | 202 return surface_info_.id(); |
| 206 } | 203 } |
| 207 | 204 |
| 208 } // namespace ui | 205 } // namespace ui |
| OLD | NEW |