| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| index ca0b4e93e563b4820f849a26e66a6c52fe3dfc43..773c9cb65cc956ecb6b58d571db2bc575765ad77 100644
|
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
|
| @@ -1241,7 +1241,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
|
| BufferManager::BufferInfo* GetBufferInfoForTarget(GLenum target) {
|
| DCHECK(target == GL_ARRAY_BUFFER || target == GL_ELEMENT_ARRAY_BUFFER);
|
| if (target == GL_ARRAY_BUFFER) {
|
| - return state_.bound_array_buffer;
|
| + return state_.bound_array_buffer.get();
|
| } else {
|
| return state_.vertex_attrib_manager->element_array_buffer();
|
| }
|
| @@ -1253,7 +1253,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
|
| TextureManager::TextureInfo* info = NULL;
|
| switch (target) {
|
| case GL_TEXTURE_2D:
|
| - info = unit.bound_texture_2d;
|
| + info = unit.bound_texture_2d.get();
|
| break;
|
| case GL_TEXTURE_CUBE_MAP:
|
| case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
|
| @@ -1262,13 +1262,13 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
|
| case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
|
| case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
|
| case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
|
| - info = unit.bound_texture_cube_map;
|
| + info = unit.bound_texture_cube_map.get();
|
| break;
|
| case GL_TEXTURE_EXTERNAL_OES:
|
| - info = unit.bound_texture_external_oes;
|
| + info = unit.bound_texture_external_oes.get();
|
| break;
|
| case GL_TEXTURE_RECTANGLE_ARB:
|
| - info = unit.bound_texture_rectangle_arb;
|
| + info = unit.bound_texture_rectangle_arb.get();
|
| break;
|
| default:
|
| NOTREACHED();
|
| @@ -1312,10 +1312,10 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
|
| switch (target) {
|
| case GL_FRAMEBUFFER:
|
| case GL_DRAW_FRAMEBUFFER_EXT:
|
| - info = state_.bound_draw_framebuffer;
|
| + info = state_.bound_draw_framebuffer.get();
|
| break;
|
| case GL_READ_FRAMEBUFFER_EXT:
|
| - info = state_.bound_read_framebuffer;
|
| + info = state_.bound_read_framebuffer.get();
|
| break;
|
| default:
|
| NOTREACHED();
|
| @@ -1329,7 +1329,7 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
|
| RenderbufferManager::RenderbufferInfo* info = NULL;
|
| switch (target) {
|
| case GL_RENDERBUFFER:
|
| - info = state_.bound_renderbuffer;
|
| + info = state_.bound_renderbuffer.get();
|
| break;
|
| default:
|
| NOTREACHED();
|
| @@ -1392,8 +1392,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>,
|
|
|
| bool ShouldDeferDraws() {
|
| return !offscreen_target_frame_buffer_.get() &&
|
| - state_.bound_draw_framebuffer == NULL &&
|
| - surface_->DeferDraws();
|
| + state_.bound_draw_framebuffer.get() == NULL &&
|
| + surface_->DeferDraws();
|
| }
|
|
|
| void ForceCompileShaderIfPending(ShaderManager::ShaderInfo* info);
|
| @@ -2024,7 +2024,7 @@ bool GLES2DecoderImpl::Initialize(
|
| // vertex_attrib_manager is set to default_vertex_attrib_manager_ by this call
|
| DoBindVertexArrayOES(0);
|
|
|
| - query_manager_.reset(new QueryManager(this, feature_info_));
|
| + query_manager_.reset(new QueryManager(this, feature_info_.get()));
|
| vertex_array_manager_.reset(new VertexArrayManager());
|
|
|
| util_.set_num_compressed_texture_formats(
|
| @@ -2402,7 +2402,7 @@ void GLES2DecoderImpl::DeleteBuffersHelper(
|
| BufferManager::BufferInfo* buffer = GetBufferInfo(client_ids[ii]);
|
| if (buffer && !buffer->IsDeleted()) {
|
| state_.vertex_attrib_manager->Unbind(buffer);
|
| - if (state_.bound_array_buffer == buffer) {
|
| + if (state_.bound_array_buffer.get() == buffer) {
|
| state_.bound_array_buffer = NULL;
|
| }
|
| RemoveBufferInfo(client_ids[ii]);
|
| @@ -2419,14 +2419,14 @@ void GLES2DecoderImpl::DeleteFramebuffersHelper(
|
| FramebufferManager::FramebufferInfo* framebuffer =
|
| GetFramebufferInfo(client_ids[ii]);
|
| if (framebuffer && !framebuffer->IsDeleted()) {
|
| - if (framebuffer == state_.bound_draw_framebuffer) {
|
| + if (framebuffer == state_.bound_draw_framebuffer.get()) {
|
| state_.bound_draw_framebuffer = NULL;
|
| clear_state_dirty_ = true;
|
| GLenum target = supports_separate_framebuffer_binds ?
|
| GL_DRAW_FRAMEBUFFER_EXT : GL_FRAMEBUFFER;
|
| glBindFramebufferEXT(target, GetBackbufferServiceId());
|
| }
|
| - if (framebuffer == state_.bound_read_framebuffer) {
|
| + if (framebuffer == state_.bound_read_framebuffer.get()) {
|
| state_.bound_read_framebuffer = NULL;
|
| GLenum target = supports_separate_framebuffer_binds ?
|
| GL_READ_FRAMEBUFFER_EXT : GL_FRAMEBUFFER;
|
| @@ -2445,21 +2445,21 @@ void GLES2DecoderImpl::DeleteRenderbuffersHelper(
|
| RenderbufferManager::RenderbufferInfo* renderbuffer =
|
| GetRenderbufferInfo(client_ids[ii]);
|
| if (renderbuffer && !renderbuffer->IsDeleted()) {
|
| - if (state_.bound_renderbuffer == renderbuffer) {
|
| + if (state_.bound_renderbuffer.get() == renderbuffer) {
|
| state_.bound_renderbuffer = NULL;
|
| }
|
| // Unbind from current framebuffers.
|
| if (supports_separate_framebuffer_binds) {
|
| - if (state_.bound_read_framebuffer) {
|
| + if (state_.bound_read_framebuffer.get()) {
|
| state_.bound_read_framebuffer->UnbindRenderbuffer(
|
| GL_READ_FRAMEBUFFER_EXT, renderbuffer);
|
| }
|
| - if (state_.bound_draw_framebuffer) {
|
| + if (state_.bound_draw_framebuffer.get()) {
|
| state_.bound_draw_framebuffer->UnbindRenderbuffer(
|
| GL_DRAW_FRAMEBUFFER_EXT, renderbuffer);
|
| }
|
| } else {
|
| - if (state_.bound_draw_framebuffer) {
|
| + if (state_.bound_draw_framebuffer.get()) {
|
| state_.bound_draw_framebuffer->UnbindRenderbuffer(
|
| GL_FRAMEBUFFER, renderbuffer);
|
| }
|
| @@ -2486,16 +2486,16 @@ void GLES2DecoderImpl::DeleteTexturesHelper(
|
| }
|
| // Unbind from current framebuffers.
|
| if (supports_separate_framebuffer_binds) {
|
| - if (state_.bound_read_framebuffer) {
|
| + if (state_.bound_read_framebuffer.get()) {
|
| state_.bound_read_framebuffer->UnbindTexture(
|
| GL_READ_FRAMEBUFFER_EXT, texture);
|
| }
|
| - if (state_.bound_draw_framebuffer) {
|
| + if (state_.bound_draw_framebuffer.get()) {
|
| state_.bound_draw_framebuffer->UnbindTexture(
|
| GL_DRAW_FRAMEBUFFER_EXT, texture);
|
| }
|
| } else {
|
| - if (state_.bound_draw_framebuffer) {
|
| + if (state_.bound_draw_framebuffer.get()) {
|
| state_.bound_draw_framebuffer->UnbindTexture(GL_FRAMEBUFFER, texture);
|
| }
|
| }
|
| @@ -2575,7 +2575,7 @@ void GLES2DecoderImpl::RestoreCurrentFramebufferBindings() {
|
| void GLES2DecoderImpl::RestoreCurrentTexture2DBindings() {
|
| TextureUnit& info = state_.texture_units[0];
|
| GLuint last_id;
|
| - if (info.bound_texture_2d) {
|
| + if (info.bound_texture_2d.get()) {
|
| last_id = info.bound_texture_2d->service_id();
|
| } else {
|
| last_id = 0;
|
| @@ -2636,14 +2636,14 @@ bool GLES2DecoderImpl::CheckFramebufferValid(
|
| bool GLES2DecoderImpl::CheckBoundFramebuffersValid(const char* func_name) {
|
| if (!features().chromium_framebuffer_multisample) {
|
| return CheckFramebufferValid(
|
| - state_.bound_draw_framebuffer, GL_FRAMEBUFFER_EXT, func_name);
|
| + state_.bound_draw_framebuffer.get(), GL_FRAMEBUFFER_EXT, func_name);
|
| }
|
| return CheckFramebufferValid(
|
| - state_.bound_draw_framebuffer,
|
| - GL_DRAW_FRAMEBUFFER_EXT, func_name) &&
|
| - CheckFramebufferValid(
|
| - state_.bound_read_framebuffer,
|
| - GL_READ_FRAMEBUFFER_EXT, func_name);
|
| + state_.bound_draw_framebuffer.get(),
|
| + GL_DRAW_FRAMEBUFFER_EXT, func_name) &&
|
| + CheckFramebufferValid(
|
| + state_.bound_read_framebuffer.get(),
|
| + GL_READ_FRAMEBUFFER_EXT, func_name);
|
| }
|
|
|
| gfx::Size GLES2DecoderImpl::GetBoundReadFrameBufferSize() {
|
| @@ -2694,7 +2694,7 @@ void GLES2DecoderImpl::UpdateParentTextureInfo() {
|
| // parent is later destroyed.
|
| TextureManager* parent_texture_manager = parent_->texture_manager();
|
| parent_texture_manager->SetLevelInfo(
|
| - offscreen_saved_color_texture_info_,
|
| + offscreen_saved_color_texture_info_.get(),
|
| GL_TEXTURE_2D,
|
| 0, // level
|
| GL_RGBA,
|
| @@ -2706,19 +2706,19 @@ void GLES2DecoderImpl::UpdateParentTextureInfo() {
|
| GL_UNSIGNED_BYTE,
|
| true);
|
| parent_texture_manager->SetParameter(
|
| - offscreen_saved_color_texture_info_,
|
| + offscreen_saved_color_texture_info_.get(),
|
| GL_TEXTURE_MAG_FILTER,
|
| GL_NEAREST);
|
| parent_texture_manager->SetParameter(
|
| - offscreen_saved_color_texture_info_,
|
| + offscreen_saved_color_texture_info_.get(),
|
| GL_TEXTURE_MIN_FILTER,
|
| GL_NEAREST);
|
| parent_texture_manager->SetParameter(
|
| - offscreen_saved_color_texture_info_,
|
| + offscreen_saved_color_texture_info_.get(),
|
| GL_TEXTURE_WRAP_S,
|
| GL_CLAMP_TO_EDGE);
|
| parent_texture_manager->SetParameter(
|
| - offscreen_saved_color_texture_info_,
|
| + offscreen_saved_color_texture_info_.get(),
|
| GL_TEXTURE_WRAP_T,
|
| GL_CLAMP_TO_EDGE);
|
| } else {
|
| @@ -2792,8 +2792,9 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
|
| copy_texture_CHROMIUM_.reset();
|
| }
|
|
|
| - if (state_.current_program) {
|
| - program_manager()->UnuseProgram(shader_manager(), state_.current_program);
|
| + if (state_.current_program.get()) {
|
| + program_manager()->
|
| + UnuseProgram(shader_manager(), state_.current_program.get());
|
| state_.current_program = NULL;
|
| }
|
|
|
| @@ -2854,7 +2855,7 @@ void GLES2DecoderImpl::Destroy(bool have_context) {
|
| vertex_array_manager_.reset();
|
| }
|
|
|
| - if (group_) {
|
| + if (group_.get()) {
|
| group_->Destroy(have_context);
|
| group_ = NULL;
|
| }
|
| @@ -2940,7 +2941,7 @@ bool GLES2DecoderImpl::SetParent(GLES2Decoder* new_parent,
|
| new_parent_impl->CreateTextureInfo(new_parent_texture_id, service_id);
|
| offscreen_saved_color_texture_info_->SetNotOwned();
|
| new_parent_impl->texture_manager()->
|
| - SetInfoTarget(offscreen_saved_color_texture_info_, GL_TEXTURE_2D);
|
| + SetInfoTarget(offscreen_saved_color_texture_info_.get(), GL_TEXTURE_2D);
|
|
|
| parent_ = new_parent_impl->AsWeakPtr();
|
|
|
| @@ -3686,7 +3687,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| case GL_ARRAY_BUFFER_BINDING:
|
| *num_written = 1;
|
| if (params) {
|
| - if (state_.bound_array_buffer) {
|
| + if (state_.bound_array_buffer.get()) {
|
| GLuint client_id = 0;
|
| buffer_manager()->GetClientId(state_.bound_array_buffer->service_id(),
|
| &client_id);
|
| @@ -3759,7 +3760,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| case GL_CURRENT_PROGRAM:
|
| *num_written = 1;
|
| if (params) {
|
| - if (state_.current_program) {
|
| + if (state_.current_program.get()) {
|
| GLuint client_id = 0;
|
| program_manager()->GetClientId(
|
| state_.current_program->service_id(), &client_id);
|
| @@ -3773,7 +3774,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| *num_written = 1;
|
| if (params) {
|
| TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
|
| - if (unit.bound_texture_2d) {
|
| + if (unit.bound_texture_2d.get()) {
|
| GLuint client_id = 0;
|
| texture_manager()->GetClientId(
|
| unit.bound_texture_2d->service_id(), &client_id);
|
| @@ -3787,7 +3788,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| *num_written = 1;
|
| if (params) {
|
| TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
|
| - if (unit.bound_texture_cube_map) {
|
| + if (unit.bound_texture_cube_map.get()) {
|
| GLuint client_id = 0;
|
| texture_manager()->GetClientId(
|
| unit.bound_texture_cube_map->service_id(), &client_id);
|
| @@ -3801,7 +3802,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| *num_written = 1;
|
| if (params) {
|
| TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
|
| - if (unit.bound_texture_external_oes) {
|
| + if (unit.bound_texture_external_oes.get()) {
|
| GLuint client_id = 0;
|
| texture_manager()->GetClientId(
|
| unit.bound_texture_external_oes->service_id(), &client_id);
|
| @@ -3815,7 +3816,7 @@ bool GLES2DecoderImpl::GetHelper(
|
| *num_written = 1;
|
| if (params) {
|
| TextureUnit& unit = state_.texture_units[state_.active_texture_unit];
|
| - if (unit.bound_texture_rectangle_arb) {
|
| + if (unit.bound_texture_rectangle_arb.get()) {
|
| GLuint client_id = 0;
|
| texture_manager()->GetClientId(
|
| unit.bound_texture_rectangle_arb->service_id(), &client_id);
|
| @@ -4231,7 +4232,7 @@ void GLES2DecoderImpl::DoFramebufferRenderbuffer(
|
| if (error == GL_NO_ERROR) {
|
| framebuffer_info->AttachRenderbuffer(attachment, info);
|
| }
|
| - if (framebuffer_info == state_.bound_draw_framebuffer) {
|
| + if (framebuffer_info == state_.bound_draw_framebuffer.get()) {
|
| clear_state_dirty_ = true;
|
| }
|
| }
|
| @@ -4386,7 +4387,7 @@ void GLES2DecoderImpl::DoFramebufferTexture2D(
|
| if (error == GL_NO_ERROR) {
|
| framebuffer_info->AttachTexture(attachment, info, textarget, level);
|
| }
|
| - if (framebuffer_info == state_.bound_draw_framebuffer) {
|
| + if (framebuffer_info == state_.bound_draw_framebuffer.get()) {
|
| clear_state_dirty_ = true;
|
| }
|
| }
|
| @@ -4585,13 +4586,13 @@ void GLES2DecoderImpl::DoLinkProgram(GLuint program) {
|
| ShaderTranslator* vertex_translator = NULL;
|
| ShaderTranslator* fragment_translator = NULL;
|
| if (use_shader_translator_) {
|
| - vertex_translator = vertex_translator_;
|
| - fragment_translator = fragment_translator_;
|
| + vertex_translator = vertex_translator_.get();
|
| + fragment_translator = fragment_translator_.get();
|
| }
|
| if (info->Link(shader_manager(),
|
| vertex_translator,
|
| fragment_translator,
|
| - feature_info_)) {
|
| + feature_info_.get())) {
|
| if (info == state_.current_program.get()) {
|
| if (workarounds().use_current_program_after_successful_link) {
|
| glUseProgram(info->service_id());
|
| @@ -4664,7 +4665,7 @@ void GLES2DecoderImpl::DoTexParameteriv(
|
| }
|
|
|
| bool GLES2DecoderImpl::CheckCurrentProgram(const char* function_name) {
|
| - if (!state_.current_program) {
|
| + if (!state_.current_program.get()) {
|
| // The program does not exist.
|
| SetGLError(GL_INVALID_OPERATION, function_name, "no program in use");
|
| return false;
|
| @@ -4912,13 +4913,14 @@ void GLES2DecoderImpl::DoUseProgram(GLuint program) {
|
| }
|
| service_id = info->service_id();
|
| }
|
| - if (state_.current_program) {
|
| - program_manager()->UnuseProgram(shader_manager(), state_.current_program);
|
| + if (state_.current_program.get()) {
|
| + program_manager()->
|
| + UnuseProgram(shader_manager(), state_.current_program.get());
|
| }
|
| state_.current_program = info;
|
| glUseProgram(service_id);
|
| - if (state_.current_program) {
|
| - program_manager()->UseProgram(state_.current_program);
|
| + if (state_.current_program.get()) {
|
| + program_manager()->UseProgram(state_.current_program.get());
|
| }
|
| }
|
|
|
| @@ -5017,7 +5019,7 @@ void GLES2DecoderImpl::ForceCompileShaderIfPending(
|
| program_manager()->ForceCompileShader(info->deferred_compilation_source(),
|
| info,
|
| translator,
|
| - feature_info_);
|
| + feature_info_.get());
|
| }
|
| }
|
|
|
| @@ -5056,7 +5058,7 @@ bool GLES2DecoderImpl::SetBlackTextureForNonRenderableTextures() {
|
| if (texture_unit_index < group_->max_texture_units()) {
|
| TextureUnit& texture_unit = state_.texture_units[texture_unit_index];
|
| TextureManager::TextureInfo* texture_info =
|
| - texture_unit.GetInfoForSamplerType(uniform_info->type);
|
| + texture_unit.GetInfoForSamplerType(uniform_info->type).get();
|
| if (!texture_info || !texture_manager()->CanRender(texture_info)) {
|
| textures_set = true;
|
| glActiveTexture(GL_TEXTURE0 + texture_unit_index);
|
| @@ -5091,14 +5093,14 @@ void GLES2DecoderImpl::RestoreStateForNonRenderableTextures() {
|
| TextureUnit& texture_unit = state_.texture_units[texture_unit_index];
|
| TextureManager::TextureInfo* texture_info =
|
| uniform_info->type == GL_SAMPLER_2D ?
|
| - texture_unit.bound_texture_2d :
|
| - texture_unit.bound_texture_cube_map;
|
| + texture_unit.bound_texture_2d :
|
| + texture_unit.bound_texture_cube_map.get();
|
| if (!texture_info || !texture_manager()->CanRender(texture_info)) {
|
| glActiveTexture(GL_TEXTURE0 + texture_unit_index);
|
| // Get the texture info that was previously bound here.
|
| texture_info = texture_unit.bind_target == GL_TEXTURE_2D ?
|
| texture_unit.bound_texture_2d :
|
| - texture_unit.bound_texture_cube_map;
|
| + texture_unit.bound_texture_cube_map.get();
|
| glBindTexture(texture_unit.bind_target,
|
| texture_info ? texture_info->service_id() : 0);
|
| }
|
| @@ -5116,7 +5118,7 @@ bool GLES2DecoderImpl::ClearUnclearedTextures() {
|
| }
|
|
|
| // 1: Check all textures we are about to render with.
|
| - if (state_.current_program) {
|
| + if (state_.current_program.get()) {
|
| const ProgramManager::ProgramInfo::SamplerIndices& sampler_indices =
|
| state_.current_program->sampler_indices();
|
| for (size_t ii = 0; ii < sampler_indices.size(); ++ii) {
|
| @@ -5128,7 +5130,7 @@ bool GLES2DecoderImpl::ClearUnclearedTextures() {
|
| if (texture_unit_index < group_->max_texture_units()) {
|
| TextureUnit& texture_unit = state_.texture_units[texture_unit_index];
|
| TextureManager::TextureInfo* texture_info =
|
| - texture_unit.GetInfoForSamplerType(uniform_info->type);
|
| + texture_unit.GetInfoForSamplerType(uniform_info->type).get();
|
| if (texture_info && !texture_info->SafeToRenderFrom()) {
|
| if (!texture_manager()->ClearRenderableLevels(this, texture_info)) {
|
| return false;
|
| @@ -5147,7 +5149,7 @@ bool GLES2DecoderImpl::IsDrawValid(
|
| // it could never be invalid since glUseProgram would have failed. While
|
| // glLinkProgram could later mark the program as invalid the previous
|
| // valid program will still function if it is still the current program.
|
| - if (!state_.current_program) {
|
| + if (!state_.current_program.get()) {
|
| // The program does not exist.
|
| // But GL says no ERROR.
|
| RenderWarning("Drawing with no current shader program.");
|
| @@ -5287,7 +5289,8 @@ void GLES2DecoderImpl::RestoreStateForAttrib(GLuint attrib) {
|
| glVertexAttribDivisorANGLE(attrib, info->divisor());
|
| glBindBuffer(
|
| GL_ARRAY_BUFFER,
|
| - state_.bound_array_buffer ? state_.bound_array_buffer->service_id() : 0);
|
| + state_.bound_array_buffer.get() ? state_.bound_array_buffer->
|
| + service_id() : 0);
|
|
|
| // Never touch vertex attribute 0's state (in particular, never
|
| // disable it) when running on desktop GL because it will never be
|
| @@ -5415,7 +5418,8 @@ void GLES2DecoderImpl::RestoreStateForSimulatedFixedAttribs() {
|
| // settings and passing GL_FIXED to it will not work.
|
| glBindBuffer(
|
| GL_ARRAY_BUFFER,
|
| - state_.bound_array_buffer ? state_.bound_array_buffer->service_id() : 0);
|
| + state_.bound_array_buffer.get() ? state_.bound_array_buffer->
|
| + service_id() : 0);
|
| }
|
|
|
| error::Error GLES2DecoderImpl::DoDrawArrays(
|
| @@ -5724,7 +5728,7 @@ void GLES2DecoderImpl::DoCompileShader(GLuint client_id) {
|
| vertex_translator_.get() : fragment_translator_.get();
|
| }
|
|
|
| - program_manager()->DoCompileShader(info, translator, feature_info_);
|
| + program_manager()->DoCompileShader(info, translator, feature_info_.get());
|
| };
|
|
|
| void GLES2DecoderImpl::DoGetShaderiv(
|
| @@ -6135,8 +6139,12 @@ void GLES2DecoderImpl::DoVertexAttrib4fv(GLuint index, const GLfloat* v) {
|
| error::Error GLES2DecoderImpl::HandleVertexAttribPointer(
|
| uint32 immediate_data_size, const gles2::VertexAttribPointer& c) {
|
|
|
| - if (!state_.bound_array_buffer || state_.bound_array_buffer->IsDeleted()) {
|
| - if (state_.vertex_attrib_manager == default_vertex_attrib_manager_) {
|
| + if (
|
| + !state_.bound_array_buffer.get() || state_.bound_array_buffer->
|
| + IsDeleted()) {
|
| + if (
|
| + state_.vertex_attrib_manager.get() ==
|
| + default_vertex_attrib_manager_.get()) {
|
| SetGLError(GL_INVALID_VALUE,
|
| "glVertexAttribPointer", "no array buffer bound");
|
| return error::kNoError;
|
| @@ -6196,7 +6204,7 @@ error::Error GLES2DecoderImpl::HandleVertexAttribPointer(
|
| }
|
| state_.vertex_attrib_manager->SetAttribInfo(
|
| indx,
|
| - state_.bound_array_buffer,
|
| + state_.bound_array_buffer.get(),
|
| size,
|
| type,
|
| normalized,
|
| @@ -8465,7 +8473,7 @@ void GLES2DecoderImpl::DeleteQueriesEXTHelper(
|
| for (GLsizei ii = 0; ii < n; ++ii) {
|
| QueryManager::Query* query = query_manager_->GetQuery(client_ids[ii]);
|
| if (query && !query->IsDeleted()) {
|
| - if (query == state_.current_query) {
|
| + if (query == state_.current_query.get()) {
|
| state_.current_query = NULL;
|
| }
|
| query->Destroy(true);
|
| @@ -8503,7 +8511,7 @@ error::Error GLES2DecoderImpl::HandleBeginQueryEXT(
|
| break;
|
| }
|
|
|
| - if (state_.current_query) {
|
| + if (state_.current_query.get()) {
|
| SetGLError(
|
| GL_INVALID_OPERATION, "glBeginQueryEXT", "query already in progress");
|
| return error::kNoError;
|
| @@ -8560,7 +8568,7 @@ error::Error GLES2DecoderImpl::HandleEndQueryEXT(
|
| GLenum target = static_cast<GLenum>(c.target);
|
| uint32 submit_count = static_cast<GLuint>(c.submit_count);
|
|
|
| - if (!state_.current_query) {
|
| + if (!state_.current_query.get()) {
|
| SetGLError(GL_INVALID_OPERATION, "glEndQueryEXT", "No active query");
|
| return error::kNoError;
|
| }
|
| @@ -8570,7 +8578,7 @@ error::Error GLES2DecoderImpl::HandleEndQueryEXT(
|
| return error::kNoError;
|
| }
|
|
|
| - if (!query_manager_->EndQuery(state_.current_query, submit_count)) {
|
| + if (!query_manager_->EndQuery(state_.current_query.get(), submit_count)) {
|
| return error::kOutOfBounds;
|
| }
|
|
|
| @@ -8609,7 +8617,7 @@ void GLES2DecoderImpl::DeleteVertexArraysOESHelper(
|
| VertexAttribManager* vao =
|
| GetVertexAttribManager(client_ids[ii]);
|
| if (vao && !vao->IsDeleted()) {
|
| - if (state_.vertex_attrib_manager == vao) {
|
| + if (state_.vertex_attrib_manager.get() == vao) {
|
| state_.vertex_attrib_manager = default_vertex_attrib_manager_;
|
| }
|
| RemoveVertexAttribManager(client_ids[ii]);
|
| @@ -8635,11 +8643,11 @@ void GLES2DecoderImpl::DoBindVertexArrayOES(GLuint client_id) {
|
| service_id = vao->service_id();
|
| }
|
| } else {
|
| - vao = default_vertex_attrib_manager_;
|
| + vao = default_vertex_attrib_manager_.get();
|
| }
|
|
|
| // Only set the VAO state if it's changed
|
| - if (state_.vertex_attrib_manager != vao) {
|
| + if (state_.vertex_attrib_manager.get() != vao) {
|
| state_.vertex_attrib_manager = vao;
|
| if (!features().native_vertex_array_object) {
|
| EmulateVertexArrayState();
|
| @@ -8999,7 +9007,7 @@ void GLES2DecoderImpl::DoCopyTextureCHROMIUM(
|
| state_.viewport_width, state_.viewport_height);
|
|
|
| // Restore all of the state touched by the extension.
|
| - if (state_.current_program)
|
| + if (state_.current_program.get())
|
| glUseProgram(state_.current_program->service_id());
|
| else
|
| glUseProgram(0);
|
|
|