summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gpu/command_buffer/client/query_tracker.cc10
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc8
-rw-r--r--gpu/command_buffer/service/program_cache.cc6
-rw-r--r--gpu/command_buffer/service/program_manager.cc12
-rw-r--r--gpu/command_buffer/service/texture_manager.cc2
-rw-r--r--gpu/config/gpu_info_collector_win.cc17
6 files changed, 32 insertions, 23 deletions
diff --git a/gpu/command_buffer/client/query_tracker.cc b/gpu/command_buffer/client/query_tracker.cc
index c12d9753..e215c16 100644
--- a/gpu/command_buffer/client/query_tracker.cc
+++ b/gpu/command_buffer/client/query_tracker.cc
@@ -9,6 +9,7 @@
#include <GLES2/gl2extchromium.h>
#include "base/atomicops.h"
+#include "base/numerics/safe_conversions.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/mapped_memory.h"
@@ -153,19 +154,18 @@ bool QueryTracker::Query::CheckResultsAvailable(
helper->IsContextLost()) {
switch (target()) {
case GL_COMMANDS_ISSUED_CHROMIUM:
- result_ = std::min(info_.sync->result,
- static_cast<uint64>(0xFFFFFFFFL));
+ result_ = base::saturated_cast<uint32>(info_.sync->result);
break;
case GL_LATENCY_QUERY_CHROMIUM:
// Disabled DCHECK because of http://crbug.com/419236.
//DCHECK(info_.sync->result >= client_begin_time_us_);
- result_ = std::min(info_.sync->result - client_begin_time_us_,
- static_cast<uint64>(0xFFFFFFFFL));
+ result_ = base::saturated_cast<uint32>(
+ info_.sync->result - client_begin_time_us_);
break;
case GL_ASYNC_PIXEL_UNPACK_COMPLETED_CHROMIUM:
case GL_ASYNC_PIXEL_PACK_COMPLETED_CHROMIUM:
default:
- result_ = info_.sync->result;
+ result_ = static_cast<uint32>(info_.sync->result);
break;
}
state_ = kComplete;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 5fc5feb..6253cc8 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -3128,7 +3128,7 @@ bool GLES2DecoderImpl::CheckFramebufferValid(
return false;
if (backbuffer_needs_clear_bits_) {
glClearColor(0, 0, 0, (GLES2Util::GetChannelsForFormat(
- offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1);
+ offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1.f);
state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearStencil(0);
state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask);
@@ -3692,7 +3692,7 @@ bool GLES2DecoderImpl::ResizeOffscreenFrameBuffer(const gfx::Size& size) {
{
ScopedFrameBufferBinder binder(this, offscreen_target_frame_buffer_->id());
glClearColor(0, 0, 0, (GLES2Util::GetChannelsForFormat(
- offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1);
+ offscreen_target_color_format_) & 0x0008) != 0 ? 0 : 1.f);
state_.SetDeviceColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
glClearStencil(0);
state_.SetDeviceStencilMaskSeparate(GL_FRONT, kDefaultStencilMask);
@@ -7254,7 +7254,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribPointer(
GLuint indx = c.indx;
GLint size = c.size;
GLenum type = c.type;
- GLboolean normalized = c.normalized;
+ GLboolean normalized = static_cast<GLboolean>(c.normalized);
GLsizei stride = c.stride;
GLsizei offset = c.offset;
const void* ptr = reinterpret_cast<const void*>(offset);
@@ -7496,7 +7496,7 @@ error::Error GLES2DecoderImpl::HandleReadPixels(uint32 immediate_data_size,
GLsizei height = c.height;
GLenum format = c.format;
GLenum type = c.type;
- GLboolean async = c.async;
+ GLboolean async = static_cast<GLboolean>(c.async);
if (width < 0 || height < 0) {
LOCAL_SET_GL_ERROR(GL_INVALID_VALUE, "glReadPixels", "dimensions < 0");
return error::kNoError;
diff --git a/gpu/command_buffer/service/program_cache.cc b/gpu/command_buffer/service/program_cache.cc
index ad395c7..abdcfc0 100644
--- a/gpu/command_buffer/service/program_cache.cc
+++ b/gpu/command_buffer/service/program_cache.cc
@@ -123,9 +123,9 @@ void ProgramCache::ComputeProgramHash(
current_pos += name_size;
const GLint value = it->second;
buffer[current_pos++] = value >> 24;
- buffer[current_pos++] = value >> 16;
- buffer[current_pos++] = value >> 8;
- buffer[current_pos++] = value;
+ buffer[current_pos++] = static_cast<unsigned char>(value >> 16);
+ buffer[current_pos++] = static_cast<unsigned char>(value >> 8);
+ buffer[current_pos++] = static_cast<unsigned char>(value);
}
}
base::SHA1HashBytes(buffer.get(),
diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc
index e8196f6..63a64b7 100644
--- a/gpu/command_buffer/service/program_manager.cc
+++ b/gpu/command_buffer/service/program_manager.cc
@@ -591,16 +591,20 @@ bool Program::Link(ShaderManager* manager,
}
UMA_HISTOGRAM_CUSTOM_COUNTS(
"GPU.ProgramCache.BinaryCacheMissTime",
- (TimeTicks::HighResNow() - before_time).InMicroseconds(),
+ static_cast<base::HistogramBase::Sample>(
+ (TimeTicks::HighResNow() - before_time).InMicroseconds()),
0,
- TimeDelta::FromSeconds(10).InMicroseconds(),
+ static_cast<base::HistogramBase::Sample>(
+ TimeDelta::FromSeconds(10).InMicroseconds()),
50);
} else {
UMA_HISTOGRAM_CUSTOM_COUNTS(
"GPU.ProgramCache.BinaryCacheHitTime",
- (TimeTicks::HighResNow() - before_time).InMicroseconds(),
+ static_cast<base::HistogramBase::Sample>(
+ (TimeTicks::HighResNow() - before_time).InMicroseconds()),
0,
- TimeDelta::FromSeconds(1).InMicroseconds(),
+ static_cast<base::HistogramBase::Sample>(
+ TimeDelta::FromSeconds(1).InMicroseconds()),
50);
}
} else {
diff --git a/gpu/command_buffer/service/texture_manager.cc b/gpu/command_buffer/service/texture_manager.cc
index 45aaa65..4dbf528 100644
--- a/gpu/command_buffer/service/texture_manager.cc
+++ b/gpu/command_buffer/service/texture_manager.cc
@@ -1293,7 +1293,7 @@ void TextureManager::SetParameterf(
if (result != GL_NO_ERROR) {
if (result == GL_INVALID_ENUM) {
ERRORSTATE_SET_GL_ERROR_INVALID_ENUM(
- error_state, function_name, param, "param");
+ error_state, function_name, pname, "pname");
} else {
ERRORSTATE_SET_GL_ERROR_INVALID_PARAMF(
error_state, result, function_name, pname, param);
diff --git a/gpu/config/gpu_info_collector_win.cc b/gpu/config/gpu_info_collector_win.cc
index 244fd53..53343f6 100644
--- a/gpu/config/gpu_info_collector_win.cc
+++ b/gpu/config/gpu_info_collector_win.cc
@@ -154,12 +154,17 @@ GpuPerformanceStats RetrieveGpuPerformanceStatsWithHistograms() {
UMA_HISTOGRAM_TIMES("GPU.WinSAT.ReadResultsFileTime",
base::TimeTicks::Now() - start_time);
- UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.OverallScore2",
- stats.overall * 10, 10, 200, 50);
- UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GraphicsScore2",
- stats.graphics * 10, 10, 200, 50);
- UMA_HISTOGRAM_CUSTOM_COUNTS("GPU.WinSAT.GamingScore2",
- stats.gaming * 10, 10, 200, 50);
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "GPU.WinSAT.OverallScore2",
+ static_cast<base::HistogramBase::Sample>(stats.overall * 10), 10, 200,
+ 50);
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "GPU.WinSAT.GraphicsScore2",
+ static_cast<base::HistogramBase::Sample>(stats.graphics * 10), 10, 200,
+ 50);
+ UMA_HISTOGRAM_CUSTOM_COUNTS(
+ "GPU.WinSAT.GamingScore2",
+ static_cast<base::HistogramBase::Sample>(stats.gaming * 10), 10, 200, 50);
UMA_HISTOGRAM_BOOLEAN(
"GPU.WinSAT.HasResults",
stats.overall != 0.0 && stats.graphics != 0.0 && stats.gaming != 0.0);