| 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 current_surface_size_ = surface_size; | 305 current_surface_size_ = surface_size; |
| 306 | 306 |
| 307 // manager must outlive compositors using it. | 307 // manager must outlive compositors using it. |
| 308 cc::SurfaceManager* surface_manager = | 308 cc::SurfaceManager* surface_manager = |
| 309 GetEmbedderDeps()->GetSurfaceManager(); | 309 GetEmbedderDeps()->GetSurfaceManager(); |
| 310 auto content_layer = | 310 auto content_layer = |
| 311 cc::SurfaceLayer::Create(surface_manager->reference_factory()); | 311 cc::SurfaceLayer::Create(surface_manager->reference_factory()); |
| 312 cc::SurfaceId surface_id(surface_factory_->frame_sink_id(), | 312 cc::SurfaceId surface_id(surface_factory_->frame_sink_id(), |
| 313 local_frame_id_); | 313 local_frame_id_); |
| 314 content_layer->SetSurfaceInfo( | 314 content_layer->SetSurfaceInfo( |
| 315 cc::SurfaceInfo(surface_id, 1.f, surface_size), | 315 cc::SurfaceInfo(surface_id, 1.f, surface_size)); |
| 316 false /* stretch_content_to_fill_bounds */); | |
| 317 content_layer->SetBounds(current_surface_size_); | 316 content_layer->SetBounds(current_surface_size_); |
| 318 content_layer->SetIsDrawable(true); | 317 content_layer->SetIsDrawable(true); |
| 319 content_layer->SetContentsOpaque(true); | 318 content_layer->SetContentsOpaque(true); |
| 320 | 319 |
| 321 layer_->AddChild(content_layer); | 320 layer_->AddChild(content_layer); |
| 322 } | 321 } |
| 323 | 322 |
| 324 surface_factory_->SubmitCompositorFrame( | 323 surface_factory_->SubmitCompositorFrame( |
| 325 local_frame_id_, std::move(frame), | 324 local_frame_id_, std::move(frame), |
| 326 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, | 325 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // Destroy the old LayerTreeHost state. | 438 // Destroy the old LayerTreeHost state. |
| 440 host_.reset(); | 439 host_.reset(); |
| 441 | 440 |
| 442 // Cancel any outstanding CompositorFrameSink requests. That way if we get an | 441 // Cancel any outstanding CompositorFrameSink requests. That way if we get an |
| 443 // async callback related to the old request we know to drop it. | 442 // async callback related to the old request we know to drop it. |
| 444 compositor_frame_sink_request_pending_ = false; | 443 compositor_frame_sink_request_pending_ = false; |
| 445 } | 444 } |
| 446 | 445 |
| 447 } // namespace client | 446 } // namespace client |
| 448 } // namespace blimp | 447 } // namespace blimp |
| OLD | NEW |