| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 proxy_client_ = proxy_client; | 256 proxy_client_ = proxy_client; |
| 257 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( | 257 surface_factory_ = base::MakeUnique<cc::SurfaceFactory>( |
| 258 frame_sink_id_, GetEmbedderDeps()->GetSurfaceManager(), this); | 258 frame_sink_id_, GetEmbedderDeps()->GetSurfaceManager(), this); |
| 259 } | 259 } |
| 260 | 260 |
| 261 void BlimpCompositor::SubmitCompositorFrame(cc::CompositorFrame frame) { | 261 void BlimpCompositor::SubmitCompositorFrame(cc::CompositorFrame frame) { |
| 262 DCHECK(thread_checker_.CalledOnValidThread()); | 262 DCHECK(thread_checker_.CalledOnValidThread()); |
| 263 DCHECK(surface_factory_); | 263 DCHECK(surface_factory_); |
| 264 | 264 |
| 265 cc::RenderPass* root_pass = | 265 cc::RenderPass* root_pass = frame.render_pass_list.back().get(); |
| 266 frame.delegated_frame_data->render_pass_list.back().get(); | |
| 267 gfx::Size surface_size = root_pass->output_rect.size(); | 266 gfx::Size surface_size = root_pass->output_rect.size(); |
| 268 | 267 |
| 269 if (local_frame_id_.is_null() || current_surface_size_ != surface_size) { | 268 if (local_frame_id_.is_null() || current_surface_size_ != surface_size) { |
| 270 DestroyDelegatedContent(); | 269 DestroyDelegatedContent(); |
| 271 DCHECK(layer_->children().empty()); | 270 DCHECK(layer_->children().empty()); |
| 272 | 271 |
| 273 local_frame_id_ = surface_id_allocator_->GenerateId(); | 272 local_frame_id_ = surface_id_allocator_->GenerateId(); |
| 274 surface_factory_->Create(local_frame_id_); | 273 surface_factory_->Create(local_frame_id_); |
| 275 current_surface_size_ = surface_size; | 274 current_surface_size_ = surface_size; |
| 276 | 275 |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 it->second.Run(); | 414 it->second.Run(); |
| 416 it = pending_commit_trackers_.erase(it); | 415 it = pending_commit_trackers_.erase(it); |
| 417 } else { | 416 } else { |
| 418 ++it; | 417 ++it; |
| 419 } | 418 } |
| 420 } | 419 } |
| 421 } | 420 } |
| 422 | 421 |
| 423 } // namespace client | 422 } // namespace client |
| 424 } // namespace blimp | 423 } // namespace blimp |
| OLD | NEW |