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

Side by Side Diff: gpu/ipc/client/gpu_channel_host.cc

Issue 1963263002: Fix Mac resize, delete more Mac code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix buidl.gn 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 | « gpu/ipc/client/DEPS ('k') | gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h » ('j') | 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 "gpu/ipc/client/gpu_channel_host.h" 5 #include "gpu/ipc/client/gpu_channel_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/atomic_sequence_num.h" 10 #include "base/atomic_sequence_num.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/location.h" 12 #include "base/location.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/posix/eintr_wrapper.h" 14 #include "base/posix/eintr_wrapper.h"
15 #include "base/profiler/scoped_tracker.h" 15 #include "base/profiler/scoped_tracker.h"
16 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
17 #include "base/thread_task_runner_handle.h" 17 #include "base/thread_task_runner_handle.h"
18 #include "base/threading/thread_restrictions.h" 18 #include "base/threading/thread_restrictions.h"
19 #include "base/trace_event/trace_event.h" 19 #include "base/trace_event/trace_event.h"
20 #include "build/build_config.h" 20 #include "build/build_config.h"
21 #include "gpu/ipc/client/command_buffer_proxy_impl.h" 21 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
22 #include "gpu/ipc/common/gpu_messages.h" 22 #include "gpu/ipc/common/gpu_messages.h"
23 #include "gpu/ipc/common/gpu_param_traits_macros.h" 23 #include "gpu/ipc/common/gpu_param_traits_macros.h"
24 #include "ipc/ipc_sync_message_filter.h" 24 #include "ipc/ipc_sync_message_filter.h"
25 #include "url/gurl.h" 25 #include "url/gurl.h"
26 26
27 #if defined(OS_MACOSX)
28 #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
29 #endif
30
27 using base::AutoLock; 31 using base::AutoLock;
28 32
29 namespace gpu { 33 namespace gpu {
30 namespace { 34 namespace {
31 35
32 // Global atomic to generate unique transfer buffer IDs. 36 // Global atomic to generate unique transfer buffer IDs.
33 base::StaticAtomicSequenceNumber g_next_transfer_buffer_id; 37 base::StaticAtomicSequenceNumber g_next_transfer_buffer_id;
34 38
35 } // namespace 39 } // namespace
36 40
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 const IPC::Message& message) { 443 const IPC::Message& message) {
440 // Never handle sync message replies or we will deadlock here. 444 // Never handle sync message replies or we will deadlock here.
441 if (message.is_reply()) 445 if (message.is_reply())
442 return false; 446 return false;
443 447
444 auto it = listeners_.find(message.routing_id()); 448 auto it = listeners_.find(message.routing_id());
445 if (it == listeners_.end()) 449 if (it == listeners_.end())
446 return false; 450 return false;
447 451
448 const ListenerInfo& info = it->second; 452 const ListenerInfo& info = it->second;
449 info.task_runner->PostTask( 453 scoped_refptr<base::SingleThreadTaskRunner> task_runner = info.task_runner;
454 #if defined(OS_MACOSX)
455 // On Mac, the IPCs ViewHostMsg_SwapCompositorFrame, ViewHostMsg_UpdateRect,
456 // and GpuCommandBufferMsg_SwapBuffersCompleted need to be handled in a
457 // nested message loop during resize.
458 if (message.type() == GpuCommandBufferMsg_SwapBuffersCompleted::ID)
459 task_runner = ui::WindowResizeHelperMac::Get()->task_runner();
piman 2016/05/10 22:24:16 This is called in the renderer - e.g. for pepper.
ccameron 2016/05/11 06:23:01 Good point -- moved the #if MAC parts into GpuProc
460 #endif
461 task_runner->PostTask(
450 FROM_HERE, 462 FROM_HERE,
451 base::Bind(base::IgnoreResult(&IPC::Listener::OnMessageReceived), 463 base::Bind(base::IgnoreResult(&IPC::Listener::OnMessageReceived),
452 info.listener, message)); 464 info.listener, message));
453 return true; 465 return true;
454 } 466 }
455 467
456 void GpuChannelHost::MessageFilter::OnChannelError() { 468 void GpuChannelHost::MessageFilter::OnChannelError() {
457 // Set the lost state before signalling the proxies. That way, if they 469 // Set the lost state before signalling the proxies. That way, if they
458 // themselves post a task to recreate the context, they will not try to re-use 470 // themselves post a task to recreate the context, they will not try to re-use
459 // this channel host. 471 // this channel host.
(...skipping 12 matching lines...) Expand all
472 484
473 listeners_.clear(); 485 listeners_.clear();
474 } 486 }
475 487
476 bool GpuChannelHost::MessageFilter::IsLost() const { 488 bool GpuChannelHost::MessageFilter::IsLost() const {
477 AutoLock lock(lock_); 489 AutoLock lock(lock_);
478 return lost_; 490 return lost_;
479 } 491 }
480 492
481 } // namespace gpu 493 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/DEPS ('k') | gpu/ipc/client/gpu_process_hosted_ca_layer_tree_params.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698