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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 void SurfaceFactory::SubmitCompositorFrame(const SurfaceId& surface_id, | 69 void SurfaceFactory::SubmitCompositorFrame(const SurfaceId& surface_id, |
70 CompositorFrame frame, | 70 CompositorFrame frame, |
71 const DrawCallback& callback) { | 71 const DrawCallback& callback) { |
72 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); | 72 TRACE_EVENT0("cc", "SurfaceFactory::SubmitCompositorFrame"); |
73 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 73 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
74 DCHECK(it != surface_map_.end()); | 74 DCHECK(it != surface_map_.end()); |
75 DCHECK(it->second->factory().get() == this); | 75 DCHECK(it->second->factory().get() == this); |
76 it->second->QueueFrame(std::move(frame), callback); | 76 it->second->QueueFrame(std::move(frame), callback); |
77 if (!manager_->SurfaceModified(surface_id)) { | 77 if (!manager_->SurfaceModified(surface_id)) { |
78 TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); | 78 TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); |
79 it->second->RunDrawCallbacks(SurfaceDrawStatus::DRAW_SKIPPED); | 79 it->second->RunDrawCallbacks(); |
80 } | 80 } |
81 } | 81 } |
82 | 82 |
83 void SurfaceFactory::RequestCopyOfSurface( | 83 void SurfaceFactory::RequestCopyOfSurface( |
84 const SurfaceId& surface_id, | 84 const SurfaceId& surface_id, |
85 std::unique_ptr<CopyOutputRequest> copy_request) { | 85 std::unique_ptr<CopyOutputRequest> copy_request) { |
86 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); | 86 OwningSurfaceMap::iterator it = surface_map_.find(surface_id); |
87 if (it == surface_map_.end()) { | 87 if (it == surface_map_.end()) { |
88 copy_request->SendEmptyResult(); | 88 copy_request->SendEmptyResult(); |
89 return; | 89 return; |
(...skipping 15 matching lines...) Expand all Loading... |
105 | 105 |
106 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { | 106 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { |
107 holder_.RefResources(resources); | 107 holder_.RefResources(resources); |
108 } | 108 } |
109 | 109 |
110 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { | 110 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { |
111 holder_.UnrefResources(resources); | 111 holder_.UnrefResources(resources); |
112 } | 112 } |
113 | 113 |
114 } // namespace cc | 114 } // namespace cc |
OLD | NEW |