diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 18:31:08 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-08 18:31:08 +0000 |
commit | 20407e957e31a0faf159403d47dc5d1d6c903f9e (patch) | |
tree | 350962b37d2cb6d9e0fdae78a24efb2bd3c72723 | |
parent | 9283f2789927383ece6aedbd948a645164c35c53 (diff) | |
download | chromium_src-20407e957e31a0faf159403d47dc5d1d6c903f9e.zip chromium_src-20407e957e31a0faf159403d47dc5d1d6c903f9e.tar.gz chromium_src-20407e957e31a0faf159403d47dc5d1d6c903f9e.tar.bz2 |
Removed dependencies on base from GPU common and client code.
The main change was to make scoped_ptr and the basic types the same for both NaCl and trusted plugins and to implement new logging code for GPU common and client code. Service code and unit tests can still use the logging code in base.
I am really not happy with the new logging code but I thought I'd let you take a look at it to see what you think. The biggest thing I don't like is it uses assert(false) to throw an exception in a platform independent way, which brings up a modal dialog. Not ideal in the middle of a unit test run. I don't know if that will make the bots hang. Hopefully they'll time out or something.
TEST=try
BUG=none
Review URL: http://codereview.chromium.org/2936009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58857 0039d316-1c4b-4281-b951-d872f2087c98
31 files changed, 318 insertions, 142 deletions
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc index ceec30e..b666e83 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper.cc @@ -77,7 +77,7 @@ int32 CommandBufferHelper::InsertToken() { if (token_ == 0) { // we wrapped Finish(); - DCHECK_EQ(token_, last_token_read_); + GPU_DCHECK_EQ(token_, last_token_read_); } return token_; } @@ -93,7 +93,7 @@ void CommandBufferHelper::WaitForToken(int32 token) { Flush(); while (last_token_read_ < token) { if (get_ == put_) { - LOG(FATAL) << "Empty command buffer while waiting on a token."; + GPU_LOG(FATAL) << "Empty command buffer while waiting on a token."; return; } // Do not loop forever if the flush fails, meaning the command buffer reader @@ -109,13 +109,13 @@ void CommandBufferHelper::WaitForToken(int32 token) { // function will return early if an error occurs, in which case the available // space may not be available. void CommandBufferHelper::WaitForAvailableEntries(int32 count) { - CHECK(count < usable_entry_count_); + GPU_CHECK(count < usable_entry_count_); if (put_ + count > usable_entry_count_) { // There's not enough room between the current put and the end of the // buffer, so we need to wrap. We will add a jump back to the start, but we // need to make sure get wraps first, actually that get is 1 or more (since // put will wrap to 0 after we add the jump). - DCHECK_LE(1, put_); + GPU_DCHECK_LE(1, put_); Flush(); while (get_ > put_ || get_ == 0) { // Do not loop forever if the flush fails, meaning the command buffer @@ -143,7 +143,7 @@ CommandBufferEntry* CommandBufferHelper::GetSpace(uint32 entries) { WaitForAvailableEntries(entries); CommandBufferEntry* space = &entries_[put_]; put_ += entries; - DCHECK_LE(put_, usable_entry_count_); + GPU_DCHECK_LE(put_, usable_entry_count_); if (put_ == usable_entry_count_) { cmd::Jump::Set(&entries_[put_], 0); put_ = 0; diff --git a/gpu/command_buffer/client/fenced_allocator.cc b/gpu/command_buffer/client/fenced_allocator.cc index a58046e..3fc625d 100644 --- a/gpu/command_buffer/client/fenced_allocator.cc +++ b/gpu/command_buffer/client/fenced_allocator.cc @@ -10,7 +10,7 @@ namespace gpu { -#ifndef COMPILER_MSVC +#ifndef _MSC_VER const FencedAllocator::Offset FencedAllocator::kInvalidOffset; #endif @@ -22,8 +22,8 @@ FencedAllocator::~FencedAllocator() { } } // These checks are not valid if the service has crashed or lost the context. - // DCHECK_EQ(blocks_.size(), 1u); - // DCHECK_EQ(blocks_[0].state, FREE); + // GPU_DCHECK_EQ(blocks_.size(), 1u); + // GPU_DCHECK_EQ(blocks_[0].state, FREE); } // Looks for a non-allocated block that is big enough. Search in the FREE @@ -60,7 +60,7 @@ FencedAllocator::Offset FencedAllocator::Alloc(unsigned int size) { // necessary. void FencedAllocator::Free(FencedAllocator::Offset offset) { BlockIndex index = GetBlockByOffset(offset); - DCHECK_NE(blocks_[index].state, FREE); + GPU_DCHECK_NE(blocks_[index].state, FREE); blocks_[index].state = FREE; CollapseFreeBlock(index); } @@ -96,7 +96,7 @@ unsigned int FencedAllocator::GetLargestFreeOrPendingSize() { max_size = std::max(max_size, current_size); current_size = 0; } else { - DCHECK(block.state == FREE || block.state == FREE_PENDING_TOKEN); + GPU_DCHECK(block.state == FREE || block.state == FREE_PENDING_TOKEN); current_size += block.size; } } @@ -149,7 +149,7 @@ FencedAllocator::BlockIndex FencedAllocator::CollapseFreeBlock( FencedAllocator::BlockIndex FencedAllocator::WaitForTokenAndFreeBlock( BlockIndex index) { Block &block = blocks_[index]; - DCHECK_EQ(block.state, FREE_PENDING_TOKEN); + GPU_DCHECK_EQ(block.state, FREE_PENDING_TOKEN); helper_->WaitForToken(block.token); block.state = FREE; return CollapseFreeBlock(index); @@ -174,8 +174,8 @@ void FencedAllocator::FreeUnused() { FencedAllocator::Offset FencedAllocator::AllocInBlock(BlockIndex index, unsigned int size) { Block &block = blocks_[index]; - DCHECK_GE(block.size, size); - DCHECK_EQ(block.state, FREE); + GPU_DCHECK_GE(block.size, size); + GPU_DCHECK_EQ(block.state, FREE); Offset offset = block.offset; if (block.size == size) { block.state = IN_USE; @@ -194,7 +194,7 @@ FencedAllocator::BlockIndex FencedAllocator::GetBlockByOffset(Offset offset) { Block templ = { IN_USE, offset, 0, kUnusedToken }; Container::iterator it = std::lower_bound(blocks_.begin(), blocks_.end(), templ, OffsetCmp()); - DCHECK(it != blocks_.end() && it->offset == offset); + GPU_DCHECK(it != blocks_.end() && it->offset == offset); return it-blocks_.begin(); } diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h index cbb133d..fb97e37 100644 --- a/gpu/command_buffer/client/fenced_allocator.h +++ b/gpu/command_buffer/client/fenced_allocator.h @@ -182,7 +182,7 @@ class FencedAllocatorWrapper { // Parameters: // pointer: the pointer to the memory block to free. void Free(void *pointer) { - DCHECK(pointer); + GPU_DCHECK(pointer); allocator_.Free(GetOffset(pointer)); } @@ -193,7 +193,7 @@ class FencedAllocatorWrapper { // pointer: the pointer to the memory block to free. // token: the token value to wait for before re-using the memory. void FreePendingToken(void *pointer, int32 token) { - DCHECK(pointer); + GPU_DCHECK(pointer); allocator_.FreePendingToken(GetOffset(pointer), token); } diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index 46f777c..4b66aab 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc @@ -75,7 +75,7 @@ class BaseFencedAllocatorTest : public testing::Test { scoped_ptr<CommandBufferHelper> helper_; }; -#ifndef COMPILER_MSVC +#ifndef _MSC_VER const unsigned int BaseFencedAllocatorTest::kBufferSize; #endif diff --git a/gpu/command_buffer/client/gles2_demo_c.c b/gpu/command_buffer/client/gles2_demo_c.c index aa83b57..e369745 100644 --- a/gpu/command_buffer/client/gles2_demo_c.c +++ b/gpu/command_buffer/client/gles2_demo_c.c @@ -6,7 +6,7 @@ // includes where appropriate. #include <GLES2/gl2.h> -#include "gpu/command_buffer/client/gles2_demo_c.h" +#include "command_buffer/client/gles2_demo_c.h" void GLFromCDraw() { // glClear(GL_COLOR_BUFFER_BIT); diff --git a/gpu/command_buffer/client/gles2_demo_cc.cc b/gpu/command_buffer/client/gles2_demo_cc.cc index 1e11383..cb33f8c 100644 --- a/gpu/command_buffer/client/gles2_demo_cc.cc +++ b/gpu/command_buffer/client/gles2_demo_cc.cc @@ -5,8 +5,8 @@ // This file is here so other GLES2 related files can have a common set of // includes where appropriate. -#include "gpu/command_buffer/client/gles2_demo_cc.h" -#include "gpu/command_buffer/common/logging.h" +#include "../client/gles2_demo_cc.h" +#include "../common/logging.h" #include <math.h> #include <string> @@ -14,7 +14,7 @@ // This is here so we have at least some idea that the inline path is working. #define GLES2_INLINE_OPTIMIZATION #include <GLES2/gl2.h> -#include "gpu/command_buffer/common/logging.h" +#include "../common/logging.h" namespace { @@ -30,8 +30,8 @@ void CheckGLError(const char* func_name, int line_no) { #ifndef NDEBUG GLenum error = GL_NO_ERROR; while ((error = glGetError()) != GL_NO_ERROR) { - DLOG(ERROR) << "GL Error in " << func_name << " at line " << line_no - << ": " << error; + GPU_DLOG(gpu::ERROR) << "GL Error in " << func_name << " at line " + << line_no << ": " << error; } #endif } @@ -54,7 +54,7 @@ GLuint LoadShader(GLenum type, const char* shaderSrc) { GLsizei length = 0; glGetShaderInfoLog(shader, sizeof(buffer), &length, buffer); std::string log(buffer, length); - DLOG(ERROR) << "Error compiling shader:" << log; + GPU_DLOG(gpu::ERROR) << "Error compiling shader:" << log; glDeleteShader(shader); return 0; } @@ -88,7 +88,7 @@ void InitShaders() { // Create the program object GLuint programObject = glCreateProgram(); if (programObject == 0) { - DLOG(ERROR) << "Creating program failed"; + GPU_DLOG(gpu::ERROR) << "Creating program failed"; return; } glAttachShader(programObject, vertexShader); @@ -107,7 +107,7 @@ void InitShaders() { GLsizei length = 0; glGetProgramInfoLog(programObject, sizeof(buffer), &length, buffer); std::string log(buffer, length); - DLOG(ERROR) << "Error linking program:" << log; + GPU_DLOG(gpu::ERROR) << "Error linking program:" << log; glDeleteProgram(programObject); return; } diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 52afc74..6dad4e2 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -322,7 +322,7 @@ class ClientSideBufferHelper { ii, info.size(), info.type(), info.normalized(), 0, array_buffer_offset_); array_buffer_offset_ += RoundUpToMultipleOf4(bytes_collected); - DCHECK_LE(array_buffer_offset_, array_buffer_size_); + GPU_DCHECK_LE(array_buffer_offset_, array_buffer_size_); } } } @@ -388,7 +388,7 @@ class ClientSideBufferHelper { #endif // defined(GLES2_SUPPORT_CLIENT_SIDE_BUFFERS) -#if !defined(COMPILER_MSVC) +#if !defined(_MSC_VER) const size_t GLES2Implementation::kMaxSizeOfSimpleResult; #endif @@ -502,7 +502,7 @@ void GLES2Implementation::SetGLError(GLenum error, const char* msg) { void GLES2Implementation::GetBucketContents(uint32 bucket_id, std::vector<int8>* data) { - DCHECK(data); + GPU_DCHECK(data); typedef cmd::GetBucketSize::Result Result; Result* result = GetResultAs<Result*>(); *result = 0; @@ -534,7 +534,7 @@ void GLES2Implementation::GetBucketContents(uint32 bucket_id, void GLES2Implementation::SetBucketContents( uint32 bucket_id, const void* data, size_t size) { - DCHECK(data); + GPU_DCHECK(data); helper_->SetBucketSize(bucket_id, size); if (size > 0u) { uint32 max_size = transfer_buffer_.GetLargestFreeOrPendingSize(); @@ -566,7 +566,7 @@ void GLES2Implementation::SetBucketAsCString( bool GLES2Implementation::GetBucketAsString( uint32 bucket_id, std::string* str) { - DCHECK(str); + GPU_DCHECK(str); std::vector<int8> data; // NOTE: strings are passed NULL terminated. That means the empty // string will have a size of 1 and no-string will have a size of 0 @@ -842,7 +842,7 @@ void GLES2Implementation::ShaderSource( } } - DCHECK_EQ(total_size, offset); + GPU_DCHECK_EQ(total_size, offset); helper_->ShaderSourceBucket(shader, kResultBucketId); helper_->SetBucketSize(kResultBucketId, 0); @@ -1155,7 +1155,7 @@ const GLubyte* GLES2Implementation::GetString(GLenum name) { if (GetBucketAsString(kResultBucketId, &str)) { std::pair<GLStringMap::const_iterator, bool> insert_result = gl_strings_.insert(std::make_pair(name, str)); - DCHECK(insert_result.second); + GPU_DCHECK(insert_result.second); result = insert_result.first->second.c_str(); } else { result = NULL; diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc index a251ee9..fc2bde9 100644 --- a/gpu/command_buffer/client/gles2_implementation_unittest.cc +++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc @@ -57,21 +57,21 @@ class GLES2MockCommandBufferHelper : public CommandBuffer { } virtual void DestroyTransferBuffer(int32) { // NOLINT - NOTREACHED(); + GPU_NOTREACHED(); } virtual Buffer GetTransferBuffer(int32 id) { - DCHECK_EQ(id, kTransferBufferId); + GPU_DCHECK_EQ(id, kTransferBufferId); return transfer_buffer_buffer_; } virtual void SetToken(int32 token) { - NOTREACHED(); + GPU_NOTREACHED(); state_.token = token; } virtual void SetParseError(error::Error error) { - NOTREACHED(); + GPU_NOTREACHED(); state_.error = error; } @@ -94,6 +94,11 @@ class MockGLES2CommandBuffer : public GLES2MockCommandBufferHelper { MOCK_METHOD1(OnFlush, void(void* result)); }; +// GCC requires these declarations, but MSVC requires they not be present +#ifndef _MSC_VER +const int32 GLES2MockCommandBufferHelper::kTransferBufferId; +#endif + namespace gles2 { using testing::Return; @@ -202,7 +207,7 @@ class GLES2ImplementationTest : public testing::Test { }; // GCC requires these declarations, but MSVC requires they not be present -#ifndef COMPILER_MSVC +#ifndef _MSC_VER const int32 GLES2ImplementationTest::kTransferBufferId; #endif diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc index 7aafe0a..d2c4886 100644 --- a/gpu/command_buffer/client/mapped_memory.cc +++ b/gpu/command_buffer/client/mapped_memory.cc @@ -2,10 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "gpu/command_buffer/client/mapped_memory.h" -#include "gpu/command_buffer/client/cmd_buffer_helper.h" +#include <algorithm> +#include <functional> + +#include "../client/mapped_memory.h" +#include "../client/cmd_buffer_helper.h" namespace gpu { +namespace { +void DeleteMemoryChunk(MemoryChunk* chunk) { + delete chunk; +} +} MemoryChunk::MemoryChunk( int32 shm_id, gpu::Buffer shm, CommandBufferHelper* helper) @@ -14,17 +22,24 @@ MemoryChunk::MemoryChunk( allocator_(shm.size, helper, shm.ptr) { } +MappedMemoryManager::~MappedMemoryManager() { + std::for_each(chunks_.begin(), + chunks_.end(), + std::pointer_to_unary_function<MemoryChunk*, void>( + DeleteMemoryChunk)); +} + void* MappedMemoryManager::Alloc( unsigned int size, int32* shm_id, unsigned int* shm_offset) { - DCHECK(shm_id); - DCHECK(shm_offset); + GPU_DCHECK(shm_id); + GPU_DCHECK(shm_offset); // See if any of the chucks can satisfy this request. for (size_t ii = 0; ii < chunks_.size(); ++ii) { - MemoryChunk* chunk = chunks_[ii].get(); + MemoryChunk* chunk = chunks_[ii]; chunk->FreeUnused(); if (chunk->GetLargestFreeSizeWithoutWaiting() >= size) { void* mem = chunk->Alloc(size); - DCHECK(mem); + GPU_DCHECK(mem); *shm_id = chunk->shm_id(); *shm_offset = chunk->GetOffset(mem); return mem; @@ -38,10 +53,10 @@ void* MappedMemoryManager::Alloc( return NULL; } gpu::Buffer shm = cmd_buf->GetTransferBuffer(id); - MemoryChunk::Ref mc(new MemoryChunk(id, shm, helper_)); + MemoryChunk* mc = new MemoryChunk(id, shm, helper_); chunks_.push_back(mc); void* mem = mc->Alloc(size); - DCHECK(mem); + GPU_DCHECK(mem); *shm_id = mc->shm_id(); *shm_offset = mc->GetOffset(mem); return mem; @@ -49,24 +64,24 @@ void* MappedMemoryManager::Alloc( void MappedMemoryManager::Free(void* pointer) { for (size_t ii = 0; ii < chunks_.size(); ++ii) { - MemoryChunk* chunk = chunks_[ii].get(); + MemoryChunk* chunk = chunks_[ii]; if (chunk->IsInChunk(pointer)) { chunk->Free(pointer); return; } } - NOTREACHED(); + GPU_NOTREACHED(); } void MappedMemoryManager::FreePendingToken(void* pointer, int32 token) { for (size_t ii = 0; ii < chunks_.size(); ++ii) { - MemoryChunk* chunk = chunks_[ii].get(); + MemoryChunk* chunk = chunks_[ii]; if (chunk->IsInChunk(pointer)) { chunk->FreePendingToken(pointer, token); return; } } - NOTREACHED(); + GPU_NOTREACHED(); } } // namespace gpu diff --git a/gpu/command_buffer/client/mapped_memory.h b/gpu/command_buffer/client/mapped_memory.h index 95ff24b..dcd0b58 100644 --- a/gpu/command_buffer/client/mapped_memory.h +++ b/gpu/command_buffer/client/mapped_memory.h @@ -6,20 +6,18 @@ #define GPU_COMMAND_BUFFER_CLIENT_MAPPED_MEMORY_H_ #include <vector> -#include "base/basictypes.h" -#include "base/ref_counted.h" -#include "gpu/command_buffer/client/fenced_allocator.h" -#include "gpu/command_buffer/common/buffer.h" + +#include "../common/types.h" +#include "../client/fenced_allocator.h" +#include "../common/buffer.h" namespace gpu { class CommandBufferHelper; // Manages a shared memory segment. -class MemoryChunk : public base::RefCounted<MemoryChunk> { +class MemoryChunk { public: - typedef scoped_refptr<MemoryChunk> Ref; - MemoryChunk(int32 shm_id, gpu::Buffer shm, CommandBufferHelper* helper); // Gets the size of the largest free block that is available without waiting. @@ -107,6 +105,8 @@ class MappedMemoryManager { : helper_(helper) { } + ~MappedMemoryManager(); + // Allocates a block of memory // Parameters: // size: size of memory to allocate. @@ -132,7 +132,7 @@ class MappedMemoryManager { void FreePendingToken(void* pointer, int32 token); private: - typedef std::vector<MemoryChunk::Ref> MemoryChunkVector; + typedef std::vector<MemoryChunk*> MemoryChunkVector; CommandBufferHelper* helper_; MemoryChunkVector chunks_; diff --git a/gpu/command_buffer/client/mapped_memory_unittest.cc b/gpu/command_buffer/client/mapped_memory_unittest.cc index b983585..4728aee 100644 --- a/gpu/command_buffer/client/mapped_memory_unittest.cc +++ b/gpu/command_buffer/client/mapped_memory_unittest.cc @@ -6,6 +6,7 @@ #include "base/callback.h" #include "base/message_loop.h" #include "base/scoped_nsautorelease_pool.h" +#include "base/scoped_ptr.h" #include "gpu/command_buffer/client/cmd_buffer_helper.h" #include "gpu/command_buffer/service/mocks.h" #include "gpu/command_buffer/service/command_buffer_service.h" @@ -89,7 +90,7 @@ class MemoryChunkTest : public MappedMemoryTestBase { gpu::Buffer buf; buf.size = kBufferSize; buf.ptr = buffer_.get(); - chunk_ = new MemoryChunk(kShmId, buf, helper_.get()); + chunk_.reset(new MemoryChunk(kShmId, buf, helper_.get())); } virtual void TearDown() { @@ -99,7 +100,7 @@ class MemoryChunkTest : public MappedMemoryTestBase { MappedMemoryTestBase::TearDown(); } - MemoryChunk::Ref chunk_; + scoped_ptr<MemoryChunk> chunk_; scoped_array<uint8> buffer_; }; diff --git a/gpu/command_buffer/client/ring_buffer.cc b/gpu/command_buffer/client/ring_buffer.cc index 89da7fe..835f430 100644 --- a/gpu/command_buffer/client/ring_buffer.cc +++ b/gpu/command_buffer/client/ring_buffer.cc @@ -27,9 +27,9 @@ RingBuffer::~RingBuffer() { } void RingBuffer::FreeOldestBlock() { - DCHECK(!blocks_.empty()) << "no free blocks"; + GPU_DCHECK(!blocks_.empty()) << "no free blocks"; Block& block = blocks_.front(); - DCHECK(block.valid) << "attempt to allocate more than maximum memory"; + GPU_DCHECK(block.valid) << "attempt to allocate more than maximum memory"; helper_->WaitForToken(block.token); in_use_offset_ += block.size; if (in_use_offset_ == size_) { @@ -44,8 +44,8 @@ void RingBuffer::FreeOldestBlock() { } RingBuffer::Offset RingBuffer::Alloc(unsigned int size) { - DCHECK_LE(size, size_) << "attempt to allocate more than maximum memory"; - DCHECK(blocks_.empty() || blocks_.back().valid) + GPU_DCHECK_LE(size, size_) << "attempt to allocate more than maximum memory"; + GPU_DCHECK(blocks_.empty() || blocks_.back().valid) << "Attempt to alloc another block before freeing the previous."; // Similarly to malloc, an allocation of 0 allocates at least 1 byte, to // return different pointers every time. @@ -68,19 +68,20 @@ RingBuffer::Offset RingBuffer::Alloc(unsigned int size) { void RingBuffer::FreePendingToken(RingBuffer::Offset offset, unsigned int token) { offset -= base_offset_; - DCHECK(!blocks_.empty()) << "no allocations to free"; + GPU_DCHECK(!blocks_.empty()) << "no allocations to free"; for (Container::reverse_iterator it = blocks_.rbegin(); it != blocks_.rend(); ++it) { Block& block = *it; if (block.offset == offset) { - DCHECK(!block.valid) << "block that corresponds to offset already freed"; + GPU_DCHECK(!block.valid) + << "block that corresponds to offset already freed"; block.token = token; block.valid = true; return; } } - NOTREACHED() << "attempt to free non-existant block"; + GPU_NOTREACHED() << "attempt to free non-existant block"; } unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() { @@ -89,7 +90,7 @@ unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() { if (free_offset_ == in_use_offset_) { if (blocks_.empty()) { // The entire buffer is free. - DCHECK_EQ(free_offset_, 0u); + GPU_DCHECK_EQ(free_offset_, 0u); return size_; } else { // The entire buffer is in use. diff --git a/gpu/command_buffer/client/ring_buffer.h b/gpu/command_buffer/client/ring_buffer.h index 38ee912..b7194bb 100644 --- a/gpu/command_buffer/client/ring_buffer.h +++ b/gpu/command_buffer/client/ring_buffer.h @@ -155,7 +155,7 @@ class RingBufferWrapper { // pointer: the pointer to the memory block to free. // token: the token value to wait for before re-using the memory. void FreePendingToken(void* pointer, unsigned int token) { - DCHECK(pointer); + GPU_DCHECK(pointer); allocator_.FreePendingToken(GetOffset(pointer), token); } diff --git a/gpu/command_buffer/client/ring_buffer_test.cc b/gpu/command_buffer/client/ring_buffer_test.cc index 193906a..9ccb9b43 100644 --- a/gpu/command_buffer/client/ring_buffer_test.cc +++ b/gpu/command_buffer/client/ring_buffer_test.cc @@ -76,7 +76,7 @@ class BaseRingBufferTest : public testing::Test { scoped_ptr<CommandBufferHelper> helper_; }; -#ifndef COMPILER_MSVC +#ifndef _MSC_VER const unsigned int BaseRingBufferTest::kBaseOffset; const unsigned int BaseRingBufferTest::kBufferSize; #endif diff --git a/gpu/command_buffer/common/cmd_buffer_common.cc b/gpu/command_buffer/common/cmd_buffer_common.cc index 974bed9..abfdc93 100644 --- a/gpu/command_buffer/common/cmd_buffer_common.cc +++ b/gpu/command_buffer/common/cmd_buffer_common.cc @@ -8,7 +8,7 @@ #include "../common/cmd_buffer_common.h" namespace gpu { -#if !defined(OS_WIN) +#if !defined(_WIN32) // gcc needs this to link, but MSVC requires it not be present const int32 CommandHeader::kMaxSize; #endif diff --git a/gpu/command_buffer/common/cmd_buffer_common.h b/gpu/command_buffer/common/cmd_buffer_common.h index 0ab81ed..b012510 100644 --- a/gpu/command_buffer/common/cmd_buffer_common.h +++ b/gpu/command_buffer/common/cmd_buffer_common.h @@ -40,7 +40,7 @@ struct CommandHeader { static const int32 kMaxSize = (1 << 21) - 1; void Init(uint32 _command, int32 _size) { - DCHECK_LE(_size, kMaxSize); + GPU_DCHECK_LE(_size, kMaxSize); command = _command; size = _size; } @@ -65,7 +65,7 @@ struct CommandHeader { template <typename T> void SetCmdByTotalSize(uint32 size_in_bytes) { COMPILE_ASSERT(T::kArgFlags == cmd::kAtLeastN, Cmd_kArgFlags_not_kAtLeastN); - DCHECK_GE(size_in_bytes, sizeof(T)); // NOLINT + GPU_DCHECK_GE(size_in_bytes, sizeof(T)); // NOLINT Init(T::kCmdId, ComputeNumEntries(size_in_bytes)); } }; @@ -130,7 +130,7 @@ void* NextImmediateCmdAddress(void* cmd, uint32 size_of_data_in_bytes) { template <typename T> void* NextImmediateCmdAddressTotalSize(void* cmd, uint32 total_size_in_bytes) { COMPILE_ASSERT(T::kArgFlags == cmd::kAtLeastN, Cmd_kArgFlags_not_kAtLeastN); - DCHECK_GE(total_size_in_bytes, sizeof(T)); // NOLINT + GPU_DCHECK_GE(total_size_in_bytes, sizeof(T)); // NOLINT return reinterpret_cast<char*>(cmd) + RoundSizeToMultipleOfEntries(total_size_in_bytes); } @@ -181,7 +181,7 @@ struct Noop { static const cmd::ArgFlags kArgFlags = cmd::kAtLeastN; void SetHeader(uint32 skip_count) { - DCHECK_GT(skip_count, 0u); + GPU_DCHECK_GT(skip_count, 0u); header.Init(kCmdId, skip_count); } diff --git a/gpu/command_buffer/common/gles2_cmd_utils.cc b/gpu/command_buffer/common/gles2_cmd_utils.cc index a517c89..4ed42a2 100644 --- a/gpu/command_buffer/common/gles2_cmd_utils.cc +++ b/gpu/command_buffer/common/gles2_cmd_utils.cc @@ -458,7 +458,7 @@ uint32 GLES2Util::GLErrorToErrorBit(uint32 error) { case GL_INVALID_FRAMEBUFFER_OPERATION: return gl_error_bit::kInvalidFrameBufferOperation; default: - NOTREACHED(); + GPU_NOTREACHED(); return gl_error_bit::kNoError; } } @@ -476,7 +476,7 @@ uint32 GLES2Util::GLErrorBitToGLError(uint32 error_bit) { case gl_error_bit::kInvalidFrameBufferOperation: return GL_INVALID_FRAMEBUFFER_OPERATION; default: - NOTREACHED(); + GPU_NOTREACHED(); return GL_NO_ERROR; } } diff --git a/gpu/command_buffer/common/id_allocator.cc b/gpu/command_buffer/common/id_allocator.cc index faa4599..6b2c0e4 100644 --- a/gpu/command_buffer/common/id_allocator.cc +++ b/gpu/command_buffer/common/id_allocator.cc @@ -25,7 +25,7 @@ ResourceId IdAllocator::FindFirstFree() const { } ResourceId IdAllocator::AllocateIDAtOrAbove(ResourceId desired_id) { - DCHECK_LT(static_cast<ResourceId>(used_ids_.size()), + GPU_DCHECK_LT(static_cast<ResourceId>(used_ids_.size()), static_cast<ResourceId>(-1)); for (; InUse(desired_id); ++desired_id) {} MarkAsUsed(desired_id); diff --git a/gpu/command_buffer/common/logging.h b/gpu/command_buffer/common/logging.h index 969fdbf..191f711a 100644 --- a/gpu/command_buffer/common/logging.h +++ b/gpu/command_buffer/common/logging.h @@ -2,43 +2,195 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// This file provides ability to stub LOG and CHECK. - #ifndef GPU_COMMAND_BUFFER_COMMON_LOGGING_H_ #define GPU_COMMAND_BUFFER_COMMON_LOGGING_H_ -#if defined(__native_client__) -#define STUB_LOG_AND_CHECK 1 -#endif // __native_client__ - -#if defined STUB_LOG_AND_CHECK -#include <sstream> - -// TODO: implement logging through nacl's debug service runtime if -// available. -#define CHECK(X) if (0) std::ostringstream() -#define CHECK_EQ(X, Y) if (0) std::ostringstream() -#define CHECK_NE(X, Y) if (0) std::ostringstream() -#define CHECK_GT(X, Y) if (0) std::ostringstream() -#define CHECK_GE(X, Y) if (0) std::ostringstream() -#define CHECK_LT(X, Y) if (0) std::ostringstream() -#define CHECK_LE(X, Y) if (0) std::ostringstream() - -#define DCHECK(X) if (0) std::ostringstream() -#define DCHECK_EQ(X, Y) if (0) std::ostringstream() -#define DCHECK_NE(X, Y) if (0) std::ostringstream() -#define DCHECK_GT(X, Y) if (0) std::ostringstream() -#define DCHECK_GE(X, Y) if (0) std::ostringstream() -#define DCHECK_LT(X, Y) if (0) std::ostringstream() -#define DCHECK_LE(X, Y) if (0) std::ostringstream() - -#define LOG(LEVEL) if (0) std::ostringstream() -#define DLOG(LEVEL) if (0) std::ostringstream() - -#define NOTREACHED() DCHECK(false) - -#else // STUB_LOG_AND_CHECK -#include "base/logging.h" -#endif // STUB_LOG_AND_CHECK +#include <assert.h> + +#include <iostream> + +// Windows defines an ERROR macro. +#ifdef ERROR +#undef ERROR +#endif + +namespace gpu { + +// Members are uppercase instead of kCamelCase for consistency with base log +// severity enum. +enum LogLevel { + INFO, + WARNING, + ERROR, + FATAL, +}; + +// This is a very simple logger for use in command buffer code. Common and +// command buffer code cannot be dependent on base. It just outputs the message +// to stderr. +class Logger { + public: + Logger(bool condition, LogLevel level) + : condition_(condition), + level_(level) { + } + + template <typename X> + static Logger CheckTrue(const X& x, + const char* file, int line, + const char* x_name, + const char* check_name) { + return Logger(!!x, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << ")) failed. "; + } + + template <typename X, typename Y> + static Logger CheckEqual(const X& x, const Y& y, + const char* file, int line, + const char* x_name, const char* y_name, + const char* check_name) { + return Logger(x == y, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << "), " + << y_name << "(" << y << ")) failed. "; + } + + template <typename X, typename Y> + static Logger CheckNotEqual(const X& x, const Y& y, + const char* file, int line, + const char* x_name, const char* y_name, + const char* check_name) { + return Logger(x != y, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << "), " + << y_name << "(" << y << ")) failed. "; + } + + template <typename X, typename Y> + static Logger CheckLessThan(const X& x, const Y& y, + const char* file, int line, + const char* x_name, const char* y_name, + const char* check_name) { + return Logger(x < y, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << "), " + << y_name << "(" << y << ")) failed. "; + } + + template <typename X, typename Y> + static Logger CheckGreaterThan(const X& x, const Y& y, + const char* file, int line, + const char* x_name, const char* y_name, + const char* check_name) { + return Logger(x > y, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << "), " + << y_name << "(" << y << ")) failed. "; + } + + template <typename X, typename Y> + static Logger CheckLessEqual(const X& x, const Y& y, + const char* file, int line, + const char* x_name, const char* y_name, + const char* check_name) { + return Logger(x <= y, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << "), " + << y_name << "(" << y << ")) failed. "; + } + + template <typename X, typename Y> + static Logger CheckGreaterEqual(const X& x, const Y& y, + const char* file, int line, + const char* x_name, const char* y_name, + const char* check_name) { + return Logger(x >= y, FATAL) + << file << "(" << line << "): " << check_name + << "(" << x_name << " (" << x << "), " + << y_name << "(" << y << ")) failed. "; + } + + ~Logger() { + if (!condition_) { + std::cerr << std::endl; + std::cerr.flush(); + if (level_ == FATAL) + assert(false); + } + } + + template <typename T> + Logger& operator<<(const T& value) { + if (!condition_) + std::cerr << value; + return *this; + } + + private: + Logger(const Logger& logger): condition_(logger.condition_) { + } + + bool condition_; + LogLevel level_; +}; + +} // namespace gpu + +#define GPU_CHECK(X) ::gpu::Logger::CheckTrue( \ + (X), __FILE__, __LINE__, #X, "GPU_CHECK") +#define GPU_CHECK_EQ(X, Y) ::gpu::Logger::CheckEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_CHECK_EQ") +#define GPU_CHECK_NE(X, Y) ::gpu::Logger::CheckNotEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_CHECK_NE") +#define GPU_CHECK_GT(X, Y) ::gpu::Logger::CheckGreaterThan( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_CHECK_GT") +#define GPU_CHECK_LT(X, Y) ::gpu::Logger::CheckLessThan( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_CHECK_LT") +#define GPU_CHECK_GE(X, Y) ::gpu::Logger::CheckGreaterEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_CHECK_GE") +#define GPU_CHECK_LE(X, Y) ::gpu::Logger::CheckLessEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_CHECK_LE") +#define GPU_LOG(LEVEL) ::gpu::Logger(false, LEVEL) + +#if defined(NDEBUG) + +#define GPU_DCHECK(X) ::gpu::Logger::CheckTrue( \ + true, __FILE__, __LINE__, #X, "GPU_DCHECK") +#define GPU_DCHECK_EQ(X, Y) ::gpu::Logger::CheckEqual( \ + false, false, __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_EQ") +#define GPU_DCHECK_NE(X, Y) ::gpu::Logger::CheckEqual( \ + false, false, __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_NE") +#define GPU_DCHECK_GT(X, Y) ::gpu::Logger::CheckEqual( \ + false, false, __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_GT") +#define GPU_DCHECK_LT(X, Y) ::gpu::Logger::CheckEqual( \ + false, false, __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_LT") +#define GPU_DCHECK_GE(X, Y) ::gpu::Logger::CheckEqual( \ + false, false, __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_GE") +#define GPU_DCHECK_LE(X, Y) ::gpu::Logger::CheckEqual( \ + false, false, __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_LE") +#define GPU_DLOG(LEVEL) ::gpu::Logger(false, LEVEL) + +#else // NDEBUG + +#define GPU_DCHECK(X) ::gpu::Logger::CheckTrue( \ + (X), __FILE__, __LINE__, #X, "GPU_DCHECK") +#define GPU_DCHECK_EQ(X, Y) ::gpu::Logger::CheckEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_EQ") +#define GPU_DCHECK_NE(X, Y) ::gpu::Logger::CheckNotEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_NE") +#define GPU_DCHECK_GT(X, Y) ::gpu::Logger::CheckGreaterThan( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_GT") +#define GPU_DCHECK_LT(X, Y) ::gpu::Logger::CheckLessThan( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_LT") +#define GPU_DCHECK_GE(X, Y) ::gpu::Logger::CheckGreaterEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_GE") +#define GPU_DCHECK_LE(X, Y) ::gpu::Logger::CheckLessEqual( \ + (X), (Y), __FILE__, __LINE__, #X, #Y, "GPU_DCHECK_LE") +#define GPU_DLOG(LEVEL) ::gpu::Logger(true, LEVEL) + +#endif // NDEBUG + +#define GPU_NOTREACHED() GPU_DCHECK(false) #endif // GPU_COMMAND_BUFFER_COMMON_LOGGING_H_ diff --git a/gpu/command_buffer/common/scoped_ptr.h b/gpu/command_buffer/common/scoped_ptr.h index 5f7adf7..6415ec0 100644 --- a/gpu/command_buffer/common/scoped_ptr.h +++ b/gpu/command_buffer/common/scoped_ptr.h @@ -44,9 +44,7 @@ #include <stdlib.h> #include <cstddef> -#ifndef __native_client__ -#include "base/scoped_ptr.h" -#else +namespace gpu { // A scoped_ptr<T> is like a T*, except that the destructor of scoped_ptr<T> // automatically deletes the pointer it holds (if any). @@ -381,5 +379,6 @@ bool operator!=(C* p, const scoped_ptr_malloc<C, FP>& b) { return p != b.get(); } -#endif // __native_client__ +} // namespace gpu + #endif // GPU_COMMAND_BUFFER_COMMON_SCOPED_PTR_H_ diff --git a/gpu/command_buffer/common/thread_local.h b/gpu/command_buffer/common/thread_local.h index 4981c5d..bc9ff66 100644 --- a/gpu/command_buffer/common/thread_local.h +++ b/gpu/command_buffer/common/thread_local.h @@ -7,9 +7,7 @@ #ifndef GPU_COMMAND_BUFFER_COMMON_THREAD_LOCAL_H_ #define GPU_COMMAND_BUFFER_COMMON_THREAD_LOCAL_H_ -#include <build/build_config.h> - -#if defined(OS_WIN) +#if defined(_WIN32) #include <windows.h> #else #include <pthread.h> @@ -17,14 +15,14 @@ namespace gpu { -#if defined(OS_WIN) +#if defined(_WIN32) typedef DWORD ThreadLocalKey; #else typedef pthread_key_t ThreadLocalKey; #endif inline ThreadLocalKey ThreadLocalAlloc() { -#if defined(OS_WIN) +#if defined(_WIN32) return TlsAlloc(); #else ThreadLocalKey key; @@ -34,7 +32,7 @@ inline ThreadLocalKey ThreadLocalAlloc() { } inline void ThreadLocalFree(ThreadLocalKey key) { -#if defined(OS_WIN) +#if defined(_WIN32) TlsFree(key); #else pthread_key_delete(key); @@ -42,7 +40,7 @@ inline void ThreadLocalFree(ThreadLocalKey key) { } inline void ThreadLocalSetValue(ThreadLocalKey key, void* value) { -#if defined(OS_WIN) +#if defined(_WIN32) TlsSetValue(key, value); #else pthread_setspecific(key, value); @@ -50,7 +48,7 @@ inline void ThreadLocalSetValue(ThreadLocalKey key, void* value) { } inline void* ThreadLocalGetValue(ThreadLocalKey key) { -#if defined(OS_WIN) +#if defined(_WIN32) return TlsGetValue(key); #else return pthread_getspecific(key); diff --git a/gpu/command_buffer/common/types.h b/gpu/command_buffer/common/types.h index beba4fc..103de0f 100644 --- a/gpu/command_buffer/common/types.h +++ b/gpu/command_buffer/common/types.h @@ -7,16 +7,11 @@ #ifndef GPU_COMMAND_BUFFER_COMMON_TYPES_H_ #define GPU_COMMAND_BUFFER_COMMON_TYPES_H_ -#include <build/build_config.h> -#if !defined(COMPILER_MSVC) +#if !defined(_MSC_VER) #include <stdint.h> #endif #include <string> -#ifndef __native_client__ -#include "base/basictypes.h" -#else - typedef signed char schar; typedef signed char int8; // TODO(mbelshe) Remove these type guards. These are @@ -170,11 +165,8 @@ struct GpuCompileAssert { // This is to avoid running into a bug in MS VC 7.1, which // causes ((0.0) ? 1 : -1) to incorrectly evaluate to 1. - -#endif - namespace gpu { -#if defined(COMPILER_MSVC) +#if defined(_MSC_VER) typedef short Int16; typedef unsigned short Uint16; typedef int Int32; diff --git a/gpu/command_buffer/service/cmd_parser.cc b/gpu/command_buffer/service/cmd_parser.cc index a4b4755..4380aca 100644 --- a/gpu/command_buffer/service/cmd_parser.cc +++ b/gpu/command_buffer/service/cmd_parser.cc @@ -6,6 +6,8 @@ #include "gpu/command_buffer/service/cmd_parser.h" +#include "base/logging.h" + namespace gpu { CommandParser::CommandParser(void *shm_address, diff --git a/gpu/command_buffer/service/cmd_parser_test.cc b/gpu/command_buffer/service/cmd_parser_test.cc index 0f2509e..7917eee 100644 --- a/gpu/command_buffer/service/cmd_parser_test.cc +++ b/gpu/command_buffer/service/cmd_parser_test.cc @@ -4,6 +4,7 @@ // Tests for the command parser. +#include "base/logging.h" #include "base/scoped_ptr.h" #include "gpu/command_buffer/service/cmd_parser.h" #include "gpu/command_buffer/service/mocks.h" diff --git a/gpu/command_buffer/service/mocks.h b/gpu/command_buffer/service/mocks.h index a7eea11..647fead 100644 --- a/gpu/command_buffer/service/mocks.h +++ b/gpu/command_buffer/service/mocks.h @@ -12,9 +12,11 @@ #define GPU_COMMAND_BUFFER_SERVICE_MOCKS_H_ #include <vector> -#include "testing/gmock/include/gmock/gmock.h" + +#include "base/logging.h" #include "gpu/command_buffer/service/cmd_parser.h" #include "gpu/command_buffer/service/cmd_buffer_engine.h" +#include "testing/gmock/include/gmock/gmock.h" namespace gpu { diff --git a/gpu/demos/demos.gyp b/gpu/demos/demos.gyp index e7fc57e..682fc12 100644 --- a/gpu/demos/demos.gyp +++ b/gpu/demos/demos.gyp @@ -30,6 +30,11 @@ 'framework/demo.h', 'framework/demo_factory.h', ], + 'all_dependent_settings': { + 'include_dirs': [ + '../..', + ], + }, }, { 'target_name': 'gpu_demo_framework_exe', diff --git a/gpu/demos/gles2_book/example.h b/gpu/demos/gles2_book/example.h index 38711a7..0a1d4e8 100644 --- a/gpu/demos/gles2_book/example.h +++ b/gpu/demos/gles2_book/example.h @@ -7,6 +7,7 @@ #ifndef GPU_DEMOS_GLES2_BOOK_EXAMPLE_H_ #define GPU_DEMOS_GLES2_BOOK_EXAMPLE_H_ +#include "base/logging.h" #include "gpu/command_buffer/common/logging.h" #include "gpu/demos/framework/demo.h" #include "third_party/gles2_book/Common/Include/esUtil.h" diff --git a/gpu/gpu.gyp b/gpu/gpu.gyp index 755debc..4836307 100644 --- a/gpu/gpu.gyp +++ b/gpu/gpu.gyp @@ -12,17 +12,12 @@ 'type': 'static_library', 'include_dirs': [ '.', - '..', ], 'all_dependent_settings': { 'include_dirs': [ '.', - '..', ], }, - 'dependencies': [ - '../base/base.gyp:base', - ], 'sources': [ 'command_buffer/common/bitfield_helpers.h', 'command_buffer/common/buffer.h', @@ -136,6 +131,7 @@ 'dependencies': [ 'command_buffer_common', '../app/app.gyp:app_base', + '../base/base.gyp:base', '../gfx/gfx.gyp:gfx', '../third_party/angle/src/build_angle.gyp:translator_glsl', ], @@ -289,6 +285,9 @@ 'gles2_c_lib', '../third_party/npapi/npapi.gyp:npapi', ], + 'include_dirs': [ + '..', + ], 'all_dependent_settings': { 'include_dirs': [ '../third_party/npapi/bindings', diff --git a/gpu/gpu_plugin/gpu_plugin.cc b/gpu/gpu_plugin/gpu_plugin.cc index bdec53d..d1dd9ae 100644 --- a/gpu/gpu_plugin/gpu_plugin.cc +++ b/gpu/gpu_plugin/gpu_plugin.cc @@ -6,7 +6,6 @@ #include <windows.h> #endif -#include "base/logging.h" #include "build/build_config.h" #include "gpu/gpu_plugin/gpu_plugin.h" #include "third_party/npapi/bindings/nphostapi.h" diff --git a/gpu/pgl/command_buffer_pepper.cc b/gpu/pgl/command_buffer_pepper.cc index 323dc89..dfb204a 100644 --- a/gpu/pgl/command_buffer_pepper.cc +++ b/gpu/pgl/command_buffer_pepper.cc @@ -4,6 +4,7 @@ #include "gpu/pgl/command_buffer_pepper.h" +#include "base/logging.h" #include "gpu/command_buffer/common/logging.h" using base::SharedMemory; diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi index a815944..2dc8c1c 100644 --- a/webkit/tools/test_shell/test_shell.gypi +++ b/webkit/tools/test_shell/test_shell.gypi @@ -637,6 +637,9 @@ '../npapi_pepper_test_plugin/plugin.rc', '../npapi_pepper_test_plugin/test_factory.cc', ], + 'include_dirs': [ + '../../..', + ], 'conditions': [ ['OS!="win"', { # windows-specific resources |