summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorvrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 22:16:30 +0000
committervrk@google.com <vrk@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-28 22:16:30 +0000
commita81c24c6c04e6f86dc3f2b902c69f4df4f8d614f (patch)
treef807f2bad720835274bf2ae6b9bcabd39665bf56 /gpu
parent6930c52974a804f6462a546ffb46b0c14caa983b (diff)
downloadchromium_src-a81c24c6c04e6f86dc3f2b902c69f4df4f8d614f.zip
chromium_src-a81c24c6c04e6f86dc3f2b902c69f4df4f8d614f.tar.gz
chromium_src-a81c24c6c04e6f86dc3f2b902c69f4df4f8d614f.tar.bz2
Remove ReadWriteTokens from GpuVideoDecodeAccelerator + fallout
With apatrick's changes in r93066, we no longer need to manually sync up with the command buffer before handling IPC messages in GpuVideoDecodeAccelerator. BUG=none TEST=gles2 example runs without crashing Review URL: http://codereview.chromium.org/7521015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94561 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/common/command_buffer.cc31
-rw-r--r--gpu/command_buffer/common/command_buffer.h21
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.cc8
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.h6
-rw-r--r--gpu/gpu.gyp1
5 files changed, 0 insertions, 67 deletions
diff --git a/gpu/command_buffer/common/command_buffer.cc b/gpu/command_buffer/common/command_buffer.cc
deleted file mode 100644
index 5a12ed1..0000000
--- a/gpu/command_buffer/common/command_buffer.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright (c) 2011 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.
-
-#include "../common/command_buffer.h"
-#include "../common/logging.h"
-
-namespace gpu {
-
-ReadWriteTokens::ReadWriteTokens()
- : last_token_read(-1), last_token_written(-1) {
-}
-
-ReadWriteTokens::ReadWriteTokens(int32 read, int32 written)
- : last_token_read(read), last_token_written(written) {
-}
-
-bool ReadWriteTokens::InRange(int32 token) const {
- int32 min = last_token_read;
- int32 max = last_token_written;
- GPU_DCHECK_GE(min, 0);
- GPU_DCHECK_GE(max, 0);
- if (min <= max) {
- // token should be in [min .. max)
- return (token >= min) && (token < max);
- }
- // token should be in [0 .. max) or [min .. wrap token)
- return (token >= min) || (token < max);
-}
-
-} // namespace gpu
diff --git a/gpu/command_buffer/common/command_buffer.h b/gpu/command_buffer/common/command_buffer.h
index 2eff201..b2997ee 100644
--- a/gpu/command_buffer/common/command_buffer.h
+++ b/gpu/command_buffer/common/command_buffer.h
@@ -139,27 +139,6 @@ class CommandBuffer {
DISALLOW_COPY_AND_ASSIGN(CommandBuffer);
};
-// Synchronizing other mechanisms (such as IPC) with the CommandBuffer requires
-// inserting (writing) a token into the buffer and knowing what the last token
-// read at that point was. ReadWriteTokens is a convenience struct for passing
-// these pairs around. Expected usage is to compare a current token to
-// [last_token_read,last_token_written).
-class ReadWriteTokens {
- public:
- ReadWriteTokens(int32 read, int32 written);
- // Required to support pickling. Use by anything else will DCHECK in InRange.
- ReadWriteTokens();
-
- // Return true iff |value| is in the range described by |tokens|, accounting
- // for (up to) one wrap-around.
- bool InRange(int32 token) const;
-
- // These want to be private (and const) but can't in order to support
- // pickling.
- int32 last_token_read;
- int32 last_token_written;
-};
-
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_COMMON_COMMAND_BUFFER_H_
diff --git a/gpu/command_buffer/service/gpu_scheduler.cc b/gpu/command_buffer/service/gpu_scheduler.cc
index 8809b05..15316ea 100644
--- a/gpu/command_buffer/service/gpu_scheduler.cc
+++ b/gpu/command_buffer/service/gpu_scheduler.cc
@@ -214,8 +214,6 @@ Buffer GpuScheduler::GetSharedMemoryBuffer(int32 shm_id) {
void GpuScheduler::set_token(int32 token) {
command_buffer_->SetToken(token);
- if (!set_token_callback_.is_null())
- set_token_callback_.Run(token);
}
bool GpuScheduler::SetGetOffset(int32 offset) {
@@ -251,12 +249,6 @@ void GpuScheduler::SetCommandProcessedCallback(
command_processed_callback_.reset(callback);
}
-void GpuScheduler::SetTokenCallback(
- const base::Callback<void(int32)>& callback) {
- DCHECK(set_token_callback_.is_null());
- set_token_callback_ = callback;
-}
-
GpuScheduler::GpuScheduler(CommandBuffer* command_buffer,
gles2::GLES2Decoder* decoder,
CommandParser* parser)
diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h
index 4ff0f3d..75ccc63 100644
--- a/gpu/command_buffer/service/gpu_scheduler.h
+++ b/gpu/command_buffer/service/gpu_scheduler.h
@@ -143,11 +143,6 @@ class GpuScheduler : public CommandBufferEngine {
void SetCommandProcessedCallback(Callback0::Type* callback);
- // Sets a callback which is called when set_token() is called, and passes the
- // just-set token to the callback. DCHECKs that no callback has previously
- // been registered for this notification.
- void SetTokenCallback(const base::Callback<void(int32)>& callback);
-
// Get the GLES2Decoder associated with this scheduler.
gles2::GLES2Decoder* decoder() const { return decoder_.get(); }
@@ -183,7 +178,6 @@ class GpuScheduler : public CommandBufferEngine {
ScopedRunnableMethodFactory<GpuScheduler> method_factory_;
scoped_ptr<Callback0::Type> wrapped_swap_buffers_callback_;
scoped_ptr<Callback0::Type> command_processed_callback_;
- base::Callback<void(int32)> set_token_callback_;
};
} // namespace gpu
diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp
index 22f0215..2c4bbfd 100644
--- a/gpu/gpu.gyp
+++ b/gpu/gpu.gyp
@@ -46,7 +46,6 @@
'command_buffer/common/buffer.h',
'command_buffer/common/cmd_buffer_common.h',
'command_buffer/common/cmd_buffer_common.cc',
- 'command_buffer/common/command_buffer.cc',
'command_buffer/common/command_buffer.h',
'command_buffer/common/constants.h',
'command_buffer/common/gles2_cmd_ids_autogen.h',