| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 void SurfaceFactory::SetSurfaceGpuMemoryBufferClientId( | 69 void SurfaceFactory::SetSurfaceGpuMemoryBufferClientId( |
| 70 SurfaceId surface_id, | 70 SurfaceId surface_id, |
| 71 int gpu_memory_buffer_client_id) { | 71 int gpu_memory_buffer_client_id) { |
| 72 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 72 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
| 73 DCHECK(it != surface_map_.end()); | 73 DCHECK(it != surface_map_.end()); |
| 74 it->second->SetGpuMemoryBufferClientId(gpu_memory_buffer_client_id); | 74 it->second->SetGpuMemoryBufferClientId(gpu_memory_buffer_client_id); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void SurfaceFactory::SubmitCompositorFrame(SurfaceId surface_id, | 77 void SurfaceFactory::SubmitCompositorFrame( |
| 78 CompositorFrame frame, | 78 SurfaceId surface_id, |
| 79 const DrawCallback& callback) { | 79 std::unique_ptr<CompositorFrame> frame, |
| 80 const DrawCallback& callback) { |
| 80 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); | 81 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); |
| 81 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 82 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
| 82 DCHECK(it != surface_map_.end()); | 83 DCHECK(it != surface_map_.end()); |
| 83 DCHECK(it->second->factory().get() == this); | 84 DCHECK(it->second->factory().get() == this); |
| 84 it->second->QueueFrame(std::move(frame), callback); | 85 it->second->QueueFrame(std::move(frame), callback); |
| 85 if (!manager_->SurfaceModified(surface_id)) { | 86 if (!manager_->SurfaceModified(surface_id)) { |
| 86 TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); | 87 TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); |
| 87 it->second->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED); | 88 it->second->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED); |
| 88 } | 89 } |
| 89 } | 90 } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 113 | 114 |
| 114 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { | 115 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { |
| 115 holder_.RefResources(resources); | 116 holder_.RefResources(resources); |
| 116 } | 117 } |
| 117 | 118 |
| 118 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { | 119 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { |
| 119 holder_.UnrefResources(resources); | 120 holder_.UnrefResources(resources); |
| 120 } | 121 } |
| 121 | 122 |
| 122 } // namespace cc | 123 } // namespace cc |
| OLD | NEW |