| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 std::unique_ptr<CopyOutputRequest> copy_request) { | 87 std::unique_ptr<CopyOutputRequest> copy_request) { |
| 88 if (!current_surface_) { | 88 if (!current_surface_) { |
| 89 copy_request->SendEmptyResult(); | 89 copy_request->SendEmptyResult(); |
| 90 return; | 90 return; |
| 91 } | 91 } |
| 92 DCHECK(current_surface_->factory().get() == this); | 92 DCHECK(current_surface_->factory().get() == this); |
| 93 current_surface_->RequestCopyOfOutput(std::move(copy_request)); | 93 current_surface_->RequestCopyOfOutput(std::move(copy_request)); |
| 94 manager_->SurfaceModified(current_surface_->surface_id()); | 94 manager_->SurfaceModified(current_surface_->surface_id()); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void SurfaceFactory::ClearSurface() { | |
| 98 if (!current_surface_) | |
| 99 return; | |
| 100 current_surface_->EvictFrame(); | |
| 101 manager_->SurfaceModified(current_surface_->surface_id()); | |
| 102 } | |
| 103 | |
| 104 void SurfaceFactory::WillDrawSurface(const LocalFrameId& id, | 97 void SurfaceFactory::WillDrawSurface(const LocalFrameId& id, |
| 105 const gfx::Rect& damage_rect) { | 98 const gfx::Rect& damage_rect) { |
| 106 client_->WillDrawSurface(id, damage_rect); | 99 client_->WillDrawSurface(id, damage_rect); |
| 107 } | 100 } |
| 108 | 101 |
| 109 void SurfaceFactory::ReceiveFromChild( | 102 void SurfaceFactory::ReceiveFromChild( |
| 110 const TransferableResourceArray& resources) { | 103 const TransferableResourceArray& resources) { |
| 111 holder_.ReceiveFromChild(resources); | 104 holder_.ReceiveFromChild(resources); |
| 112 } | 105 } |
| 113 | 106 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 126 manager_->RegisterSurface(surface.get()); | 119 manager_->RegisterSurface(surface.get()); |
| 127 return surface; | 120 return surface; |
| 128 } | 121 } |
| 129 | 122 |
| 130 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { | 123 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { |
| 131 if (manager_) | 124 if (manager_) |
| 132 manager_->Destroy(std::move(surface)); | 125 manager_->Destroy(std::move(surface)); |
| 133 } | 126 } |
| 134 | 127 |
| 135 } // namespace cc | 128 } // namespace cc |
| OLD | NEW |