Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder.cc

Issue 1360513002: Cleanup: Pass std::string as const reference from gpu/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass func_name as const char* in GLES2DecoderImpl::ProduceTextureRef Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 void DoTexStorage2DEXT( 1047 void DoTexStorage2DEXT(
1048 GLenum target, 1048 GLenum target,
1049 GLint levels, 1049 GLint levels,
1050 GLenum internal_format, 1050 GLenum internal_format,
1051 GLsizei width, 1051 GLsizei width,
1052 GLsizei height); 1052 GLsizei height);
1053 1053
1054 void DoProduceTextureCHROMIUM(GLenum target, const GLbyte* key); 1054 void DoProduceTextureCHROMIUM(GLenum target, const GLbyte* key);
1055 void DoProduceTextureDirectCHROMIUM(GLuint texture, GLenum target, 1055 void DoProduceTextureDirectCHROMIUM(GLuint texture, GLenum target,
1056 const GLbyte* key); 1056 const GLbyte* key);
1057 void ProduceTextureRef(std::string func_name, TextureRef* texture_ref, 1057 void ProduceTextureRef(const char* func_name,
1058 GLenum target, const GLbyte* data); 1058 TextureRef* texture_ref,
1059 GLenum target,
1060 const GLbyte* data);
1059 1061
1060 void EnsureTextureForClientId(GLenum target, GLuint client_id); 1062 void EnsureTextureForClientId(GLenum target, GLuint client_id);
1061 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key); 1063 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key);
1062 void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key, 1064 void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key,
1063 GLuint client_id); 1065 GLuint client_id);
1064 void DoApplyScreenSpaceAntialiasingCHROMIUM(); 1066 void DoApplyScreenSpaceAntialiasingCHROMIUM();
1065 1067
1066 bool DoIsValuebufferCHROMIUM(GLuint client_id); 1068 bool DoIsValuebufferCHROMIUM(GLuint client_id);
1067 void DoBindValueBufferCHROMIUM(GLenum target, GLuint valuebuffer); 1069 void DoBindValueBufferCHROMIUM(GLenum target, GLuint valuebuffer);
1068 void DoSubscribeValueCHROMIUM(GLenum target, GLenum subscription); 1070 void DoSubscribeValueCHROMIUM(GLenum target, GLenum subscription);
(...skipping 12760 matching lines...) Expand 10 before | Expand all | Expand 10 after
13829 void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id, 13831 void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id,
13830 GLenum target, const GLbyte* data) { 13832 GLenum target, const GLbyte* data) {
13831 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM", 13833 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM",
13832 "context", logger_.GetLogPrefix(), 13834 "context", logger_.GetLogPrefix(),
13833 "mailbox[0]", static_cast<unsigned char>(data[0])); 13835 "mailbox[0]", static_cast<unsigned char>(data[0]));
13834 13836
13835 ProduceTextureRef("glProduceTextureDirectCHROMIUM", GetTexture(client_id), 13837 ProduceTextureRef("glProduceTextureDirectCHROMIUM", GetTexture(client_id),
13836 target, data); 13838 target, data);
13837 } 13839 }
13838 13840
13839 void GLES2DecoderImpl::ProduceTextureRef(std::string func_name, 13841 void GLES2DecoderImpl::ProduceTextureRef(const char* func_name,
13840 TextureRef* texture_ref, GLenum target, const GLbyte* data) { 13842 TextureRef* texture_ref,
13843 GLenum target,
13844 const GLbyte* data) {
13841 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data); 13845 const Mailbox& mailbox = *reinterpret_cast<const Mailbox*>(data);
13842 DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a " 13846 DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a "
13843 "mailbox that was not generated by " 13847 "mailbox that was not generated by "
13844 "GenMailboxCHROMIUM."; 13848 "GenMailboxCHROMIUM.";
13845 13849
13846 if (!texture_ref) { 13850 if (!texture_ref) {
13847 LOCAL_SET_GL_ERROR( 13851 LOCAL_SET_GL_ERROR(
13848 GL_INVALID_OPERATION, func_name.c_str(), "unknown texture for target"); 13852 GL_INVALID_OPERATION, func_name, "unknown texture for target");
13849 return; 13853 return;
13850 } 13854 }
13851 13855
13852 Texture* produced = texture_manager()->Produce(texture_ref); 13856 Texture* produced = texture_manager()->Produce(texture_ref);
13853 if (!produced) { 13857 if (!produced) {
13854 LOCAL_SET_GL_ERROR( 13858 LOCAL_SET_GL_ERROR(
13855 GL_INVALID_OPERATION, func_name.c_str(), "invalid texture"); 13859 GL_INVALID_OPERATION, func_name, "invalid texture");
13856 return; 13860 return;
13857 } 13861 }
13858 13862
13859 if (produced->target() != target) { 13863 if (produced->target() != target) {
13860 LOCAL_SET_GL_ERROR( 13864 LOCAL_SET_GL_ERROR(
13861 GL_INVALID_OPERATION, func_name.c_str(), "invalid target"); 13865 GL_INVALID_OPERATION, func_name, "invalid target");
13862 return; 13866 return;
13863 } 13867 }
13864 13868
13865 group_->mailbox_manager()->ProduceTexture(mailbox, produced); 13869 group_->mailbox_manager()->ProduceTexture(mailbox, produced);
13866 } 13870 }
13867 13871
13868 void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target, 13872 void GLES2DecoderImpl::DoConsumeTextureCHROMIUM(GLenum target,
13869 const GLbyte* data) { 13873 const GLbyte* data) {
13870 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoConsumeTextureCHROMIUM", 13874 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoConsumeTextureCHROMIUM",
13871 "context", logger_.GetLogPrefix(), 13875 "context", logger_.GetLogPrefix(),
(...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after
15037 return error::kNoError; 15041 return error::kNoError;
15038 } 15042 }
15039 15043
15040 // Include the auto-generated part of this file. We split this because it means 15044 // Include the auto-generated part of this file. We split this because it means
15041 // we can easily edit the non-auto generated parts right here in this file 15045 // we can easily edit the non-auto generated parts right here in this file
15042 // instead of having to edit some template or the code generator. 15046 // instead of having to edit some template or the code generator.
15043 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" 15047 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h"
15044 15048
15045 } // namespace gles2 15049 } // namespace gles2
15046 } // namespace gpu 15050 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/texture_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698