| 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 "cc/surfaces/surface_factory.h" | 5 #include "cc/surfaces/surface_factory.h" |
| 6 | 6 |
| 7 #include "cc/output/compositor_frame.h" | 7 #include "cc/output/compositor_frame.h" |
| 8 #include "cc/surfaces/surface.h" | 8 #include "cc/surfaces/surface.h" |
| 9 #include "cc/surfaces/surface_manager.h" | 9 #include "cc/surfaces/surface_manager.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 void SurfaceFactory::Destroy(SurfaceId surface_id) { | 29 void SurfaceFactory::Destroy(SurfaceId surface_id) { |
| 30 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 30 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
| 31 DCHECK(it != surface_map_.end()); | 31 DCHECK(it != surface_map_.end()); |
| 32 DCHECK(it->second->factory() == this); | 32 DCHECK(it->second->factory() == this); |
| 33 manager_->DeregisterSurface(surface_id); | 33 manager_->DeregisterSurface(surface_id); |
| 34 surface_map_.erase(it); | 34 surface_map_.erase(it); |
| 35 } | 35 } |
| 36 | 36 |
| 37 void SurfaceFactory::SubmitFrame(SurfaceId surface_id, | 37 void SurfaceFactory::SubmitFrame(SurfaceId surface_id, |
| 38 scoped_ptr<CompositorFrame> frame) { | 38 scoped_ptr<CompositorFrame> frame, |
| 39 const base::Closure& callback) { |
| 39 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 40 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
| 40 DCHECK(it != surface_map_.end()); | 41 DCHECK(it != surface_map_.end()); |
| 41 DCHECK(it->second->factory() == this); | 42 DCHECK(it->second->factory() == this); |
| 42 it->second->QueueFrame(frame.Pass()); | 43 it->second->QueueFrame(frame.Pass(), callback); |
| 43 manager_->SurfaceModified(surface_id); | 44 manager_->SurfaceModified(surface_id); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void SurfaceFactory::ReceiveFromChild( | 47 void SurfaceFactory::ReceiveFromChild( |
| 47 const TransferableResourceArray& resources) { | 48 const TransferableResourceArray& resources) { |
| 48 holder_.ReceiveFromChild(resources); | 49 holder_.ReceiveFromChild(resources); |
| 49 } | 50 } |
| 50 | 51 |
| 51 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { | 52 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { |
| 52 holder_.RefResources(resources); | 53 holder_.RefResources(resources); |
| 53 } | 54 } |
| 54 | 55 |
| 55 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { | 56 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { |
| 56 holder_.UnrefResources(resources); | 57 holder_.UnrefResources(resources); |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace cc | 60 } // namespace cc |
| OLD | NEW |