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/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 client_->ReferencedSurfacesChanged(surface->surface_id().local_surface_id(), | 121 client_->ReferencedSurfacesChanged(surface->surface_id().local_surface_id(), |
122 surface->active_referenced_surfaces()); | 122 surface->active_referenced_surfaces()); |
123 if (!manager_->SurfaceModified(surface->surface_id())) { | 123 if (!manager_->SurfaceModified(surface->surface_id())) { |
124 TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); | 124 TRACE_EVENT_INSTANT0("cc", "Damage not visible.", TRACE_EVENT_SCOPE_THREAD); |
125 surface->RunDrawCallback(); | 125 surface->RunDrawCallback(); |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 void SurfaceFactory::OnSurfaceDependenciesChanged( | 129 void SurfaceFactory::OnSurfaceDependenciesChanged( |
130 Surface* surface, | 130 Surface* surface, |
131 const SurfaceDependencies& added_dependencies, | 131 const base::flat_set<SurfaceId>& added_dependencies, |
132 const SurfaceDependencies& removed_dependencies) {} | 132 const base::flat_set<SurfaceId>& removed_dependencies) {} |
133 | 133 |
134 void SurfaceFactory::OnSurfaceDiscarded(Surface* surface) {} | 134 void SurfaceFactory::OnSurfaceDiscarded(Surface* surface) {} |
135 | 135 |
136 std::unique_ptr<Surface> SurfaceFactory::Create( | 136 std::unique_ptr<Surface> SurfaceFactory::Create( |
137 const LocalSurfaceId& local_surface_id) { | 137 const LocalSurfaceId& local_surface_id) { |
138 seen_first_frame_activation_ = false; | 138 seen_first_frame_activation_ = false; |
139 std::unique_ptr<Surface> surface = | 139 std::unique_ptr<Surface> surface = |
140 manager_->CreateSurface(weak_factory_.GetWeakPtr(), local_surface_id); | 140 manager_->CreateSurface(weak_factory_.GetWeakPtr(), local_surface_id); |
141 surface->AddObserver(this); | 141 surface->AddObserver(this); |
142 return surface; | 142 return surface; |
143 } | 143 } |
144 | 144 |
145 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { | 145 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { |
146 surface->RemoveObserver(this); | 146 surface->RemoveObserver(this); |
147 manager_->DestroySurface(std::move(surface)); | 147 manager_->DestroySurface(std::move(surface)); |
148 } | 148 } |
149 | 149 |
150 } // namespace cc | 150 } // namespace cc |
OLD | NEW |