| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/trace_event/trace_event.h" | 9 #include "base/trace_event/trace_event.h" |
| 10 #include "cc/output/compositor_frame.h" | 10 #include "cc/output/compositor_frame.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 void SurfaceFactory::SetPreviousFrameSurface(SurfaceId new_id, | 56 void SurfaceFactory::SetPreviousFrameSurface(SurfaceId new_id, |
| 57 SurfaceId old_id) { | 57 SurfaceId old_id) { |
| 58 OwningSurfaceMap::iterator it = surface_map_.find(new_id); | 58 OwningSurfaceMap::iterator it = surface_map_.find(new_id); |
| 59 DCHECK(it != surface_map_.end()); | 59 DCHECK(it != surface_map_.end()); |
| 60 Surface* old_surface = manager_->GetSurfaceForId(old_id); | 60 Surface* old_surface = manager_->GetSurfaceForId(old_id); |
| 61 if (old_surface) { | 61 if (old_surface) { |
| 62 it->second->SetPreviousFrameSurface(old_surface); | 62 it->second->SetPreviousFrameSurface(old_surface); |
| 63 } | 63 } |
| 64 } | 64 } |
| 65 | 65 |
| 66 void SurfaceFactory::SetSurfaceGpuMemoryBufferClientId( |
| 67 SurfaceId surface_id, |
| 68 int gpu_memory_buffer_client_id) { |
| 69 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
| 70 DCHECK(it != surface_map_.end()); |
| 71 it->second->SetGpuMemoryBufferClientId(gpu_memory_buffer_client_id); |
| 72 } |
| 73 |
| 66 void SurfaceFactory::SubmitCompositorFrame( | 74 void SurfaceFactory::SubmitCompositorFrame( |
| 67 SurfaceId surface_id, | 75 SurfaceId surface_id, |
| 68 std::unique_ptr<CompositorFrame> frame, | 76 std::unique_ptr<CompositorFrame> frame, |
| 69 const DrawCallback& callback) { | 77 const DrawCallback& callback) { |
| 70 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); | 78 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); |
| 71 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 79 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
| 72 DCHECK(it != surface_map_.end()); | 80 DCHECK(it != surface_map_.end()); |
| 73 DCHECK(it->second->factory().get() == this); | 81 DCHECK(it->second->factory().get() == this); |
| 74 it->second->QueueFrame(std::move(frame), callback); | 82 it->second->QueueFrame(std::move(frame), callback); |
| 75 if (!manager_->SurfaceModified(surface_id)) { | 83 if (!manager_->SurfaceModified(surface_id)) { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 103 | 111 |
| 104 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { | 112 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { |
| 105 holder_.RefResources(resources); | 113 holder_.RefResources(resources); |
| 106 } | 114 } |
| 107 | 115 |
| 108 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { | 116 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { |
| 109 holder_.UnrefResources(resources); | 117 holder_.UnrefResources(resources); |
| 110 } | 118 } |
| 111 | 119 |
| 112 } // namespace cc | 120 } // namespace cc |
| OLD | NEW |