summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpu/command_buffer/client/cmd_buffer_helper.cc2
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc7
2 files changed, 8 insertions, 1 deletions
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index 29770b8..f78bc34 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -229,7 +229,7 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) {
if (pending > limit) {
Flush();
} else if (commands_issued_ % kCommandsPerFlushCheck == 0) {
-#if !defined(OS_ANDROID)
+#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
// Allow this command buffer to be pre-empted by another if a "reasonable"
// amount of work has been done. On highend machines, this reduces the
// latency of GPU commands. However, on Android, this can cause the
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 504eca1..cf55bb1 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -2694,7 +2694,12 @@ void GLES2Implementation::UnmapBufferSubDataCHROMIUM(const void* mem) {
helper_->BufferSubData(
mb.target, mb.offset, mb.size, mb.shm_id, mb.shm_offset);
mapped_memory_->FreePendingToken(mb.shm_memory, helper_->InsertToken());
+ // Flushing after unmap lets the service side start processing commands
+ // sooner. However, on lowend devices, the thread thrashing causes is
+ // worse than the latency hit.
+#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
helper_->CommandBufferHelper::Flush();
+#endif
mapped_buffers_.erase(it);
}
@@ -2767,7 +2772,9 @@ void GLES2Implementation::UnmapTexSubImage2DCHROMIUM(const void* mem) {
mt.target, mt.level, mt.xoffset, mt.yoffset, mt.width, mt.height,
mt.format, mt.type, mt.shm_id, mt.shm_offset, GL_FALSE);
mapped_memory_->FreePendingToken(mt.shm_memory, helper_->InsertToken());
+#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
helper_->CommandBufferHelper::Flush();
+#endif
mapped_textures_.erase(it);
}