Skip to content

Commit

Permalink
Remove GCC/MSVC workarounds in gpu/.
Browse files Browse the repository at this point in the history
Bug: 1053958
Change-Id: I21465bba12d8778e2b1d5279ef3fdf104bf62a1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2803040
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#869248}
  • Loading branch information
leizleiz authored and Chromium LUCI CQ committed Apr 5, 2021
1 parent 752176c commit 3b5fd12
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 37 deletions.
3 changes: 0 additions & 3 deletions gpu/command_buffer/client/client_test_helper.cc
Expand Up @@ -98,11 +98,8 @@ void FakeCommandBufferServiceBase::SetContextLostReason(
state_.context_lost_reason = reason;
}

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const int32_t FakeCommandBufferServiceBase::kTransferBufferBaseId;
const int32_t FakeCommandBufferServiceBase::kMaxTransferBuffers;
#endif

MockClientCommandBuffer::MockClientCommandBuffer() {
DelegateToFake();
Expand Down
2 changes: 0 additions & 2 deletions gpu/command_buffer/client/fenced_allocator_test.cc
Expand Up @@ -62,9 +62,7 @@ class BaseFencedAllocatorTest : public testing::Test {
base::test::SingleThreadTaskEnvironment task_environment_;
};

#ifndef _MSC_VER
const unsigned int BaseFencedAllocatorTest::kBufferSize;
#endif

// Test fixture for FencedAllocator test - Creates a FencedAllocator, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
Expand Down
3 changes: 0 additions & 3 deletions gpu/command_buffer/client/gles2_implementation_unittest.cc
Expand Up @@ -621,8 +621,6 @@ void GLES3ImplementationTest::SetUp() {
ASSERT_TRUE(Initialize(init_options));
}

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const uint8_t GLES2ImplementationTest::kInitialValue;
const int32_t GLES2ImplementationTest::kNumCommandEntries;
const int32_t GLES2ImplementationTest::kCommandBufferSizeBytes;
Expand All @@ -649,7 +647,6 @@ const GLuint GLES2ImplementationTest::kTexturesStartId;
const GLuint GLES2ImplementationTest::kTransformFeedbacksStartId;
const GLuint GLES2ImplementationTest::kQueriesStartId;
const GLuint GLES2ImplementationTest::kVertexArraysStartId;
#endif

TEST_F(GLES2ImplementationTest, Basic) {
EXPECT_TRUE(gl_->share_group());
Expand Down
2 changes: 0 additions & 2 deletions gpu/command_buffer/client/implementation_base.cc
Expand Up @@ -20,10 +20,8 @@

namespace gpu {

#if !defined(_MSC_VER)
const uint32_t ImplementationBase::kMaxSizeOfSimpleResult;
const uint32_t ImplementationBase::kStartingOffset;
#endif

ImplementationBase::ImplementationBase(CommandBufferHelper* helper,
TransferBufferInterface* transfer_buffer,
Expand Down
4 changes: 0 additions & 4 deletions gpu/command_buffer/client/mapped_memory_unittest.cc
Expand Up @@ -59,9 +59,7 @@ class MappedMemoryTestBase : public testing::Test {
base::test::SingleThreadTaskEnvironment task_environment_;
};

#ifndef _MSC_VER
const unsigned int MappedMemoryTestBase::kBufferSize;
#endif

// Test fixture for MemoryChunk test - Creates a MemoryChunk, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
Expand Down Expand Up @@ -94,9 +92,7 @@ class MemoryChunkTest : public MappedMemoryTestBase {
scoped_refptr<gpu::Buffer> buffer_;
};

#ifndef _MSC_VER
const int32_t MemoryChunkTest::kShmId;
#endif

TEST_F(MemoryChunkTest, Basic) {
const unsigned int kSize = 16;
Expand Down
3 changes: 0 additions & 3 deletions gpu/command_buffer/client/raster_implementation_unittest.cc
Expand Up @@ -324,8 +324,6 @@ class RasterImplementationManualInitTest : public RasterImplementationTest {
void SetUp() override {}
};

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const uint8_t RasterImplementationTest::kInitialValue;
const uint32_t RasterImplementationTest::kNumCommandEntries;
const uint32_t RasterImplementationTest::kCommandBufferSizeBytes;
Expand All @@ -338,7 +336,6 @@ const GLuint RasterImplementationTest::kStartId;
const GLuint RasterImplementationTest::kBuffersStartId;
const GLuint RasterImplementationTest::kTexturesStartId;
const GLuint RasterImplementationTest::kQueriesStartId;
#endif

TEST_F(RasterImplementationTest, GetBucketContents) {
const uint32_t kBucketId = RasterImplementation::kResultBucketId;
Expand Down
2 changes: 0 additions & 2 deletions gpu/command_buffer/client/ring_buffer_test.cc
Expand Up @@ -88,10 +88,8 @@ class BaseRingBufferTest : public testing::Test {
base::test::SingleThreadTaskEnvironment task_environment_;
};

#ifndef _MSC_VER
const unsigned int BaseRingBufferTest::kBaseOffset;
const unsigned int BaseRingBufferTest::kBufferSize;
#endif

// Test fixture for RingBuffer test - Creates a RingBuffer, using a
// CommandBufferHelper with a mock AsyncAPIInterface for its interface (calling
Expand Down
6 changes: 0 additions & 6 deletions gpu/command_buffer/client/transfer_buffer_unittest.cc
Expand Up @@ -90,14 +90,11 @@ void TransferBufferTest::TearDown() {
transfer_buffer_.reset();
}

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const int32_t TransferBufferTest::kNumCommandEntries;
const int32_t TransferBufferTest::kCommandBufferSizeBytes;
const uint32_t TransferBufferTest::kStartingOffset;
const uint32_t TransferBufferTest::kAlignment;
const uint32_t TransferBufferTest::kTransferBufferSize;
#endif

TEST_F(TransferBufferTest, Basic) {
Initialize();
Expand Down Expand Up @@ -326,16 +323,13 @@ void TransferBufferExpandContractTest::TearDown() {
transfer_buffer_.reset();
}

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const int32_t TransferBufferExpandContractTest::kNumCommandEntries;
const int32_t TransferBufferExpandContractTest::kCommandBufferSizeBytes;
const uint32_t TransferBufferExpandContractTest::kStartingOffset;
const uint32_t TransferBufferExpandContractTest::kAlignment;
const uint32_t TransferBufferExpandContractTest::kStartTransferBufferSize;
const uint32_t TransferBufferExpandContractTest::kMaxTransferBufferSize;
const uint32_t TransferBufferExpandContractTest::kMinTransferBufferSize;
#endif

TEST_F(TransferBufferExpandContractTest, ExpandWithSmallAllocations) {
int32_t token = helper_->InsertToken();
Expand Down
Expand Up @@ -37,12 +37,9 @@ class VertexArrayObjectManagerTest : public testing::Test {
std::unique_ptr<VertexArrayObjectManager> manager_;
};

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const GLuint VertexArrayObjectManagerTest::kMaxAttribs;
const GLuint VertexArrayObjectManagerTest::kClientSideArrayBuffer;
const GLuint VertexArrayObjectManagerTest::kClientSideElementArrayBuffer;
#endif

TEST_F(VertexArrayObjectManagerTest, Basic) {
EXPECT_FALSE(manager_->HaveEnabledClientSideBuffers());
Expand Down
3 changes: 0 additions & 3 deletions gpu/command_buffer/common/gles2_cmd_format_test.cc
Expand Up @@ -53,10 +53,7 @@ class GLES2FormatTest : public testing::Test {
unsigned char buffer_[1024];
};

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const unsigned char GLES2FormatTest::kInitialValue;
#endif

#include "gpu/command_buffer/common/gles2_cmd_format_test_autogen.h"

Expand Down
3 changes: 0 additions & 3 deletions gpu/command_buffer/common/raster_cmd_format_test.cc
Expand Up @@ -54,10 +54,7 @@ class RasterFormatTest : public testing::Test {
unsigned char buffer_[1024];
};

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const unsigned char RasterFormatTest::kInitialValue;
#endif

#include "gpu/command_buffer/common/raster_cmd_format_test_autogen.h"

Expand Down
3 changes: 0 additions & 3 deletions gpu/command_buffer/common/webgpu_cmd_format_test.cc
Expand Up @@ -54,10 +54,7 @@ class WebGPUFormatTest : public testing::Test {
unsigned char buffer_[1024];
};

// GCC requires these declarations, but MSVC requires they not be present
#ifndef _MSC_VER
const unsigned char WebGPUFormatTest::kInitialValue;
#endif

#include "gpu/command_buffer/common/webgpu_cmd_format_test_autogen.h"

Expand Down

0 comments on commit 3b5fd12

Please sign in to comment.