Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/gpu/compositor_output_surface.h" | 5 #include "content/renderer/gpu/compositor_output_surface.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 client->SetMemoryPolicy(cc::ManagedMemoryPolicy( | 74 client->SetMemoryPolicy(cc::ManagedMemoryPolicy( |
| 75 128 * 1024 * 1024, | 75 128 * 1024 * 1024, |
| 76 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE, | 76 gpu::MemoryAllocation::CUTOFF_ALLOW_NICE_TO_HAVE, |
| 77 base::SharedMemory::GetHandleLimit() / 3)); | 77 base::SharedMemory::GetHandleLimit() / 3)); |
| 78 } | 78 } |
| 79 | 79 |
| 80 return true; | 80 return true; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void CompositorOutputSurface::DetachFromClient() { | 83 void CompositorOutputSurface::DetachFromClient() { |
| 84 if (!HasClient()) | 84 if (output_surface_proxy_) { |
|
enne (OOO)
2016/05/06 19:43:30
I don't understand the changes here in this functi
danakj
2016/05/06 20:15:27
This calls cc::OutputSurface::DetachFromClient whi
| |
| 85 return; | |
| 86 if (output_surface_proxy_.get()) | |
| 87 output_surface_proxy_->ClearOutputSurface(); | 85 output_surface_proxy_->ClearOutputSurface(); |
| 88 output_surface_filter_->RemoveHandlerOnCompositorThread( | 86 output_surface_filter_->RemoveHandlerOnCompositorThread( |
|
danakj
2016/05/06 20:15:27
Moving this inside the if is needed because we can
| |
| 89 routing_id_, output_surface_filter_handler_); | 87 routing_id_, output_surface_filter_handler_); |
| 88 } | |
| 90 cc::OutputSurface::DetachFromClient(); | 89 cc::OutputSurface::DetachFromClient(); |
| 91 } | 90 } |
| 92 | 91 |
| 93 void CompositorOutputSurface::ShortcutSwapAck( | 92 void CompositorOutputSurface::ShortcutSwapAck( |
| 94 uint32_t output_surface_id, | 93 uint32_t output_surface_id, |
| 95 std::unique_ptr<cc::GLFrameData> gl_frame_data) { | 94 std::unique_ptr<cc::GLFrameData> gl_frame_data) { |
| 96 if (!layout_test_previous_frame_ack_) { | 95 if (!layout_test_previous_frame_ack_) { |
| 97 layout_test_previous_frame_ack_.reset(new cc::CompositorFrameAck); | 96 layout_test_previous_frame_ack_.reset(new cc::CompositorFrameAck); |
| 98 layout_test_previous_frame_ack_->gl_frame_data.reset(new cc::GLFrameData); | 97 layout_test_previous_frame_ack_->gl_frame_data.reset(new cc::GLFrameData); |
| 99 } | 98 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 if (output_surface_id != output_surface_id_) | 196 if (output_surface_id != output_surface_id_) |
| 198 return; | 197 return; |
| 199 ReclaimResources(&ack); | 198 ReclaimResources(&ack); |
| 200 } | 199 } |
| 201 | 200 |
| 202 bool CompositorOutputSurface::Send(IPC::Message* message) { | 201 bool CompositorOutputSurface::Send(IPC::Message* message) { |
| 203 return message_sender_->Send(message); | 202 return message_sender_->Send(message); |
| 204 } | 203 } |
| 205 | 204 |
| 206 } // namespace content | 205 } // namespace content |
| OLD | NEW |