summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 04:02:19 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-01 04:02:19 +0000
commitaca67f1d17528aa07ea136c992ba28d136172628 (patch)
treec16ed73a7248bf61c419a3c578118f3418d5adf1 /gpu
parentef923919b721363c29434bf4abce64c80e0fcdba (diff)
downloadchromium_src-aca67f1d17528aa07ea136c992ba28d136172628.zip
chromium_src-aca67f1d17528aa07ea136c992ba28d136172628.tar.gz
chromium_src-aca67f1d17528aa07ea136c992ba28d136172628.tar.bz2
Added CommandBuffer::GetLastError.
This is equivalent to GetLastState().error. It saves copying 6 ints. This is temporary until skia does not invoke MakeCurrent for every GL call. BUG==112187 Review URL: http://codereview.chromium.org/9314020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120022 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/common/cmd_buffer_common.cc10
-rw-r--r--gpu/command_buffer/common/command_buffer.h8
2 files changed, 16 insertions, 2 deletions
diff --git a/gpu/command_buffer/common/cmd_buffer_common.cc b/gpu/command_buffer/common/cmd_buffer_common.cc
index 0bfc9e1..235cc5d 100644
--- a/gpu/command_buffer/common/cmd_buffer_common.cc
+++ b/gpu/command_buffer/common/cmd_buffer_common.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -31,6 +31,14 @@ const char* GetCommandName(CommandId command_id) {
} // namespace cmd
+// TODO(apatrick): this is a temporary optimization while skia is calling
+// RendererGLContext::MakeCurrent prior to every GL call. It saves returning 6
+// ints redundantly when only the error is needed for the CommandBufferProxy
+// implementation.
+error::Error CommandBuffer::GetLastError() {
+ return GetLastState().error;
+}
+
} // namespace gpu
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h
index ec4cc14..ee8fe06 100644
--- a/gpu/command_buffer/common/command_buffer.h
+++ b/gpu/command_buffer/common/command_buffer.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -134,6 +134,12 @@ class CommandBuffer {
// call this first.
virtual void SetContextLostReason(error::ContextLostReason) = 0;
+ // TODO(apatrick): this is a temporary optimization while skia is calling
+ // RendererGLContext::MakeCurrent prior to every GL call. It saves returning 6
+ // ints redundantly when only the error is needed for the CommandBufferProxy
+ // implementation.
+ virtual error::Error GetLastError();
+
private:
DISALLOW_COPY_AND_ASSIGN(CommandBuffer);
};