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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 std::unique_ptr<CopyOutputRequest> copy_request) { | 80 std::unique_ptr<CopyOutputRequest> copy_request) { |
81 if (!current_surface_) { | 81 if (!current_surface_) { |
82 copy_request->SendEmptyResult(); | 82 copy_request->SendEmptyResult(); |
83 return; | 83 return; |
84 } | 84 } |
85 DCHECK(current_surface_->factory().get() == this); | 85 DCHECK(current_surface_->factory().get() == this); |
86 current_surface_->RequestCopyOfOutput(std::move(copy_request)); | 86 current_surface_->RequestCopyOfOutput(std::move(copy_request)); |
87 manager_->SurfaceModified(current_surface_->surface_id()); | 87 manager_->SurfaceModified(current_surface_->surface_id()); |
88 } | 88 } |
89 | 89 |
90 void SurfaceFactory::ClearSurface() { | |
91 if (!current_surface_) | |
92 return; | |
93 current_surface_->EvictFrame(); | |
94 manager_->SurfaceModified(current_surface_->surface_id()); | |
95 } | |
96 | |
97 void SurfaceFactory::ReceiveFromChild( | 90 void SurfaceFactory::ReceiveFromChild( |
98 const TransferableResourceArray& resources) { | 91 const TransferableResourceArray& resources) { |
99 holder_.ReceiveFromChild(resources); | 92 holder_.ReceiveFromChild(resources); |
100 } | 93 } |
101 | 94 |
102 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { | 95 void SurfaceFactory::RefResources(const TransferableResourceArray& resources) { |
103 holder_.RefResources(resources); | 96 holder_.RefResources(resources); |
104 } | 97 } |
105 | 98 |
106 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { | 99 void SurfaceFactory::UnrefResources(const ReturnedResourceArray& resources) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 surface->AddObserver(this); | 141 surface->AddObserver(this); |
149 return surface; | 142 return surface; |
150 } | 143 } |
151 | 144 |
152 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { | 145 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { |
153 surface->RemoveObserver(this); | 146 surface->RemoveObserver(this); |
154 manager_->DestroySurface(std::move(surface)); | 147 manager_->DestroySurface(std::move(surface)); |
155 } | 148 } |
156 | 149 |
157 } // namespace cc | 150 } // namespace cc |
OLD | NEW |