Commit af65aab8 authored by gman@chromium.org's avatar gman@chromium.org

Add ShareGroup stub

TEST=unit test
BUG=120297


Review URL: http://codereview.chromium.org/9836126

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129456 0039d316-1c4b-4281-b951-d872f2087c98
parent 86c82fe1
// 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.
#ifndef GPU_COMMAND_BUFFER_CLIENT_REF_COUNTED_H_
#define GPU_COMMAND_BUFFER_CLIENT_REF_COUNTED_H_
#if defined(__native_client__)
#include "native_client/src/include/ref_counted.h"
namespace gpu {
template <class T>
struct RefCountedThreadSafe : public nacl::RefCounted<T> {
};
}
#else
#include "base/memory/ref_counted.h"
namespace gpu {
template <class T>
struct RefCountedThreadSafe : public base::RefCountedThreadSafe<T> {
};
}
#endif
#endif // GPU_COMMAND_BUFFER_CLIENT_REF_COUNTED_H_
// 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.
#include "../client/share_group.h"
#include "../common/logging.h"
namespace gpu {
namespace gles2 {
ShareGroup::ShareGroup() {
GPU_CHECK(ShareGroup::ImplementsThreadSafeReferenceCounting());
}
ShareGroup::~ShareGroup() {
}
} // namespace gles2
} // namespace gpu
// 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.
#ifndef GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_
#define GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_
#include "../client/ref_counted.h"
#include "gles2_impl_export.h"
namespace gpu {
namespace gles2 {
// ShareGroup manages shared resources for contexts that are sharing resources.
class GLES2_IMPL_EXPORT ShareGroup
: public gpu::RefCountedThreadSafe<ShareGroup> {
public:
typedef scoped_refptr<ShareGroup> Ref;
ShareGroup();
~ShareGroup();
bool Initialize();
private:
DISALLOW_COPY_AND_ASSIGN(ShareGroup);
};
} // namespace gles2
} // namespace gpu
#endif // GPU_COMMAND_BUFFER_CLIENT_SHARE_GROUP_H_
// 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.
// Tests for the ShareGroup.
#include "gpu/command_buffer/client/share_group.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace gpu {
namespace gles2 {
class ShareGroupTest : public testing::Test {
protected:
virtual void SetUp() {
share_group_ = ShareGroup::Ref(new ShareGroup());
}
virtual void TearDown() {
}
scoped_refptr<ShareGroup> share_group_;
};
TEST_F(ShareGroupTest, Basic) {
EXPECT_TRUE(ShareGroup::ImplementsThreadSafeReferenceCounting());
}
} // namespace gles2
} // namespace gpu
......@@ -25,6 +25,8 @@
'command_buffer/client/gles2_implementation.h',
'command_buffer/client/program_info_manager.cc',
'command_buffer/client/program_info_manager.h',
'command_buffer/client/share_group.cc',
'command_buffer/client/share_group.h',
]
},
'includes': [
......
......@@ -149,6 +149,7 @@
'command_buffer/client/query_tracker_unittest.cc',
'command_buffer/client/program_info_manager_unittest.cc',
'command_buffer/client/ring_buffer_test.cc',
'command_buffer/client/share_group_unittest.cc',
'command_buffer/client/transfer_buffer_unittest.cc',
'command_buffer/common/bitfield_helpers_test.cc',
'command_buffer/common/command_buffer_mock.cc',
......
......@@ -37,6 +37,7 @@ command_buffer_client_srcs = [
'command_buffer/client/mapped_memory.cc',
'command_buffer/client/query_tracker.cc',
'command_buffer/client/ring_buffer.cc',
'command_buffer/client/share_group.cc',
'command_buffer/client/transfer_buffer.cc',
'command_buffer/common/id_allocator.cc',
]
......
......@@ -39,6 +39,7 @@
'<(DEPTH)/gpu/command_buffer/client/gles2_lib.cc',
'<(DEPTH)/gpu/command_buffer/client/mapped_memory.cc',
'<(DEPTH)/gpu/command_buffer/client/query_tracker.cc',
'<(DEPTH)/gpu/command_buffer/client/share_group.cc',
'<(DEPTH)/gpu/command_buffer/client/ring_buffer.cc',
'<(DEPTH)/gpu/command_buffer/common/id_allocator.cc',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment