| 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 "services/surfaces/display_impl.h" | 5 #include "services/surfaces/display_impl.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/surfaces/display.h" | 8 #include "cc/surfaces/display.h" |
| 9 #include "mojo/converters/geometry/geometry_type_converters.h" | 9 #include "mojo/converters/geometry/geometry_type_converters.h" |
| 10 #include "mojo/converters/surfaces/surfaces_type_converters.h" | 10 #include "mojo/converters/surfaces/surfaces_type_converters.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 factory_.Create(cc_id_); | 41 factory_.Create(cc_id_); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void DisplayImpl::OnContextCreated(mojo::CommandBufferPtr gles2_client) { | 44 void DisplayImpl::OnContextCreated(mojo::CommandBufferPtr gles2_client) { |
| 45 DCHECK(!display_); | 45 DCHECK(!display_); |
| 46 | 46 |
| 47 cc::RendererSettings settings; | 47 cc::RendererSettings settings; |
| 48 display_.reset(new cc::Display(this, manager_, nullptr, nullptr, settings)); | 48 display_.reset(new cc::Display(this, manager_, nullptr, nullptr, settings)); |
| 49 scheduler_->AddDisplay(display_.get()); | 49 scheduler_->AddDisplay(display_.get()); |
| 50 display_->Initialize(make_scoped_ptr(new mojo::DirectOutputSurface( | 50 display_->Initialize(make_scoped_ptr(new mojo::DirectOutputSurface( |
| 51 new mojo::ContextProviderMojo(gles2_client.PassMessagePipe())))); | 51 new mojo::ContextProviderMojo( |
| 52 gles2_client.PassInterface().PassHandle())))); |
| 52 display_->Resize(last_submitted_frame_size_); | 53 display_->Resize(last_submitted_frame_size_); |
| 53 | 54 |
| 54 display_->SetSurfaceId(cc_id_, 1.f); | 55 display_->SetSurfaceId(cc_id_, 1.f); |
| 55 if (pending_frame_) | 56 if (pending_frame_) |
| 56 Draw(); | 57 Draw(); |
| 57 } | 58 } |
| 58 | 59 |
| 59 DisplayImpl::~DisplayImpl() { | 60 DisplayImpl::~DisplayImpl() { |
| 60 if (display_) { | 61 if (display_) { |
| 61 factory_.Destroy(cc_id_); | 62 factory_.Destroy(cc_id_); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 DCHECK(returner_); | 128 DCHECK(returner_); |
| 128 | 129 |
| 129 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); | 130 mojo::Array<mojo::ReturnedResourcePtr> ret(resources.size()); |
| 130 for (size_t i = 0; i < resources.size(); ++i) { | 131 for (size_t i = 0; i < resources.size(); ++i) { |
| 131 ret[i] = mojo::ReturnedResource::From(resources[i]); | 132 ret[i] = mojo::ReturnedResource::From(resources[i]); |
| 132 } | 133 } |
| 133 returner_->ReturnResources(ret.Pass()); | 134 returner_->ReturnResources(ret.Pass()); |
| 134 } | 135 } |
| 135 | 136 |
| 136 } // namespace surfaces | 137 } // namespace surfaces |
| OLD | NEW |