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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
6 #include <windows.h> | 6 #include <windows.h> |
7 #endif | 7 #endif |
8 | 8 |
9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
10 | 10 |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
578 } | 578 } |
579 | 579 |
580 void GpuChannel::OnScheduled() { | 580 void GpuChannel::OnScheduled() { |
581 if (handle_messages_scheduled_) | 581 if (handle_messages_scheduled_) |
582 return; | 582 return; |
583 // Post a task to handle any deferred messages. The deferred message queue is | 583 // Post a task to handle any deferred messages. The deferred message queue is |
584 // not emptied here, which ensures that OnMessageReceived will continue to | 584 // not emptied here, which ensures that OnMessageReceived will continue to |
585 // defer newly received messages until the ones in the queue have all been | 585 // defer newly received messages until the ones in the queue have all been |
586 // handled by HandleMessage. HandleMessage is invoked as a | 586 // handled by HandleMessage. HandleMessage is invoked as a |
587 // task to prevent reentrancy. | 587 // task to prevent reentrancy. |
588 MessageLoop::current()->PostTask( | 588 base::MessageLoop::current()->PostTask( |
589 FROM_HERE, | 589 FROM_HERE, |
590 base::Bind(&GpuChannel::HandleMessage, weak_factory_.GetWeakPtr())); | 590 base::Bind(&GpuChannel::HandleMessage, weak_factory_.GetWeakPtr())); |
591 handle_messages_scheduled_ = true; | 591 handle_messages_scheduled_ = true; |
592 } | 592 } |
593 | 593 |
594 void GpuChannel::StubSchedulingChanged(bool scheduled) { | 594 void GpuChannel::StubSchedulingChanged(bool scheduled) { |
595 bool a_stub_was_descheduled = num_stubs_descheduled_ > 0; | 595 bool a_stub_was_descheduled = num_stubs_descheduled_ > 0; |
596 if (scheduled) { | 596 if (scheduled) { |
597 num_stubs_descheduled_--; | 597 num_stubs_descheduled_--; |
598 OnScheduled(); | 598 OnScheduled(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 image_id); | 696 image_id); |
697 | 697 |
698 image_manager_->RemoveImage(image_id); | 698 image_manager_->RemoveImage(image_id); |
699 } | 699 } |
700 | 700 |
701 void GpuChannel::LoseAllContexts() { | 701 void GpuChannel::LoseAllContexts() { |
702 gpu_channel_manager_->LoseAllContexts(); | 702 gpu_channel_manager_->LoseAllContexts(); |
703 } | 703 } |
704 | 704 |
705 void GpuChannel::DestroySoon() { | 705 void GpuChannel::DestroySoon() { |
706 MessageLoop::current()->PostTask( | 706 base::MessageLoop::current()->PostTask( |
707 FROM_HERE, base::Bind(&GpuChannel::OnDestroy, this)); | 707 FROM_HERE, base::Bind(&GpuChannel::OnDestroy, this)); |
708 } | 708 } |
709 | 709 |
710 int GpuChannel::GenerateRouteID() { | 710 int GpuChannel::GenerateRouteID() { |
711 static int last_id = 0; | 711 static int last_id = 0; |
712 return ++last_id; | 712 return ++last_id; |
713 } | 713 } |
714 | 714 |
715 void GpuChannel::AddRoute(int32 route_id, IPC::Listener* listener) { | 715 void GpuChannel::AddRoute(int32 route_id, IPC::Listener* listener) { |
716 router_.AddRoute(route_id, listener); | 716 router_.AddRoute(route_id, listener); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 } | 949 } |
950 } | 950 } |
951 | 951 |
952 void GpuChannel::CacheShader(const std::string& key, | 952 void GpuChannel::CacheShader(const std::string& key, |
953 const std::string& shader) { | 953 const std::string& shader) { |
954 gpu_channel_manager_->Send( | 954 gpu_channel_manager_->Send( |
955 new GpuHostMsg_CacheShader(client_id_, key, shader)); | 955 new GpuHostMsg_CacheShader(client_id_, key, shader)); |
956 } | 956 } |
957 | 957 |
958 } // namespace content | 958 } // namespace content |
OLD | NEW |