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(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 const std::string& message) { | 784 const std::string& message) { |
785 GPUCommandBufferConsoleMessage console_message; | 785 GPUCommandBufferConsoleMessage console_message; |
786 console_message.id = id; | 786 console_message.id = id; |
787 console_message.message = message; | 787 console_message.message = message; |
788 IPC::Message* msg = new GpuCommandBufferMsg_ConsoleMsg( | 788 IPC::Message* msg = new GpuCommandBufferMsg_ConsoleMsg( |
789 route_id_, console_message); | 789 route_id_, console_message); |
790 msg->set_unblock(true); | 790 msg->set_unblock(true); |
791 Send(msg); | 791 Send(msg); |
792 } | 792 } |
793 | 793 |
| 794 void GpuCommandBufferStub::SendUpdateVSyncTime(int64 time) { |
| 795 Send(new GpuCommandBufferMsg_UpdateVSyncTime(route_id_, time)); |
| 796 } |
| 797 |
794 void GpuCommandBufferStub::AddDestructionObserver( | 798 void GpuCommandBufferStub::AddDestructionObserver( |
795 DestructionObserver* observer) { | 799 DestructionObserver* observer) { |
796 destruction_observers_.AddObserver(observer); | 800 destruction_observers_.AddObserver(observer); |
797 } | 801 } |
798 | 802 |
799 void GpuCommandBufferStub::RemoveDestructionObserver( | 803 void GpuCommandBufferStub::RemoveDestructionObserver( |
800 DestructionObserver* observer) { | 804 DestructionObserver* observer) { |
801 destruction_observers_.RemoveObserver(observer); | 805 destruction_observers_.RemoveObserver(observer); |
802 } | 806 } |
803 | 807 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 const GpuMemoryAllocation& allocation) { | 849 const GpuMemoryAllocation& allocation) { |
846 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); | 850 Send(new GpuCommandBufferMsg_SetMemoryAllocation(route_id_, allocation)); |
847 // This can be called outside of OnMessageReceived, so the context needs to be | 851 // This can be called outside of OnMessageReceived, so the context needs to be |
848 // made current before calling methods on the surface. | 852 // made current before calling methods on the surface. |
849 if (!surface_ || !MakeCurrent()) | 853 if (!surface_ || !MakeCurrent()) |
850 return; | 854 return; |
851 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); | 855 surface_->SetFrontbufferAllocation(allocation.suggest_have_frontbuffer); |
852 } | 856 } |
853 | 857 |
854 #endif // defined(ENABLE_GPU) | 858 #endif // defined(ENABLE_GPU) |
OLD | NEW |