| 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 "components/view_manager/surfaces/surfaces_impl.h" | 5 #include "components/view_manager/surfaces/surfaces_impl.h" |
| 6 | 6 |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "cc/output/compositor_frame.h" | 8 #include "cc/output/compositor_frame.h" |
| 9 #include "cc/resources/returned_resource.h" | 9 #include "cc/resources/returned_resource.h" |
| 10 #include "cc/surfaces/surface_id_allocator.h" | 10 #include "cc/surfaces/surface_id_allocator.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 void SurfacesImpl::SetResourceReturner(mojo::ResourceReturnerPtr returner) { | 52 void SurfacesImpl::SetResourceReturner(mojo::ResourceReturnerPtr returner) { |
| 53 returner_ = returner.Pass(); | 53 returner_ = returner.Pass(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 void SurfacesImpl::CreateSurface(uint32_t local_id) { | 56 void SurfacesImpl::CreateSurface(uint32_t local_id) { |
| 57 factory_.Create(QualifyIdentifier(local_id)); | 57 factory_.Create(QualifyIdentifier(local_id)); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void SurfacesImpl::SubmitFrame(uint32_t local_id, | 60 void SurfacesImpl::SubmitFrame(uint32_t local_id, |
| 61 mojo::FramePtr frame, | 61 mojo::CompositorFramePtr frame, |
| 62 const mojo::Closure& callback) { | 62 const mojo::Closure& callback) { |
| 63 TRACE_EVENT0("mojo", "SurfacesImpl::SubmitFrame"); | 63 TRACE_EVENT0("mojo", "SurfacesImpl::SubmitFrame"); |
| 64 factory_.SubmitFrame(QualifyIdentifier(local_id), | 64 factory_.SubmitFrame(QualifyIdentifier(local_id), |
| 65 frame.To<scoped_ptr<cc::CompositorFrame>>(), | 65 frame.To<scoped_ptr<cc::CompositorFrame>>(), |
| 66 base::Bind(&CallCallback, callback)); | 66 base::Bind(&CallCallback, callback)); |
| 67 state_->scheduler()->SetNeedsDraw(); | 67 state_->scheduler()->SetNeedsDraw(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void SurfacesImpl::DestroySurface(uint32_t local_id) { | 70 void SurfacesImpl::DestroySurface(uint32_t local_id) { |
| 71 factory_.Destroy(QualifyIdentifier(local_id)); | 71 factory_.Destroy(QualifyIdentifier(local_id)); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 85 // Only CloseConnection should be allowed to destroy this object. | 85 // Only CloseConnection should be allowed to destroy this object. |
| 86 DCHECK(connection_closed_); | 86 DCHECK(connection_closed_); |
| 87 factory_.DestroyAll(); | 87 factory_.DestroyAll(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 cc::SurfaceId SurfacesImpl::QualifyIdentifier(uint32_t local_id) { | 90 cc::SurfaceId SurfacesImpl::QualifyIdentifier(uint32_t local_id) { |
| 91 return cc::SurfaceId(static_cast<uint64_t>(id_namespace_) << 32 | local_id); | 91 return cc::SurfaceId(static_cast<uint64_t>(id_namespace_) << 32 | local_id); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace mojo | 94 } // namespace mojo |
| OLD | NEW |