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