summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 21:49:37 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-05 21:49:37 +0000
commitcf1aa980fbfb3e35efdfc079be4e4a7c1717a8cd (patch)
tree00282ec9fa81a72338e694cc63ffbb8ae522fd0c /gpu/command_buffer/client
parent11780356e666b6dfe875f7ac610d368c18fd21e3 (diff)
downloadchromium_src-cf1aa980fbfb3e35efdfc079be4e4a7c1717a8cd.zip
chromium_src-cf1aa980fbfb3e35efdfc079be4e4a7c1717a8cd.tar.gz
chromium_src-cf1aa980fbfb3e35efdfc079be4e4a7c1717a8cd.tar.bz2
Delete gpu/command_buffer/common/logging.h
command_buffer was historically included in nacl-compiled things, and base wasn't. These days, base is included in nacl-compiled things too, so the duplication can be removed. This will remove 1 static initializer. BUG=94925 R=piman@chromium.org Review URL: https://codereview.chromium.org/58823003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client')
-rw-r--r--gpu/command_buffer/client/atomicops.cc7
-rw-r--r--gpu/command_buffer/client/buffer_tracker.cc6
-rw-r--r--gpu/command_buffer/client/client_context_state.cc3
-rw-r--r--gpu/command_buffer/client/client_test_helper.cc14
-rw-r--r--gpu/command_buffer/client/cmd_buffer_helper.cc22
-rw-r--r--gpu/command_buffer/client/cmd_buffer_helper.h1
-rw-r--r--gpu/command_buffer/client/fenced_allocator.cc16
-rw-r--r--gpu/command_buffer/client/fenced_allocator.h6
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc64
-rw-r--r--gpu/command_buffer/client/gles2_implementation_impl_autogen.h12
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest.cc2
-rw-r--r--gpu/command_buffer/client/gpu_memory_buffer_tracker.cc2
-rw-r--r--gpu/command_buffer/client/mapped_memory.cc15
-rw-r--r--gpu/command_buffer/client/program_info_manager.cc13
-rw-r--r--gpu/command_buffer/client/query_tracker.cc12
-rw-r--r--gpu/command_buffer/client/ring_buffer.cc19
-rw-r--r--gpu/command_buffer/client/ring_buffer.h4
-rw-r--r--gpu/command_buffer/client/share_group.cc7
-rw-r--r--gpu/command_buffer/client/transfer_buffer.cc6
-rw-r--r--gpu/command_buffer/client/vertex_array_object_manager.cc14
20 files changed, 128 insertions, 117 deletions
diff --git a/gpu/command_buffer/client/atomicops.cc b/gpu/command_buffer/client/atomicops.cc
index c4d5cb1..ef68f9e 100644
--- a/gpu/command_buffer/client/atomicops.cc
+++ b/gpu/command_buffer/client/atomicops.cc
@@ -3,7 +3,8 @@
// found in the LICENSE file.
#include "gpu/command_buffer/client/atomicops.h"
-#include "gpu/command_buffer/common/logging.h"
+
+#include "base/logging.h"
#if !defined(__native_client__)
#include "base/atomicops.h"
@@ -41,7 +42,7 @@ class LockImpl {
}
void Release() {
- GPU_DCHECK(acquired_);
+ DCHECK(acquired_);
acquired_ = false;
pthread_mutex_unlock(&mutex_);
}
@@ -55,7 +56,7 @@ class LockImpl {
}
void AssertAcquired() const {
- GPU_DCHECK(acquired_);
+ DCHECK(acquired_);
}
private:
diff --git a/gpu/command_buffer/client/buffer_tracker.cc b/gpu/command_buffer/client/buffer_tracker.cc
index f5ead5a..2768429 100644
--- a/gpu/command_buffer/client/buffer_tracker.cc
+++ b/gpu/command_buffer/client/buffer_tracker.cc
@@ -23,8 +23,8 @@ BufferTracker::~BufferTracker() {
BufferTracker::Buffer* BufferTracker::CreateBuffer(
GLuint id, GLsizeiptr size) {
- GPU_DCHECK_NE(0u, id);
- GPU_DCHECK_LE(0, size);
+ DCHECK_NE(0u, id);
+ DCHECK_LE(0, size);
int32 shm_id = -1;
uint32 shm_offset = 0;
void* address = NULL;
@@ -34,7 +34,7 @@ BufferTracker::Buffer* BufferTracker::CreateBuffer(
Buffer* buffer = new Buffer(id, size, shm_id, shm_offset, address);
std::pair<BufferMap::iterator, bool> result =
buffers_.insert(std::make_pair(id, buffer));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
return buffer;
}
diff --git a/gpu/command_buffer/client/client_context_state.cc b/gpu/command_buffer/client/client_context_state.cc
index ecb33b6..9f4fbad 100644
--- a/gpu/command_buffer/client/client_context_state.cc
+++ b/gpu/command_buffer/client/client_context_state.cc
@@ -3,7 +3,8 @@
// found in the LICENSE file.
#include "gpu/command_buffer/client/client_context_state.h"
-#include "gpu/command_buffer/common/logging.h"
+
+#include "base/logging.h"
namespace gpu {
namespace gles2 {
diff --git a/gpu/command_buffer/client/client_test_helper.cc b/gpu/command_buffer/client/client_test_helper.cc
index 9557fce..db191ce 100644
--- a/gpu/command_buffer/client/client_test_helper.cc
+++ b/gpu/command_buffer/client/client_test_helper.cc
@@ -76,16 +76,16 @@ Buffer MockCommandBufferBase::CreateTransferBuffer(size_t size, int32* id) {
}
void MockCommandBufferBase::DestroyTransferBufferHelper(int32 id) {
- GPU_DCHECK_GE(id, kTransferBufferBaseId);
- GPU_DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers);
+ DCHECK_GE(id, kTransferBufferBaseId);
+ DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers);
id -= kTransferBufferBaseId;
transfer_buffers_[id].reset();
transfer_buffer_buffers_[id] = Buffer();
}
Buffer MockCommandBufferBase::GetTransferBuffer(int32 id) {
- GPU_DCHECK_GE(id, kTransferBufferBaseId);
- GPU_DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers);
+ DCHECK_GE(id, kTransferBufferBaseId);
+ DCHECK_LT(id, kTransferBufferBaseId + kMaxTransferBuffers);
return transfer_buffer_buffers_[id - kTransferBufferBaseId];
}
@@ -94,18 +94,18 @@ void MockCommandBufferBase::FlushHelper(int32 put_offset) {
}
void MockCommandBufferBase::SetToken(int32 token) {
- GPU_NOTREACHED();
+ NOTREACHED();
state_.token = token;
}
void MockCommandBufferBase::SetParseError(error::Error error) {
- GPU_NOTREACHED();
+ NOTREACHED();
state_.error = error;
}
void MockCommandBufferBase::SetContextLostReason(
error::ContextLostReason reason) {
- GPU_NOTREACHED();
+ NOTREACHED();
state_.context_lost_reason = reason;
}
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc
index 662adf1..11219ed 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc
@@ -5,6 +5,8 @@
// This file contains the implementation of the command buffer helper class.
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
+
+#include "base/logging.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/trace_event.h"
@@ -87,7 +89,7 @@ void CommandBufferHelper::FreeResources() {
}
void CommandBufferHelper::FreeRingBuffer() {
- GPU_CHECK((put_ == get_offset()) ||
+ CHECK((put_ == get_offset()) ||
error::IsError(command_buffer_->GetLastState().error));
FreeResources();
}
@@ -130,7 +132,7 @@ bool CommandBufferHelper::Finish() {
if (put_ == get_offset()) {
return true;
}
- GPU_DCHECK(HaveRingBuffer());
+ DCHECK(HaveRingBuffer());
do {
// Do not loop forever if the flush fails, meaning the command buffer reader
// has shutdown.
@@ -150,7 +152,7 @@ int32 CommandBufferHelper::InsertToken() {
if (!usable()) {
return token_;
}
- GPU_DCHECK(HaveRingBuffer());
+ DCHECK(HaveRingBuffer());
// Increment token as 31-bit integer. Negative values are used to signal an
// error.
token_ = (token_ + 1) & 0x7FFFFFFF;
@@ -161,7 +163,7 @@ int32 CommandBufferHelper::InsertToken() {
TRACE_EVENT0("gpu", "CommandBufferHelper::InsertToken(wrapped)");
// we wrapped
Finish();
- GPU_DCHECK_EQ(token_, last_token_read());
+ DCHECK_EQ(token_, last_token_read());
}
}
return token_;
@@ -179,7 +181,7 @@ void CommandBufferHelper::WaitForToken(int32 token) {
if (token > token_) return; // we wrapped
while (last_token_read() < token) {
if (get_offset() == put_) {
- GPU_LOG(FATAL) << "Empty command buffer while waiting on a token.";
+ LOG(FATAL) << "Empty command buffer while waiting on a token.";
return;
}
// Do not loop forever if the flush fails, meaning the command buffer reader
@@ -199,14 +201,14 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) {
if (!usable()) {
return;
}
- GPU_DCHECK(HaveRingBuffer());
- GPU_DCHECK(count < total_entry_count_);
+ DCHECK(HaveRingBuffer());
+ DCHECK(count < total_entry_count_);
if (put_ + count > total_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 noops all the way to the end,
// 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 noops).
- GPU_DCHECK_LE(1, put_);
+ DCHECK_LE(1, put_);
if (get_offset() > put_ || get_offset() == 0) {
TRACE_EVENT0("gpu", "CommandBufferHelper::WaitForAvailableEntries");
while (get_offset() > put_ || get_offset() == 0) {
@@ -262,12 +264,12 @@ CommandBufferEntry* CommandBufferHelper::GetSpace(uint32 entries) {
if (!usable()) {
return NULL;
}
- GPU_DCHECK(HaveRingBuffer());
+ DCHECK(HaveRingBuffer());
++commands_issued_;
WaitForAvailableEntries(entries);
CommandBufferEntry* space = &entries_[put_];
put_ += entries;
- GPU_DCHECK_LE(put_, total_entry_count_);
+ DCHECK_LE(put_, total_entry_count_);
if (put_ == total_entry_count_) {
put_ = 0;
}
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.h b/gpu/command_buffer/client/cmd_buffer_helper.h
index e2639b3..a50dc7b 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.h
+++ b/gpu/command_buffer/client/cmd_buffer_helper.h
@@ -13,7 +13,6 @@
#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/constants.h"
-#include "gpu/command_buffer/common/logging.h"
#include "gpu/gpu_export.h"
namespace gpu {
diff --git a/gpu/command_buffer/client/fenced_allocator.cc b/gpu/command_buffer/client/fenced_allocator.cc
index 02e891f..0e90bf3 100644
--- a/gpu/command_buffer/client/fenced_allocator.cc
+++ b/gpu/command_buffer/client/fenced_allocator.cc
@@ -49,8 +49,8 @@ FencedAllocator::~FencedAllocator() {
}
}
// These checks are not valid if the service has crashed or lost the context.
- // GPU_DCHECK_EQ(blocks_.size(), 1u);
- // GPU_DCHECK_EQ(blocks_[0].state, FREE);
+ // DCHECK_EQ(blocks_.size(), 1u);
+ // DCHECK_EQ(blocks_[0].state, FREE);
}
// Looks for a non-allocated block that is big enough. Search in the FREE
@@ -92,7 +92,7 @@ FencedAllocator::Offset FencedAllocator::Alloc(unsigned int size) {
// necessary.
void FencedAllocator::Free(FencedAllocator::Offset offset) {
BlockIndex index = GetBlockByOffset(offset);
- GPU_DCHECK_NE(blocks_[index].state, FREE);
+ DCHECK_NE(blocks_[index].state, FREE);
Block &block = blocks_[index];
if (block.state == IN_USE)
@@ -136,7 +136,7 @@ unsigned int FencedAllocator::GetLargestFreeOrPendingSize() {
max_size = std::max(max_size, current_size);
current_size = 0;
} else {
- GPU_DCHECK(block.state == FREE || block.state == FREE_PENDING_TOKEN);
+ DCHECK(block.state == FREE || block.state == FREE_PENDING_TOKEN);
current_size += block.size;
}
}
@@ -195,7 +195,7 @@ FencedAllocator::BlockIndex FencedAllocator::CollapseFreeBlock(
FencedAllocator::BlockIndex FencedAllocator::WaitForTokenAndFreeBlock(
BlockIndex index) {
Block &block = blocks_[index];
- GPU_DCHECK_EQ(block.state, FREE_PENDING_TOKEN);
+ DCHECK_EQ(block.state, FREE_PENDING_TOKEN);
helper_->WaitForToken(block.token);
block.state = FREE;
return CollapseFreeBlock(index);
@@ -220,8 +220,8 @@ void FencedAllocator::FreeUnused() {
FencedAllocator::Offset FencedAllocator::AllocInBlock(BlockIndex index,
unsigned int size) {
Block &block = blocks_[index];
- GPU_DCHECK_GE(block.size, size);
- GPU_DCHECK_EQ(block.state, FREE);
+ DCHECK_GE(block.size, size);
+ DCHECK_EQ(block.state, FREE);
Offset offset = block.offset;
bytes_in_use_ += size;
if (block.size == size) {
@@ -241,7 +241,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());
- GPU_DCHECK(it != blocks_.end() && it->offset == offset);
+ 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 71e6178..bb5c551 100644
--- a/gpu/command_buffer/client/fenced_allocator.h
+++ b/gpu/command_buffer/client/fenced_allocator.h
@@ -9,7 +9,7 @@
#include <vector>
-#include "gpu/command_buffer/common/logging.h"
+#include "base/logging.h"
#include "gpu/command_buffer/common/types.h"
#include "gpu/gpu_export.h"
@@ -187,7 +187,7 @@ class FencedAllocatorWrapper {
// Parameters:
// pointer: the pointer to the memory block to free.
void Free(void *pointer) {
- GPU_DCHECK(pointer);
+ DCHECK(pointer);
allocator_.Free(GetOffset(pointer));
}
@@ -198,7 +198,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) {
- GPU_DCHECK(pointer);
+ DCHECK(pointer);
allocator_.FreePendingToken(GetOffset(pointer), token);
}
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 78eccf5..df70976 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -72,13 +72,13 @@ GLES2Implementation::GLStaticState::IntState::IntState()
GLES2Implementation::SingleThreadChecker::SingleThreadChecker(
GLES2Implementation* gles2_implementation)
: gles2_implementation_(gles2_implementation) {
- GPU_CHECK_EQ(0, gles2_implementation_->use_count_);
+ CHECK_EQ(0, gles2_implementation_->use_count_);
++gles2_implementation_->use_count_;
}
GLES2Implementation::SingleThreadChecker::~SingleThreadChecker() {
--gles2_implementation_->use_count_;
- GPU_CHECK_EQ(0, gles2_implementation_->use_count_);
+ CHECK_EQ(0, gles2_implementation_->use_count_);
}
GLES2Implementation::GLES2Implementation(
@@ -113,9 +113,9 @@ GLES2Implementation::GLES2Implementation(
error_message_callback_(NULL),
gpu_control_(gpu_control),
weak_ptr_factory_(this) {
- GPU_DCHECK(helper);
- GPU_DCHECK(transfer_buffer);
- GPU_DCHECK(gpu_control);
+ DCHECK(helper);
+ DCHECK(transfer_buffer);
+ DCHECK(gpu_control);
char temp[128];
sprintf(temp, "%p", static_cast<void*>(this));
@@ -137,9 +137,9 @@ bool GLES2Implementation::Initialize(
unsigned int min_transfer_buffer_size,
unsigned int max_transfer_buffer_size,
unsigned int mapped_memory_limit) {
- GPU_DCHECK_GE(starting_transfer_buffer_size, min_transfer_buffer_size);
- GPU_DCHECK_LE(starting_transfer_buffer_size, max_transfer_buffer_size);
- GPU_DCHECK_GE(min_transfer_buffer_size, kStartingOffset);
+ DCHECK_GE(starting_transfer_buffer_size, min_transfer_buffer_size);
+ DCHECK_LE(starting_transfer_buffer_size, max_transfer_buffer_size);
+ DCHECK_GE(min_transfer_buffer_size, kStartingOffset);
if (!transfer_buffer_->Initialize(
starting_transfer_buffer_size,
@@ -447,7 +447,7 @@ GLenum GLES2Implementation::GetGLError() {
#if defined(GL_CLIENT_FAIL_GL_ERRORS)
void GLES2Implementation::FailGLError(GLenum error) {
if (error != GL_NO_ERROR) {
- GPU_NOTREACHED() << "Error";
+ NOTREACHED() << "Error";
}
}
// NOTE: Calling GetGLError overwrites data in the result buffer.
@@ -483,7 +483,7 @@ void GLES2Implementation::SetGLErrorInvalidEnum(
bool GLES2Implementation::GetBucketContents(uint32 bucket_id,
std::vector<int8>* data) {
TRACE_EVENT0("gpu", "GLES2::GetBucketContents");
- GPU_DCHECK(data);
+ DCHECK(data);
const uint32 kStartSize = 32 * 1024;
ScopedTransferBufferPtr buffer(kStartSize, helper_, transfer_buffer_);
if (!buffer.valid()) {
@@ -529,7 +529,7 @@ bool GLES2Implementation::GetBucketContents(uint32 bucket_id,
void GLES2Implementation::SetBucketContents(
uint32 bucket_id, const void* data, size_t size) {
- GPU_DCHECK(data);
+ DCHECK(data);
helper_->SetBucketSize(bucket_id, size);
if (size > 0u) {
uint32 offset = 0;
@@ -561,7 +561,7 @@ void GLES2Implementation::SetBucketAsCString(
bool GLES2Implementation::GetBucketAsString(
uint32 bucket_id, std::string* str) {
- GPU_DCHECK(str);
+ 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
@@ -862,7 +862,7 @@ bool GLES2Implementation::MustBeContextLost() {
WaitForCmd();
context_lost = helper_->IsContextLost();
}
- GPU_CHECK(context_lost);
+ CHECK(context_lost);
return context_lost;
}
@@ -1046,7 +1046,7 @@ bool GLES2Implementation::DeleteProgramHelper(GLuint program) {
void GLES2Implementation::DeleteProgramStub(
GLsizei n, const GLuint* programs) {
- GPU_DCHECK_EQ(1, n);
+ DCHECK_EQ(1, n);
share_group_->program_info_manager()->DeleteInfo(programs[0]);
helper_->DeleteProgram(programs[0]);
}
@@ -1064,7 +1064,7 @@ bool GLES2Implementation::DeleteShaderHelper(GLuint shader) {
void GLES2Implementation::DeleteShaderStub(
GLsizei n, const GLuint* shaders) {
- GPU_DCHECK_EQ(1, n);
+ DCHECK_EQ(1, n);
share_group_->program_info_manager()->DeleteInfo(shaders[0]);
helper_->DeleteShader(shaders[0]);
}
@@ -1339,7 +1339,7 @@ void GLES2Implementation::ShaderSource(
}
}
- GPU_DCHECK_EQ(total_size, offset);
+ DCHECK_EQ(total_size, offset);
helper_->ShaderSourceBucket(shader, kResultBucketId);
helper_->SetBucketSize(kResultBucketId, 0);
@@ -1370,7 +1370,7 @@ void GLES2Implementation::BufferDataHelper(
// Create new buffer.
buffer = buffer_tracker_->CreateBuffer(buffer_id, size);
- GPU_DCHECK(buffer);
+ DCHECK(buffer);
if (buffer->address() && data)
memcpy(buffer->address(), data, size);
return;
@@ -1462,8 +1462,8 @@ void GLES2Implementation::BufferSubDataHelper(
void GLES2Implementation::BufferSubDataHelperImpl(
GLenum target, GLintptr offset, GLsizeiptr size, const void* data,
ScopedTransferBufferPtr* buffer) {
- GPU_DCHECK(buffer);
- GPU_DCHECK_GT(size, 0);
+ DCHECK(buffer);
+ DCHECK_GT(size, 0);
const int8* source = static_cast<const int8*>(data);
while (size) {
@@ -1843,7 +1843,7 @@ void GLES2Implementation::TexSubImage2D(
static GLint ComputeNumRowsThatFitInBuffer(
GLsizeiptr padded_row_size, GLsizeiptr unpadded_row_size,
unsigned int size) {
- GPU_DCHECK_GE(unpadded_row_size, 0);
+ DCHECK_GE(unpadded_row_size, 0);
if (padded_row_size == 0) {
return 1;
}
@@ -1856,10 +1856,10 @@ void GLES2Implementation::TexSubImage2DImpl(
GLsizei height, GLenum format, GLenum type, uint32 unpadded_row_size,
const void* pixels, uint32 pixels_padded_row_size, GLboolean internal,
ScopedTransferBufferPtr* buffer, uint32 buffer_padded_row_size) {
- GPU_DCHECK(buffer);
- GPU_DCHECK_GE(level, 0);
- GPU_DCHECK_GT(height, 0);
- GPU_DCHECK_GT(width, 0);
+ DCHECK(buffer);
+ DCHECK_GE(level, 0);
+ DCHECK_GT(height, 0);
+ DCHECK_GT(width, 0);
const int8* source = reinterpret_cast<const int8*>(pixels);
GLint original_yoffset = yoffset;
@@ -2148,7 +2148,7 @@ const GLubyte* GLES2Implementation::GetStringHelper(GLenum name) {
std::set<std::string> strings;
std::pair<GLStringMap::iterator, bool> insert_result =
gl_strings_.insert(std::make_pair(name, strings));
- GPU_DCHECK(insert_result.second);
+ DCHECK(insert_result.second);
it = insert_result.first;
}
std::set<std::string>& string_set = it->second;
@@ -2158,7 +2158,7 @@ const GLubyte* GLES2Implementation::GetStringHelper(GLenum name) {
} else {
std::pair<std::set<std::string>::const_iterator, bool> insert_result =
string_set.insert(str);
- GPU_DCHECK(insert_result.second);
+ DCHECK(insert_result.second);
result = insert_result.first->c_str();
}
}
@@ -2810,7 +2810,7 @@ void* GLES2Implementation::MapBufferSubDataCHROMIUM(
mem,
MappedBuffer(
access, shm_id, mem, shm_offset, target, offset, size)));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
GPU_CLIENT_LOG(" returned " << mem);
return mem;
}
@@ -2884,7 +2884,7 @@ void* GLES2Implementation::MapTexSubImage2DCHROMIUM(
MappedTexture(
access, shm_id, mem, shm_offset,
target, level, xoffset, yoffset, width, height, format, type)));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
GPU_CLIENT_LOG(" returned " << mem);
return mem;
}
@@ -2940,7 +2940,7 @@ const GLchar* GLES2Implementation::GetRequestableExtensionsCHROMIUM() {
} else {
std::pair<std::set<std::string>::const_iterator, bool> insert_result =
requestable_extensions_set_.insert(str);
- GPU_DCHECK(insert_result.second);
+ DCHECK(insert_result.second);
result = insert_result.first->c_str();
}
}
@@ -3122,7 +3122,7 @@ void GLES2Implementation::GetAllShaderPrecisionFormatsOnCompleted(
void GLES2Implementation::GetProgramInfoCHROMIUMHelper(
GLuint program, std::vector<int8>* result) {
- GPU_DCHECK(result);
+ DCHECK(result);
// Clear the bucket so if the command fails nothing will be in it.
helper_->SetBucketSize(kResultBucketId, 0);
helper_->GetProgramInfoCHROMIUM(program, kResultBucketId);
@@ -3143,7 +3143,7 @@ void GLES2Implementation::GetProgramInfoCHROMIUM(
}
// Make sure they've set size to 0 else the value will be undefined on
// lost context.
- GPU_DCHECK(*size == 0);
+ DCHECK(*size == 0);
std::vector<int8> result;
GetProgramInfoCHROMIUMHelper(program, &result);
if (result.empty()) {
@@ -3359,7 +3359,7 @@ void GLES2Implementation::GetQueryObjectuivEXT(
if (!query->CheckResultsAvailable(helper_)) {
// TODO(gman): Speed this up.
WaitForCmd();
- GPU_CHECK(query->CheckResultsAvailable(helper_));
+ CHECK(query->CheckResultsAvailable(helper_));
}
}
*params = query->GetResult();
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index 82e0ce0..acdfa90 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -251,7 +251,7 @@ void GLES2Implementation::DeleteBuffers(GLsizei n, const GLuint* buffers) {
});
GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
- GPU_DCHECK(buffers[i] != 0);
+ DCHECK(buffers[i] != 0);
}
});
if (n < 0) {
@@ -273,7 +273,7 @@ void GLES2Implementation::DeleteFramebuffers(
});
GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
- GPU_DCHECK(framebuffers[i] != 0);
+ DCHECK(framebuffers[i] != 0);
}
});
if (n < 0) {
@@ -303,7 +303,7 @@ void GLES2Implementation::DeleteRenderbuffers(
});
GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
- GPU_DCHECK(renderbuffers[i] != 0);
+ DCHECK(renderbuffers[i] != 0);
}
});
if (n < 0) {
@@ -332,7 +332,7 @@ void GLES2Implementation::DeleteTextures(GLsizei n, const GLuint* textures) {
});
GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
- GPU_DCHECK(textures[i] != 0);
+ DCHECK(textures[i] != 0);
}
});
if (n < 0) {
@@ -1511,7 +1511,7 @@ void GLES2Implementation::DeleteQueriesEXT(GLsizei n, const GLuint* queries) {
});
GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
- GPU_DCHECK(queries[i] != 0);
+ DCHECK(queries[i] != 0);
}
});
if (n < 0) {
@@ -1553,7 +1553,7 @@ void GLES2Implementation::DeleteVertexArraysOES(
});
GPU_CLIENT_DCHECK_CODE_BLOCK({
for (GLsizei i = 0; i < n; ++i) {
- GPU_DCHECK(arrays[i] != 0);
+ DCHECK(arrays[i] != 0);
}
});
if (n < 0) {
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest.cc b/gpu/command_buffer/client/gles2_implementation_unittest.cc
index 218c44e..0aa7da2 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest.cc
+++ b/gpu/command_buffer/client/gles2_implementation_unittest.cc
@@ -250,7 +250,7 @@ int MockTransferBuffer::GetResultOffset() {
}
void MockTransferBuffer::Free() {
- GPU_NOTREACHED();
+ NOTREACHED();
}
bool MockTransferBuffer::HaveBuffer() const {
diff --git a/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc b/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
index a957cc4..863028a 100644
--- a/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
+++ b/gpu/command_buffer/client/gpu_memory_buffer_tracker.cc
@@ -32,7 +32,7 @@ int32 GpuMemoryBufferTracker::CreateBuffer(
std::pair<BufferMap::iterator, bool> result =
buffers_.insert(std::make_pair(image_id, buffer));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
return image_id;
}
diff --git a/gpu/command_buffer/client/mapped_memory.cc b/gpu/command_buffer/client/mapped_memory.cc
index c367e69..15584aa 100644
--- a/gpu/command_buffer/client/mapped_memory.cc
+++ b/gpu/command_buffer/client/mapped_memory.cc
@@ -8,6 +8,7 @@
#include <functional>
#include "base/debug/trace_event.h"
+#include "base/logging.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
namespace gpu {
@@ -38,8 +39,8 @@ MappedMemoryManager::~MappedMemoryManager() {
void* MappedMemoryManager::Alloc(
unsigned int size, int32* shm_id, unsigned int* shm_offset) {
- GPU_DCHECK(shm_id);
- GPU_DCHECK(shm_offset);
+ DCHECK(shm_id);
+ DCHECK(shm_offset);
if (size <= allocated_memory_) {
size_t total_bytes_in_use = 0;
// See if any of the chunks can satisfy this request.
@@ -49,7 +50,7 @@ void* MappedMemoryManager::Alloc(
total_bytes_in_use += chunk->bytes_in_use();
if (chunk->GetLargestFreeSizeWithoutWaiting() >= size) {
void* mem = chunk->Alloc(size);
- GPU_DCHECK(mem);
+ DCHECK(mem);
*shm_id = chunk->shm_id();
*shm_offset = chunk->GetOffset(mem);
return mem;
@@ -66,7 +67,7 @@ void* MappedMemoryManager::Alloc(
MemoryChunk* chunk = chunks_[ii];
if (chunk->GetLargestFreeSizeWithWaiting() >= size) {
void* mem = chunk->Alloc(size);
- GPU_DCHECK(mem);
+ DCHECK(mem);
*shm_id = chunk->shm_id();
*shm_offset = chunk->GetOffset(mem);
return mem;
@@ -88,7 +89,7 @@ void* MappedMemoryManager::Alloc(
allocated_memory_ += mc->GetSize();
chunks_.push_back(mc);
void* mem = mc->Alloc(size);
- GPU_DCHECK(mem);
+ DCHECK(mem);
*shm_id = mc->shm_id();
*shm_offset = mc->GetOffset(mem);
return mem;
@@ -102,7 +103,7 @@ void MappedMemoryManager::Free(void* pointer) {
return;
}
}
- GPU_NOTREACHED();
+ NOTREACHED();
}
void MappedMemoryManager::FreePendingToken(void* pointer, int32 token) {
@@ -113,7 +114,7 @@ void MappedMemoryManager::FreePendingToken(void* pointer, int32 token) {
return;
}
}
- GPU_NOTREACHED();
+ NOTREACHED();
}
void MappedMemoryManager::FreeUnused() {
diff --git a/gpu/command_buffer/client/program_info_manager.cc b/gpu/command_buffer/client/program_info_manager.cc
index fb0c1f3..02b273a 100644
--- a/gpu/command_buffer/client/program_info_manager.cc
+++ b/gpu/command_buffer/client/program_info_manager.cc
@@ -2,12 +2,13 @@
// 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/program_info_manager.h"
+
#include <map>
#include "base/compiler_specific.h"
#include "gpu/command_buffer/client/atomicops.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
-#include "gpu/command_buffer/client/program_info_manager.h"
#include "gpu/command_buffer/common/gles2_cmd_utils.h"
namespace gpu {
@@ -229,7 +230,7 @@ CachedProgramInfoManager::Program::UniformInfo::UniformInfo(
type(_type),
name(_name) {
is_array = (!name.empty() && name[name.size() - 1] == ']');
- GPU_DCHECK(!(size > 1 && !is_array));
+ DCHECK(!(size > 1 && !is_array));
}
CachedProgramInfoManager::Program::Program()
@@ -308,7 +309,7 @@ template<typename T> static T LocalGetAs(
const std::vector<int8>& data, uint32 offset, size_t size) {
const int8* p = &data[0] + offset;
if (offset + size > data.size()) {
- GPU_NOTREACHED();
+ NOTREACHED();
return NULL;
}
return static_cast<T>(static_cast<const void*>(p));
@@ -325,7 +326,7 @@ void CachedProgramInfoManager::Program::Update(
// This should only happen on a lost context.
return;
}
- GPU_DCHECK_GE(result.size(), sizeof(ProgramInfoHeader));
+ DCHECK_GE(result.size(), sizeof(ProgramInfoHeader));
const ProgramInfoHeader* header = LocalGetAs<const ProgramInfoHeader*>(
result, 0, sizeof(header));
link_status_ = header->link_status != 0;
@@ -367,7 +368,7 @@ void CachedProgramInfoManager::Program::Update(
uniform_infos_.push_back(info);
++input;
}
- GPU_DCHECK_EQ(header->num_attribs + header->num_uniforms,
+ DCHECK_EQ(header->num_attribs + header->num_uniforms,
static_cast<uint32>(input - inputs));
cached_ = true;
}
@@ -397,7 +398,7 @@ void CachedProgramInfoManager::CreateInfo(GLuint program) {
std::pair<ProgramInfoMap::iterator, bool> result =
program_infos_.insert(std::make_pair(program, Program()));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
}
void CachedProgramInfoManager::DeleteInfo(GLuint program) {
diff --git a/gpu/command_buffer/client/query_tracker.cc b/gpu/command_buffer/client/query_tracker.cc
index 307b615..c128fbd 100644
--- a/gpu/command_buffer/client/query_tracker.cc
+++ b/gpu/command_buffer/client/query_tracker.cc
@@ -19,7 +19,7 @@ namespace gles2 {
QuerySyncManager::QuerySyncManager(MappedMemoryManager* manager)
: mapped_memory_(manager) {
- GPU_DCHECK(manager);
+ DCHECK(manager);
}
QuerySyncManager::~QuerySyncManager() {
@@ -31,7 +31,7 @@ QuerySyncManager::~QuerySyncManager() {
}
bool QuerySyncManager::Alloc(QuerySyncManager::QueryInfo* info) {
- GPU_DCHECK(info);
+ DCHECK(info);
if (free_queries_.empty()) {
int32 shm_id;
unsigned int shm_offset;
@@ -158,7 +158,7 @@ bool QueryTracker::Query::CheckResultsAvailable(
static_cast<uint64>(0xFFFFFFFFL));
break;
case GL_LATENCY_QUERY_CHROMIUM:
- GPU_DCHECK(info_.sync->result >= client_begin_time_us_);
+ DCHECK(info_.sync->result >= client_begin_time_us_);
result_ = std::min(info_.sync->result - client_begin_time_us_,
static_cast<uint64>(0xFFFFFFFFL));
break;
@@ -187,7 +187,7 @@ bool QueryTracker::Query::CheckResultsAvailable(
}
uint32 QueryTracker::Query::GetResult() const {
- GPU_DCHECK(state_ == kComplete || state_ == kUninitialized);
+ DCHECK(state_ == kComplete || state_ == kUninitialized);
return result_;
}
@@ -207,7 +207,7 @@ QueryTracker::~QueryTracker() {
}
QueryTracker::Query* QueryTracker::CreateQuery(GLuint id, GLenum target) {
- GPU_DCHECK_NE(0u, id);
+ DCHECK_NE(0u, id);
FreeCompletedQueries();
QuerySyncManager::QueryInfo info;
if (!query_sync_manager_.Alloc(&info)) {
@@ -216,7 +216,7 @@ QueryTracker::Query* QueryTracker::CreateQuery(GLuint id, GLenum target) {
Query* query = new Query(id, target, info);
std::pair<QueryMap::iterator, bool> result =
queries_.insert(std::make_pair(id, query));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
return query;
}
diff --git a/gpu/command_buffer/client/ring_buffer.cc b/gpu/command_buffer/client/ring_buffer.cc
index 42e09bd..25f6342 100644
--- a/gpu/command_buffer/client/ring_buffer.cc
+++ b/gpu/command_buffer/client/ring_buffer.cc
@@ -5,7 +5,10 @@
// This file contains the implementation of the RingBuffer class.
#include "gpu/command_buffer/client/ring_buffer.h"
+
#include <algorithm>
+
+#include "base/logging.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
namespace gpu {
@@ -27,9 +30,9 @@ RingBuffer::~RingBuffer() {
}
void RingBuffer::FreeOldestBlock() {
- GPU_DCHECK(!blocks_.empty()) << "no free blocks";
+ DCHECK(!blocks_.empty()) << "no free blocks";
Block& block = blocks_.front();
- GPU_DCHECK(block.state != IN_USE)
+ DCHECK(block.state != IN_USE)
<< "attempt to allocate more than maximum memory";
if (block.state == FREE_PENDING_TOKEN) {
helper_->WaitForToken(block.token);
@@ -47,8 +50,8 @@ void RingBuffer::FreeOldestBlock() {
}
RingBuffer::Offset RingBuffer::Alloc(unsigned int size) {
- GPU_DCHECK_LE(size, size_) << "attempt to allocate more than maximum memory";
- GPU_DCHECK(blocks_.empty() || blocks_.back().state != IN_USE)
+ DCHECK_LE(size, size_) << "attempt to allocate more than maximum memory";
+ DCHECK(blocks_.empty() || blocks_.back().state != IN_USE)
<< "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.
@@ -77,20 +80,20 @@ RingBuffer::Offset RingBuffer::Alloc(unsigned int size) {
void RingBuffer::FreePendingToken(RingBuffer::Offset offset,
unsigned int token) {
offset -= base_offset_;
- GPU_DCHECK(!blocks_.empty()) << "no allocations to free";
+ 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) {
- GPU_DCHECK(block.state == IN_USE)
+ DCHECK(block.state == IN_USE)
<< "block that corresponds to offset already freed";
block.token = token;
block.state = FREE_PENDING_TOKEN;
return;
}
}
- GPU_NOTREACHED() << "attempt to free non-existant block";
+ NOTREACHED() << "attempt to free non-existant block";
}
unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() {
@@ -103,7 +106,7 @@ unsigned int RingBuffer::GetLargestFreeSizeNoWaiting() {
if (free_offset_ == in_use_offset_) {
if (blocks_.empty()) {
// The entire buffer is free.
- GPU_DCHECK_EQ(free_offset_, 0u);
+ 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 d1f70a2..81f1cdd 100644
--- a/gpu/command_buffer/client/ring_buffer.h
+++ b/gpu/command_buffer/client/ring_buffer.h
@@ -9,7 +9,7 @@
#include <deque>
-#include "gpu/command_buffer/common/logging.h"
+#include "base/logging.h"
#include "gpu/command_buffer/common/types.h"
#include "gpu/gpu_export.h"
@@ -162,7 +162,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) {
- GPU_DCHECK(pointer);
+ DCHECK(pointer);
allocator_.FreePendingToken(GetOffset(pointer), token);
}
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc
index 9526df2..e61083d 100644
--- a/gpu/command_buffer/client/share_group.cc
+++ b/gpu/command_buffer/client/share_group.cc
@@ -2,12 +2,13 @@
// 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/share_group.h"
+
+#include "base/logging.h"
#include "gpu/command_buffer/client/atomicops.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/program_info_manager.h"
-#include "gpu/command_buffer/client/share_group.h"
#include "gpu/command_buffer/common/id_allocator.h"
-#include "gpu/command_buffer/common/logging.h"
namespace gpu {
namespace gles2 {
@@ -67,7 +68,7 @@ class StrictIdHandler : public IdHandler {
// Overridden from IdHandler.
virtual bool MarkAsUsedForBind(GLuint id) OVERRIDE {
- GPU_DCHECK(id == 0 || id_allocator_.InUse(id));
+ DCHECK(id == 0 || id_allocator_.InUse(id));
return IdHandler::MarkAsUsedForBind(id);
}
};
diff --git a/gpu/command_buffer/client/transfer_buffer.cc b/gpu/command_buffer/client/transfer_buffer.cc
index f4fe66c..c4b84a1 100644
--- a/gpu/command_buffer/client/transfer_buffer.cc
+++ b/gpu/command_buffer/client/transfer_buffer.cc
@@ -5,6 +5,8 @@
// A class to Manage a growing transfer buffer.
#include "gpu/command_buffer/client/transfer_buffer.h"
+
+#include "base/logging.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
namespace gpu {
@@ -118,7 +120,7 @@ static int Log2Floor(uint32 n) {
log += shift;
}
}
- GPU_DCHECK_EQ(value, 1u);
+ DCHECK_EQ(value, 1u);
return log;
}
@@ -153,7 +155,7 @@ void TransferBuffer::ReallocateRingBuffer(unsigned int size) {
void* TransferBuffer::AllocUpTo(
unsigned int size, unsigned int* size_allocated) {
- GPU_DCHECK(size_allocated);
+ DCHECK(size_allocated);
ReallocateRingBuffer(size);
diff --git a/gpu/command_buffer/client/vertex_array_object_manager.cc b/gpu/command_buffer/client/vertex_array_object_manager.cc
index f2a156e..3e98bd0 100644
--- a/gpu/command_buffer/client/vertex_array_object_manager.cc
+++ b/gpu/command_buffer/client/vertex_array_object_manager.cc
@@ -4,9 +4,9 @@
#include "gpu/command_buffer/client/vertex_array_object_manager.h"
+#include "base/logging.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
-#include "gpu/command_buffer/common/logging.h"
#if defined(__native_client__) && !defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)
#define GLES2_SUPPORT_CLIENT_SIDE_ARRAYS
@@ -234,7 +234,7 @@ void VertexArrayObject::SetAttribEnable(GLuint index, bool enabled) {
if (attrib.enabled() != enabled) {
if (attrib.IsClientSide()) {
num_client_side_pointers_enabled_ += enabled ? 1 : -1;
- GPU_DCHECK_GE(num_client_side_pointers_enabled_, 0);
+ DCHECK_GE(num_client_side_pointers_enabled_, 0);
}
attrib.set_enabled(enabled);
}
@@ -253,7 +253,7 @@ void VertexArrayObject::SetAttribPointer(
VertexAttrib& attrib = vertex_attribs_[index];
if (attrib.IsClientSide() && attrib.enabled()) {
--num_client_side_pointers_enabled_;
- GPU_DCHECK_GE(num_client_side_pointers_enabled_, 0);
+ DCHECK_GE(num_client_side_pointers_enabled_, 0);
}
attrib.SetInfo(buffer_id, size, type, normalized, stride, ptr);
@@ -368,18 +368,18 @@ bool VertexArrayObjectManager::BindElementArray(GLuint id) {
void VertexArrayObjectManager::GenVertexArrays(
GLsizei n, const GLuint* arrays) {
- GPU_DCHECK_GE(n, 0);
+ DCHECK_GE(n, 0);
for (GLsizei i = 0; i < n; ++i) {
std::pair<VertexArrayObjectMap::iterator, bool> result =
vertex_array_objects_.insert(std::make_pair(
arrays[i], new VertexArrayObject(max_vertex_attribs_)));
- GPU_DCHECK(result.second);
+ DCHECK(result.second);
}
}
void VertexArrayObjectManager::DeleteVertexArrays(
GLsizei n, const GLuint* arrays) {
- GPU_DCHECK_GE(n, 0);
+ DCHECK_GE(n, 0);
for (GLsizei i = 0; i < n; ++i) {
GLuint id = arrays[i];
if (id) {
@@ -534,7 +534,7 @@ bool VertexArrayObjectManager::SetupSimulatedClientSideBuffers(
ii, attrib.size(), attrib.type(), attrib.normalized(), 0,
array_buffer_offset_);
array_buffer_offset_ += RoundUpToMultipleOf4(bytes_collected);
- GPU_DCHECK_LE(array_buffer_offset_, array_buffer_size_);
+ DCHECK_LE(array_buffer_offset_, array_buffer_size_);
}
}
#endif // defined(GLES2_SUPPORT_CLIENT_SIDE_ARRAYS)