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