From 5ea888129de0660d9afb8e1e348e3081be95ba46 Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Mon, 28 Mar 2011 10:45:39 +0000 Subject: Initialize a few uninitialized members in GPU classes. BUG=None TEST=None CID=12914, 15729, 12761, 8585, 14365, 15761, 14796, 15865. Review URL: http://codereview.chromium.org/6713127 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79544 0039d316-1c4b-4281-b951-d872f2087c98 --- gpu/command_buffer/client/gles2_implementation.cc | 15 ++++++++------- gpu/command_buffer/common/logging.h | 6 ++++-- gpu/command_buffer/service/gles2_cmd_decoder.cc | 1 + gpu/command_buffer/service/gles2_cmd_decoder.h | 4 +++- gpu/command_buffer/service/program_manager.cc | 1 + gpu/command_buffer/service/texture_manager.h | 1 + 6 files changed, 18 insertions(+), 10 deletions(-) (limited to 'gpu/command_buffer') diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 88f5499..b51aefa 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -1,8 +1,8 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// A class to emluate GLES2 over command buffers. +// A class to emulate GLES2 over command buffers. #include "../client/gles2_implementation.h" #include @@ -446,6 +446,7 @@ GLES2Implementation::GLES2Implementation( // Allocate space for simple GL results. result_buffer_ = transfer_buffer; result_shm_offset_ = 0; + memset(&reserved_ids_, 0, sizeof(reserved_ids_)); mapped_memory_.reset(new MappedMemoryManager(helper_)); @@ -664,7 +665,7 @@ void GLES2Implementation::Flush() { // Insert the cmd to call glFlush helper_->Flush(); // Flush our command buffer - // (tell the service to execute upto the flush cmd.) + // (tell the service to execute up to the flush cmd.) helper_->CommandBufferHelper::Flush(); } @@ -672,7 +673,7 @@ void GLES2Implementation::Finish() { // Insert the cmd to call glFinish helper_->Finish(); // Finish our command buffer - // (tell the service to execute upto the Finish cmd and wait for it to + // (tell the service to execute up to the Finish cmd and wait for it to // execute.) helper_->CommandBufferHelper::Finish(); } @@ -1037,7 +1038,7 @@ void GLES2Implementation::TexSubImage2D( height -= num_rows; } } else { - // Transfer by sub rows. Beacuse GL has no maximum texture dimensions. + // Transfer by sub rows. Because GL has no maximum texture dimensions. uint32 temp; GLES2Util::ComputeImageDataSize( 1, 1, format, type, unpack_alignment_, &temp); @@ -1255,7 +1256,7 @@ void GLES2Implementation::ReadPixels( return; } - // glReadPixel pads the size of each row of pixels by an ammount specified by + // glReadPixel pads the size of each row of pixels by an amount specified by // glPixelStorei. So, we have to take that into account both in the fact that // the pixels returned from the ReadPixel command will include that padding // and that when we copy the results to the user's buffer we need to not @@ -1320,7 +1321,7 @@ void GLES2Implementation::ReadPixels( height -= num_rows; } } else { - // Transfer by sub rows. Beacuse GL has no maximum texture dimensions. + // Transfer by sub rows. Because GL has no maximum texture dimensions. GLES2Util::ComputeImageDataSize( 1, 1, format, type, pack_alignment_, &temp_size); GLsizeiptr element_size = temp_size; diff --git a/gpu/command_buffer/common/logging.h b/gpu/command_buffer/common/logging.h index c94bc7a..6142335 100644 --- a/gpu/command_buffer/common/logging.h +++ b/gpu/command_buffer/common/logging.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -128,7 +128,9 @@ class Logger { } private: - Logger(const Logger& logger): condition_(logger.condition_) { + Logger(const Logger& logger) + : condition_(logger.condition_), + level_(logger.level_) { } bool condition_; diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 49413e5..94f3ad0 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -1783,6 +1783,7 @@ GLES2DecoderImpl::GLES2DecoderImpl(ContextGroup* group) offscreen_target_depth_format_(0), offscreen_target_stencil_format_(0), offscreen_target_samples_(0), + copy_texture_to_parent_texture_fb_(0), offscreen_saved_color_format_(0), back_buffer_color_format_(0), current_decoder_error_(error::kNoError), diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 92d5300..1646c90 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -26,6 +26,8 @@ class ContextGroup; class GLES2Util; struct DisallowedExtensions { + DisallowedExtensions() : multisampling(false) {} + bool multisampling; }; diff --git a/gpu/command_buffer/service/program_manager.cc b/gpu/command_buffer/service/program_manager.cc index d618405..3bc5dea 100644 --- a/gpu/command_buffer/service/program_manager.cc +++ b/gpu/command_buffer/service/program_manager.cc @@ -32,6 +32,7 @@ ProgramManager::ProgramInfo::UniformInfo::UniformInfo(GLsizei _size, const std::string& _name) : size(_size), type(_type), + is_array(false), name(_name) { } diff --git a/gpu/command_buffer/service/texture_manager.h b/gpu/command_buffer/service/texture_manager.h index 9699873..f89fde6 100644 --- a/gpu/command_buffer/service/texture_manager.h +++ b/gpu/command_buffer/service/texture_manager.h @@ -41,6 +41,7 @@ class TextureManager { texture_complete_(false), cube_complete_(false), npot_(false), + has_been_bound_(false), owned_(true) { } -- cgit v1.1