Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(348)

Side by Side Diff: content/renderer/gpu/compositor_output_surface.cc

Issue 1949753007: Detach the output surface if bind fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/output/output_surface.cc ('K') | « cc/output/output_surface.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« cc/output/output_surface.cc ('K') | « cc/output/output_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698