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

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: detach: . 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
« no previous file with comments | « 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 (!HasClient())
85 return; 85 return;
86 if (output_surface_proxy_.get()) 86 if (output_surface_proxy_) {
87 output_surface_proxy_->ClearOutputSurface(); 87 output_surface_proxy_->ClearOutputSurface();
88 output_surface_filter_->RemoveHandlerOnCompositorThread( 88 output_surface_filter_->RemoveHandlerOnCompositorThread(
89 routing_id_, output_surface_filter_handler_); 89 routing_id_, output_surface_filter_handler_);
90 }
90 cc::OutputSurface::DetachFromClient(); 91 cc::OutputSurface::DetachFromClient();
91 } 92 }
92 93
93 void CompositorOutputSurface::ShortcutSwapAck( 94 void CompositorOutputSurface::ShortcutSwapAck(
94 uint32_t output_surface_id, 95 uint32_t output_surface_id,
95 std::unique_ptr<cc::GLFrameData> gl_frame_data) { 96 std::unique_ptr<cc::GLFrameData> gl_frame_data) {
96 if (!layout_test_previous_frame_ack_) { 97 if (!layout_test_previous_frame_ack_) {
97 layout_test_previous_frame_ack_.reset(new cc::CompositorFrameAck); 98 layout_test_previous_frame_ack_.reset(new cc::CompositorFrameAck);
98 layout_test_previous_frame_ack_->gl_frame_data.reset(new cc::GLFrameData); 99 layout_test_previous_frame_ack_->gl_frame_data.reset(new cc::GLFrameData);
99 } 100 }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 if (output_surface_id != output_surface_id_) 198 if (output_surface_id != output_surface_id_)
198 return; 199 return;
199 ReclaimResources(&ack); 200 ReclaimResources(&ack);
200 } 201 }
201 202
202 bool CompositorOutputSurface::Send(IPC::Message* message) { 203 bool CompositorOutputSurface::Send(IPC::Message* message) {
203 return message_sender_->Send(message); 204 return message_sender_->Send(message);
204 } 205 }
205 206
206 } // namespace content 207 } // namespace content
OLDNEW
« no previous file with comments | « cc/output/output_surface.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698