| 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 "mojo/services/surfaces/surfaces_impl.h" | 5 #include "mojo/services/surfaces/surfaces_impl.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/resources/returned_resource.h" | 8 #include "cc/resources/returned_resource.h" |
| 9 #include "cc/surfaces/display.h" | 9 #include "cc/surfaces/display.h" |
| 10 #include "cc/surfaces/surface_id_allocator.h" | 10 #include "cc/surfaces/surface_id_allocator.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 cc::SurfaceId cc_id = id.To<cc::SurfaceId>(); | 74 cc::SurfaceId cc_id = id.To<cc::SurfaceId>(); |
| 75 if (cc::SurfaceIdAllocator::NamespaceForId(cc_id) != id_namespace_) { | 75 if (cc::SurfaceIdAllocator::NamespaceForId(cc_id) != id_namespace_) { |
| 76 // Bad message, do something bad to the caller? | 76 // Bad message, do something bad to the caller? |
| 77 LOG(FATAL) << "Received request for id " << cc_id.id << " namespace " | 77 LOG(FATAL) << "Received request for id " << cc_id.id << " namespace " |
| 78 << cc::SurfaceIdAllocator::NamespaceForId(cc_id) | 78 << cc::SurfaceIdAllocator::NamespaceForId(cc_id) |
| 79 << " should be namespace " << id_namespace_; | 79 << " should be namespace " << id_namespace_; |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 if (!display_) { | 82 if (!display_) { |
| 83 display_.reset(new cc::Display(this, manager_, NULL, NULL)); | 83 cc::RendererSettings settings; |
| 84 display_.reset(new cc::Display(this, manager_, nullptr, nullptr, settings)); |
| 84 client_->SetDisplay(display_.get()); | 85 client_->SetDisplay(display_.get()); |
| 85 display_->Initialize(make_scoped_ptr(new DirectOutputSurface( | 86 display_->Initialize(make_scoped_ptr(new DirectOutputSurface( |
| 86 new ContextProviderMojo(command_buffer_handle_.Pass())))); | 87 new ContextProviderMojo(command_buffer_handle_.Pass())))); |
| 87 } | 88 } |
| 88 factory_.Create(cc_id, size.To<gfx::Size>()); | 89 factory_.Create(cc_id, size.To<gfx::Size>()); |
| 89 display_->Resize(cc_id, size.To<gfx::Size>(), 1.f); | 90 display_->Resize(cc_id, size.To<gfx::Size>(), 1.f); |
| 90 } | 91 } |
| 91 | 92 |
| 92 void SurfacesImpl::ReturnResources(const cc::ReturnedResourceArray& resources) { | 93 void SurfacesImpl::ReturnResources(const cc::ReturnedResourceArray& resources) { |
| 93 Array<ReturnedResourcePtr> ret(resources.size()); | 94 Array<ReturnedResourcePtr> ret(resources.size()); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 110 base::TimeDelta interval) { | 111 base::TimeDelta interval) { |
| 111 } | 112 } |
| 112 | 113 |
| 113 void SurfacesImpl::OutputSurfaceLost() { | 114 void SurfacesImpl::OutputSurfaceLost() { |
| 114 } | 115 } |
| 115 | 116 |
| 116 void SurfacesImpl::SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) { | 117 void SurfacesImpl::SetMemoryPolicy(const cc::ManagedMemoryPolicy& policy) { |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace mojo | 120 } // namespace mojo |
| OLD | NEW |