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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/hash.h" | 8 #include "base/hash.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 latency_info_callback_.Run(latency_info); | 854 latency_info_callback_.Run(latency_info); |
855 } | 855 } |
856 | 856 |
857 last_flush_count_ = flush_count; | 857 last_flush_count_ = flush_count; |
858 gpu::CommandBuffer::State pre_state = command_buffer_->GetLastState(); | 858 gpu::CommandBuffer::State pre_state = command_buffer_->GetLastState(); |
859 command_buffer_->Flush(put_offset); | 859 command_buffer_->Flush(put_offset); |
860 gpu::CommandBuffer::State post_state = command_buffer_->GetLastState(); | 860 gpu::CommandBuffer::State post_state = command_buffer_->GetLastState(); |
861 | 861 |
862 if (pre_state.get_offset != post_state.get_offset) | 862 if (pre_state.get_offset != post_state.get_offset) |
863 ReportState(); | 863 ReportState(); |
| 864 |
| 865 #if defined(OS_ANDROID) |
| 866 GpuChannelManager* manager = channel_->gpu_channel_manager(); |
| 867 manager->DidAccessGpu(); |
| 868 #endif |
864 } | 869 } |
865 | 870 |
866 void GpuCommandBufferStub::OnRegisterTransferBuffer( | 871 void GpuCommandBufferStub::OnRegisterTransferBuffer( |
867 int32 id, | 872 int32 id, |
868 base::SharedMemoryHandle transfer_buffer, | 873 base::SharedMemoryHandle transfer_buffer, |
869 uint32 size) { | 874 uint32 size) { |
870 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterTransferBuffer"); | 875 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnRegisterTransferBuffer"); |
871 | 876 |
872 // Take ownership of the memory and map it into this process. | 877 // Take ownership of the memory and map it into this process. |
873 // This validates the size. | 878 // This validates the size. |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 result)); | 1240 result)); |
1236 } | 1241 } |
1237 | 1242 |
1238 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1243 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
1239 base::TimeDelta interval) { | 1244 base::TimeDelta interval) { |
1240 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1245 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
1241 interval)); | 1246 interval)); |
1242 } | 1247 } |
1243 | 1248 |
1244 } // namespace content | 1249 } // namespace content |
OLD | NEW |