diff options
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r-- | gpu/command_buffer/client/fenced_allocator.h | 4 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.cc | 11 |
2 files changed, 9 insertions, 6 deletions
diff --git a/gpu/command_buffer/client/fenced_allocator.h b/gpu/command_buffer/client/fenced_allocator.h index fb97e37..fd162db41 100644 --- a/gpu/command_buffer/client/fenced_allocator.h +++ b/gpu/command_buffer/client/fenced_allocator.h @@ -212,7 +212,9 @@ class FencedAllocatorWrapper { // Gets the offset to a memory block given the base memory and the address. // It translates NULL to FencedAllocator::kInvalidOffset. FencedAllocator::Offset GetOffset(void *pointer) { - return pointer ? static_cast<char *>(pointer) - static_cast<char *>(base_) : + return pointer ? + static_cast<FencedAllocator::Offset>( + static_cast<char*>(pointer) - static_cast<char*>(base_)) : FencedAllocator::kInvalidOffset; } diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 6dad4e2..58ddd2b 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -311,8 +311,8 @@ class ClientSideBufferHelper { size_t bytes_per_element = GLES2Util::GetGLTypeSizeForTexturesAndBuffers(info.type()) * info.size(); - GLsizei real_stride = - info.stride() ? info.stride() : bytes_per_element; + GLsizei real_stride = info.stride() ? + info.stride() : static_cast<GLsizei>(bytes_per_element); GLsizei bytes_collected = CollectData( info.pointer(), bytes_per_element, real_stride, num_elements); gl->BufferSubData( @@ -814,8 +814,8 @@ void GLES2Implementation::ShaderSource( uint32 total_size = 1; for (GLsizei ii = 0; ii < count; ++ii) { if (source[ii]) { - total_size += - (length && length[ii] >= 0) ? length[ii] : strlen(source[ii]); + total_size += (length && length[ii] >= 0) ? + static_cast<size_t>(length[ii]) : strlen(source[ii]); } } @@ -826,7 +826,8 @@ void GLES2Implementation::ShaderSource( for (GLsizei ii = 0; ii <= count; ++ii) { const char* src = ii < count ? source[ii] : ""; if (src) { - uint32 size = ii < count ? (length ? length[ii] : strlen(src)) : 1; + uint32 size = ii < count ? + (length ? static_cast<size_t>(length[ii]) : strlen(src)) : 1; while (size) { uint32 part_size = std::min(size, max_size); void* buffer = transfer_buffer_.Alloc(part_size); |