summaryrefslogtreecommitdiffstats
path: root/content/common/gpu/gpu_command_buffer_stub.cc
diff options
context:
space:
mode:
authormiletus <miletus@chromium.org>2014-09-15 14:29:13 -0700
committerCommit bot <commit-bot@chromium.org>2014-09-15 21:36:16 +0000
commitef0850f4739a1d3b440495f318dc349c162edf4e (patch)
treeb937e5df9d3030acd8933fff7993e56791ceb59a /content/common/gpu/gpu_command_buffer_stub.cc
parent6a7555279aa289fbd2960d622cba938d6ed0d2b7 (diff)
downloadchromium_src-ef0850f4739a1d3b440495f318dc349c162edf4e.zip
chromium_src-ef0850f4739a1d3b440495f318dc349c162edf4e.tar.gz
chromium_src-ef0850f4739a1d3b440495f318dc349c162edf4e.tar.bz2
Merge GpuCommandBufferMsg_SetLatencyInfo into GpuCommandBufferMsg_AsyncFlush
GpuCommandBufferMsg_SetLatencyInfo is used to send current frame's latencyinfo to gpu. We can piggyback the latencyinfo in GpuCommandBufferMsg_AsyncFlush so eliminate the extra IPC. BUG=404650 TEST=check trace that now GLRenderer::SwapBuffers only sends 2 IPC messages, i.e. AsyncFlush and Echo. And LatencyInfo tracking is still working. Review URL: https://codereview.chromium.org/564903002 Cr-Commit-Position: refs/heads/master@{#294895}
Diffstat (limited to 'content/common/gpu/gpu_command_buffer_stub.cc')
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc24
1 files changed, 11 insertions, 13 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index fa22f94..4e2834f 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -229,8 +229,7 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
if (decoder_.get() && message.type() != GpuCommandBufferMsg_Echo::ID &&
message.type() != GpuCommandBufferMsg_WaitForTokenInRange::ID &&
message.type() != GpuCommandBufferMsg_WaitForGetOffsetInRange::ID &&
- message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID &&
- message.type() != GpuCommandBufferMsg_SetLatencyInfo::ID) {
+ message.type() != GpuCommandBufferMsg_RetireSyncPoint::ID) {
if (!MakeCurrent())
return false;
have_context = true;
@@ -252,7 +251,6 @@ bool GpuCommandBufferStub::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER_DELAY_REPLY(GpuCommandBufferMsg_WaitForGetOffsetInRange,
OnWaitForGetOffsetInRange);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_AsyncFlush, OnAsyncFlush);
- IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_SetLatencyInfo, OnSetLatencyInfo);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_Rescheduled, OnRescheduled);
IPC_MESSAGE_HANDLER(GpuCommandBufferMsg_RegisterTransferBuffer,
OnRegisterTransferBuffer);
@@ -630,15 +628,6 @@ void GpuCommandBufferStub::OnInitialize(
}
}
-void GpuCommandBufferStub::OnSetLatencyInfo(
- const std::vector<ui::LatencyInfo>& latency_info) {
- if (!ui::LatencyInfo::Verify(latency_info,
- "GpuCommandBufferStub::OnSetLatencyInfo"))
- return;
- if (!latency_info_callback_.is_null())
- latency_info_callback_.Run(latency_info);
-}
-
void GpuCommandBufferStub::OnCreateStreamTexture(
uint32 texture_id, int32 stream_id, bool* succeeded) {
#if defined(OS_ANDROID)
@@ -758,9 +747,18 @@ void GpuCommandBufferStub::CheckCompleteWaits() {
}
}
-void GpuCommandBufferStub::OnAsyncFlush(int32 put_offset, uint32 flush_count) {
+void GpuCommandBufferStub::OnAsyncFlush(
+ int32 put_offset,
+ uint32 flush_count,
+ const std::vector<ui::LatencyInfo>& latency_info) {
TRACE_EVENT1(
"gpu", "GpuCommandBufferStub::OnAsyncFlush", "put_offset", put_offset);
+
+ if (ui::LatencyInfo::Verify(latency_info,
+ "GpuCommandBufferStub::OnAsyncFlush") &&
+ !latency_info_callback_.is_null()) {
+ latency_info_callback_.Run(latency_info);
+ }
DCHECK(command_buffer_.get());
if (flush_count - last_flush_count_ < 0x8000000U) {
last_flush_count_ = flush_count;