| 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 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | 88 bool result = |
| 89 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); |
| 90 DCHECK(result); |
| 91 |
| 89 content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, | 92 content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, |
| 90 !has_transparent_background_); | 93 !has_transparent_background_); |
| 91 view_->GetLayer()->AddChild(content_layer_); | 94 view_->GetLayer()->AddChild(content_layer_); |
| 92 } else { | 95 } else { |
| 93 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | 96 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); |
| 94 } | 97 } |
| 95 } | 98 } |
| 96 | 99 |
| 97 void DelegatedFrameHostAndroid::DidNotProduceFrame( | 100 void DelegatedFrameHostAndroid::DidNotProduceFrame( |
| 98 const cc::BeginFrameAck& ack) { | 101 const cc::BeginFrameAck& ack) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 support_ = cc::CompositorFrameSinkSupport::Create( | 199 support_ = cc::CompositorFrameSinkSupport::Create( |
| 197 this, surface_manager_, frame_sink_id_, is_root, | 200 this, surface_manager_, frame_sink_id_, is_root, |
| 198 handles_frame_sink_id_invalidation, needs_sync_points); | 201 handles_frame_sink_id_invalidation, needs_sync_points); |
| 199 } | 202 } |
| 200 | 203 |
| 201 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { | 204 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { |
| 202 return surface_info_.id(); | 205 return surface_info_.id(); |
| 203 } | 206 } |
| 204 | 207 |
| 205 } // namespace ui | 208 } // namespace ui |
| OLD | NEW |