| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "blimp/client/core/compositor/blimp_compositor.h" | 5 #include "blimp/client/core/compositor/blimp_compositor.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 proxy_client_ = proxy_client; | 203 proxy_client_ = proxy_client; |
| 204 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( | 204 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( |
| 205 frame_sink_id_, GetEmbedderDeps()->GetSurfaceManager(), this); | 205 frame_sink_id_, GetEmbedderDeps()->GetSurfaceManager(), this); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void BlimpCompositor::SubmitCompositorFrame(cc::CompositorFrame frame) { | 208 void BlimpCompositor::SubmitCompositorFrame(cc::CompositorFrame frame) { |
| 209 DCHECK(thread_checker_.CalledOnValidThread()); | 209 DCHECK(thread_checker_.CalledOnValidThread()); |
| 210 DCHECK(surface_factory_); | 210 DCHECK(surface_factory_); |
| 211 | 211 |
| 212 cc::RenderPass* root_pass = | 212 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); |
| 213 frame.delegated_frame_data->render_pass_list.back().get(); | |
| 214 gfx::Size surface_size = root_pass->output_rect.size(); | 213 gfx::Size surface_size = root_pass->output_rect.size(); |
| 215 | 214 |
| 216 if (local_frame_id_.is_null() || current_surface_size_ != surface_size) { | 215 if (local_frame_id_.is_null() || current_surface_size_ != surface_size) { |
| 217 DestroyDelegatedContent(); | 216 DestroyDelegatedContent(); |
| 218 DCHECK(layer_->children().empty()); | 217 DCHECK(layer_->children().empty()); |
| 219 | 218 |
| 220 local_frame_id_ = surface_id_allocator_->GenerateId(); | 219 local_frame_id_ = surface_id_allocator_->GenerateId(); |
| 221 surface_factory_->Create(local_frame_id_); | 220 surface_factory_->Create(local_frame_id_); |
| 222 current_surface_size_ = surface_size; | 221 current_surface_size_ = surface_size; |
| 223 | 222 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 it->second.Run(); | 341 it->second.Run(); |
| 343 it = pending_commit_trackers_.erase(it); | 342 it = pending_commit_trackers_.erase(it); |
| 344 } else { | 343 } else { |
| 345 ++it; | 344 ++it; |
| 346 } | 345 } |
| 347 } | 346 } |
| 348 } | 347 } |
| 349 | 348 |
| 350 } // namespace client | 349 } // namespace client |
| 351 } // namespace blimp | 350 } // namespace blimp |
| OLD | NEW |