| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/renderer_host/delegated_frame_host.h" | 5 #include "content/browser/renderer_host/delegated_frame_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 tick_clock_(new base::DefaultTickClock()), | 68 tick_clock_(new base::DefaultTickClock()), |
| 69 last_output_surface_id_(0), | 69 last_output_surface_id_(0), |
| 70 pending_delegated_ack_count_(0), | 70 pending_delegated_ack_count_(0), |
| 71 skipped_frames_(false), | 71 skipped_frames_(false), |
| 72 background_color_(SK_ColorRED), | 72 background_color_(SK_ColorRED), |
| 73 current_scale_factor_(1.f), | 73 current_scale_factor_(1.f), |
| 74 can_lock_compositor_(YES_CAN_LOCK), | 74 can_lock_compositor_(YES_CAN_LOCK), |
| 75 delegated_frame_evictor_(new DelegatedFrameEvictor(this)) { | 75 delegated_frame_evictor_(new DelegatedFrameEvictor(this)) { |
| 76 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 76 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
| 77 factory->GetContextFactory()->AddObserver(this); | 77 factory->GetContextFactory()->AddObserver(this); |
| 78 id_allocator_ = factory->GetContextFactory()->CreateSurfaceIdAllocator(); | 78 id_allocator_.reset(new cc::SurfaceIdAllocator( |
| 79 factory->GetContextFactory()->AllocateSurfaceClientId())); |
| 79 factory->GetSurfaceManager()->RegisterSurfaceFactoryClient( | 80 factory->GetSurfaceManager()->RegisterSurfaceFactoryClient( |
| 80 id_allocator_->client_id(), this); | 81 id_allocator_->client_id(), this); |
| 81 } | 82 } |
| 82 | 83 |
| 83 void DelegatedFrameHost::WasShown(const ui::LatencyInfo& latency_info) { | 84 void DelegatedFrameHost::WasShown(const ui::LatencyInfo& latency_info) { |
| 84 delegated_frame_evictor_->SetVisible(true); | 85 delegated_frame_evictor_->SetVisible(true); |
| 85 | 86 |
| 86 if (surface_id_.is_null() && !released_front_lock_.get()) { | 87 if (surface_id_.is_null() && !released_front_lock_.get()) { |
| 87 if (compositor_) | 88 if (compositor_) |
| 88 released_front_lock_ = compositor_->GetCompositorLock(); | 89 released_front_lock_ = compositor_->GetCompositorLock(); |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 899 cc::SurfaceManager* manager = factory->GetSurfaceManager(); | 900 cc::SurfaceManager* manager = factory->GetSurfaceManager(); |
| 900 new_layer->SetShowSurface( | 901 new_layer->SetShowSurface( |
| 901 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), | 902 surface_id_, base::Bind(&SatisfyCallback, base::Unretained(manager)), |
| 902 base::Bind(&RequireCallback, base::Unretained(manager)), | 903 base::Bind(&RequireCallback, base::Unretained(manager)), |
| 903 current_surface_size_, current_scale_factor_, | 904 current_surface_size_, current_scale_factor_, |
| 904 current_frame_size_in_dip_); | 905 current_frame_size_in_dip_); |
| 905 } | 906 } |
| 906 } | 907 } |
| 907 | 908 |
| 908 } // namespace content | 909 } // namespace content |
| OLD | NEW |