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 DCHECK(support_->SubmitCompositorFrame(local_surface_id, std::move(frame))); |
danakj
2017/05/19 19:00:59
and here :)
Saman Sami
2017/05/19 19:26:46
Done.
| |
89 content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, | 89 content_layer_ = CreateSurfaceLayer(surface_manager_, surface_info_, |
90 !has_transparent_background_); | 90 !has_transparent_background_); |
91 view_->GetLayer()->AddChild(content_layer_); | 91 view_->GetLayer()->AddChild(content_layer_); |
92 } else { | 92 } else { |
93 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); | 93 support_->SubmitCompositorFrame(local_surface_id, std::move(frame)); |
94 } | 94 } |
95 } | 95 } |
96 | 96 |
97 cc::FrameSinkId DelegatedFrameHostAndroid::GetFrameSinkId() const { | 97 cc::FrameSinkId DelegatedFrameHostAndroid::GetFrameSinkId() const { |
98 return frame_sink_id_; | 98 return frame_sink_id_; |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
197 support_ = cc::CompositorFrameSinkSupport::Create( | 197 support_ = cc::CompositorFrameSinkSupport::Create( |
198 this, surface_manager_, frame_sink_id_, is_root, | 198 this, surface_manager_, frame_sink_id_, is_root, |
199 handles_frame_sink_id_invalidation, needs_sync_points); | 199 handles_frame_sink_id_invalidation, needs_sync_points); |
200 } | 200 } |
201 | 201 |
202 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { | 202 cc::SurfaceId DelegatedFrameHostAndroid::SurfaceId() const { |
203 return surface_info_.id(); | 203 return surface_info_.id(); |
204 } | 204 } |
205 | 205 |
206 } // namespace ui | 206 } // namespace ui |
OLD | NEW |