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

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

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes 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
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 std::string& 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 std::string& 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.c_str(), "unknown texture for target");
13849 return; 13853 return;
13850 } 13854 }
(...skipping 1186 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

Powered by Google App Engine
This is Rietveld 408576698