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 11 matching lines...) Expand all Loading... |
22 #include "cc/blimp/client_picture_cache.h" | 22 #include "cc/blimp/client_picture_cache.h" |
23 #include "cc/blimp/compositor_state_deserializer.h" | 23 #include "cc/blimp/compositor_state_deserializer.h" |
24 #include "cc/blimp/image_serialization_processor.h" | 24 #include "cc/blimp/image_serialization_processor.h" |
25 #include "cc/layers/layer.h" | 25 #include "cc/layers/layer.h" |
26 #include "cc/layers/surface_layer.h" | 26 #include "cc/layers/surface_layer.h" |
27 #include "cc/output/compositor_frame_sink.h" | 27 #include "cc/output/compositor_frame_sink.h" |
28 #include "cc/proto/compositor_message.pb.h" | 28 #include "cc/proto/compositor_message.pb.h" |
29 #include "cc/surfaces/surface.h" | 29 #include "cc/surfaces/surface.h" |
30 #include "cc/surfaces/surface_factory.h" | 30 #include "cc/surfaces/surface_factory.h" |
31 #include "cc/surfaces/surface_id_allocator.h" | 31 #include "cc/surfaces/surface_id_allocator.h" |
| 32 #include "cc/surfaces/surface_info.h" |
32 #include "cc/surfaces/surface_manager.h" | 33 #include "cc/surfaces/surface_manager.h" |
33 #include "cc/trees/layer_tree_host_in_process.h" | 34 #include "cc/trees/layer_tree_host_in_process.h" |
34 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 35 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
35 #include "net/base/net_errors.h" | 36 #include "net/base/net_errors.h" |
36 #include "ui/gl/gl_surface.h" | 37 #include "ui/gl/gl_surface.h" |
37 | 38 |
38 namespace blimp { | 39 namespace blimp { |
39 namespace client { | 40 namespace client { |
40 | 41 |
41 namespace { | 42 namespace { |
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 local_frame_id_ = surface_id_allocator_->GenerateId(); | 328 local_frame_id_ = surface_id_allocator_->GenerateId(); |
328 surface_factory_->Create(local_frame_id_); | 329 surface_factory_->Create(local_frame_id_); |
329 current_surface_size_ = surface_size; | 330 current_surface_size_ = surface_size; |
330 | 331 |
331 // manager must outlive compositors using it. | 332 // manager must outlive compositors using it. |
332 cc::SurfaceManager* surface_manager = | 333 cc::SurfaceManager* surface_manager = |
333 GetEmbedderDeps()->GetSurfaceManager(); | 334 GetEmbedderDeps()->GetSurfaceManager(); |
334 scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create( | 335 scoped_refptr<cc::SurfaceLayer> content_layer = cc::SurfaceLayer::Create( |
335 base::Bind(&SatisfyCallback, base::Unretained(surface_manager)), | 336 base::Bind(&SatisfyCallback, base::Unretained(surface_manager)), |
336 base::Bind(&RequireCallback, base::Unretained(surface_manager))); | 337 base::Bind(&RequireCallback, base::Unretained(surface_manager))); |
337 content_layer->SetSurfaceId( | 338 content_layer->SetSurfaceInfo(cc::SurfaceInfo( |
338 cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f, | 339 cc::SurfaceId(surface_factory_->frame_sink_id(), local_frame_id_), 1.f, |
339 surface_size); | 340 surface_size)); |
340 content_layer->SetBounds(current_surface_size_); | 341 content_layer->SetBounds(current_surface_size_); |
341 content_layer->SetIsDrawable(true); | 342 content_layer->SetIsDrawable(true); |
342 content_layer->SetContentsOpaque(true); | 343 content_layer->SetContentsOpaque(true); |
343 | 344 |
344 layer_->AddChild(content_layer); | 345 layer_->AddChild(content_layer); |
345 } | 346 } |
346 | 347 |
347 surface_factory_->SubmitCompositorFrame( | 348 surface_factory_->SubmitCompositorFrame( |
348 local_frame_id_, std::move(frame), | 349 local_frame_id_, std::move(frame), |
349 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, | 350 base::Bind(&BlimpCompositor::SubmitCompositorFrameAck, |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 // Destroy the old LayerTreeHost state. | 464 // Destroy the old LayerTreeHost state. |
464 host_.reset(); | 465 host_.reset(); |
465 | 466 |
466 // Cancel any outstanding CompositorFrameSink requests. That way if we get an | 467 // Cancel any outstanding CompositorFrameSink requests. That way if we get an |
467 // async callback related to the old request we know to drop it. | 468 // async callback related to the old request we know to drop it. |
468 compositor_frame_sink_request_pending_ = false; | 469 compositor_frame_sink_request_pending_ = false; |
469 } | 470 } |
470 | 471 |
471 } // namespace client | 472 } // namespace client |
472 } // namespace blimp | 473 } // namespace blimp |
OLD | NEW |