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 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
327 current_surface_size_ = surface_size; | 327 current_surface_size_ = surface_size; |
328 | 328 |
329 // manager must outlive compositors using it. | 329 // manager must outlive compositors using it. |
330 cc::SurfaceManager* surface_manager = | 330 cc::SurfaceManager* surface_manager = |
331 GetEmbedderDeps()->GetSurfaceManager(); | 331 GetEmbedderDeps()->GetSurfaceManager(); |
332 scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create( | 332 scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create( |
333 base::Bind(&SatisfyCallback, base::Unretained(surface_manager)), | 333 base::Bind(&SatisfyCallback, base::Unretained(surface_manager)), |
334 base::Bind(&RequireCallback, base::Unretained(surface_manager))); | 334 base::Bind(&RequireCallback, base::Unretained(surface_manager))); |
335 content_layer->SetSurfaceId( | 335 content_layer->SetSurfaceId( |
336 cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f, | 336 cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f, |
337 surface_size); | 337 surface_size, false /* strecth_content_to_fill_bounds */); |
danakj
2016/12/16 14:30:44
"strecth" => stretch
| |
338 content_layer->SetBounds(current_surface_size_); | 338 content_layer->SetBounds(current_surface_size_); |
339 content_layer->SetIsDrawable(true); | 339 content_layer->SetIsDrawable(true); |
340 content_layer->SetContentsOpaque(true); | 340 content_layer->SetContentsOpaque(true); |
341 | 341 |
342 layer_->AddChild(content_layer); | 342 layer_->AddChild(content_layer); |
343 } | 343 } |
344 | 344 |
345 surface_factory_->SubmitCompositorFrame( | 345 surface_factory_->SubmitCompositorFrame( |
346 local_frame_id_, std::move(frame), | 346 local_frame_id_, std::move(frame), |
347 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, | 347 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
460 // Destroy the old LayerTreeHost state. | 460 // Destroy the old LayerTreeHost state. |
461 host_.reset(); | 461 host_.reset(); |
462 | 462 |
463 // Cancel any outstanding CompositorFrameSink requests. That way if we get an | 463 // Cancel any outstanding CompositorFrameSink requests. That way if we get an |
464 // async callback related to the old request we know to drop it. | 464 // async callback related to the old request we know to drop it. |
465 compositor_frame_sink_request_pending_ = false; | 465 compositor_frame_sink_request_pending_ = false; |
466 } | 466 } |
467 | 467 |
468 } // namespace client | 468 } // namespace client |
469 } // namespace blimp | 469 } // namespace blimp |
OLD | NEW |