| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 Surface* surface, | 109 Surface* surface, |
| 110 const std::vector<SurfaceId>* active_referenced_surfaces, | 110 const std::vector<SurfaceId>* active_referenced_surfaces, |
| 111 const std::vector<SurfaceId>* pending_referenced_surfaces) { | 111 const std::vector<SurfaceId>* pending_referenced_surfaces) { |
| 112 client_->ReferencedSurfacesChanged(surface->surface_id().local_surface_id(), | 112 client_->ReferencedSurfacesChanged(surface->surface_id().local_surface_id(), |
| 113 active_referenced_surfaces, | 113 active_referenced_surfaces, |
| 114 pending_referenced_surfaces); | 114 pending_referenced_surfaces); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void SurfaceFactory::OnSurfaceActivated(Surface* surface) { | 117 void SurfaceFactory::OnSurfaceActivated(Surface* surface) { |
| 118 DCHECK(surface->HasActiveFrame()); | 118 DCHECK(surface->HasActiveFrame()); |
| 119 |
| 120 client_->PendingFrameActivated(surface->surface_id().local_surface_id()); |
| 121 |
| 119 if (seen_first_frame_activation_) | 122 if (seen_first_frame_activation_) |
| 120 return; | 123 return; |
| 121 | 124 |
| 122 seen_first_frame_activation_ = true; | 125 seen_first_frame_activation_ = true; |
| 123 | 126 |
| 124 const CompositorFrame& frame = surface->GetActiveFrame(); | 127 const CompositorFrame& frame = surface->GetActiveFrame(); |
| 125 // CompositorFrames might not be populated with a RenderPass in unit tests. | 128 // CompositorFrames might not be populated with a RenderPass in unit tests. |
| 126 gfx::Size frame_size; | 129 gfx::Size frame_size; |
| 127 if (!frame.render_pass_list.empty()) | 130 if (!frame.render_pass_list.empty()) |
| 128 frame_size = frame.render_pass_list.back()->output_rect.size(); | 131 frame_size = frame.render_pass_list.back()->output_rect.size(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 148 surface->AddObserver(this); | 151 surface->AddObserver(this); |
| 149 return surface; | 152 return surface; |
| 150 } | 153 } |
| 151 | 154 |
| 152 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { | 155 void SurfaceFactory::Destroy(std::unique_ptr<Surface> surface) { |
| 153 surface->RemoveObserver(this); | 156 surface->RemoveObserver(this); |
| 154 manager_->DestroySurface(std::move(surface)); | 157 manager_->DestroySurface(std::move(surface)); |
| 155 } | 158 } |
| 156 | 159 |
| 157 } // namespace cc | 160 } // namespace cc |
| OLD | NEW |