Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.cc

Issue 11099029: Disable automatic flushes on compositor contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make image_transport_factory noAutomaticFlushes Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/cmd_buffer_helper.cc
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index d556b5e7773b2d82d1434b8eac5985d2f69326d8..54df89ed3da91ed5fb2997498111e9d25333e827 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -28,9 +28,14 @@ CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer)
commands_issued_(0),
usable_(true),
context_lost_(false),
+ flush_automatically_(true),
last_flush_time_(0) {
}
+void CommandBufferHelper::SetAutomaticFlushes(bool enabled) {
+ flush_automatically_ = enabled;
+}
+
bool CommandBufferHelper::IsContextLost() {
if (!context_lost_) {
context_lost_ = error::IsError(command_buffer()->GetLastError());
@@ -241,8 +246,9 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) {
((get_offset() == last_put_sent_) ? 16 : 2);
if (pending > limit) {
Flush();
- } else if (commands_issued_ % kCommandsPerFlushCheck == 0) {
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS)
+ } else if (flush_automatically_ &&
+ (commands_issued_ % kCommandsPerFlushCheck == 0)) {
+#if !defined(OS_ANDROID)
// 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
« no previous file with comments | « gpu/command_buffer/client/cmd_buffer_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698