| OLD | NEW |
| 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 <limits.h> | 7 #include <limits.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1063 GLsizei levels, | 1063 GLsizei levels, |
| 1064 GLenum internal_format, | 1064 GLenum internal_format, |
| 1065 GLsizei width, | 1065 GLsizei width, |
| 1066 GLsizei height, | 1066 GLsizei height, |
| 1067 GLsizei depth); | 1067 GLsizei depth); |
| 1068 | 1068 |
| 1069 void DoProduceTextureCHROMIUM(GLenum target, const GLbyte* key); | 1069 void DoProduceTextureCHROMIUM(GLenum target, const GLbyte* key); |
| 1070 void DoProduceTextureDirectCHROMIUM(GLuint texture, GLenum target, | 1070 void DoProduceTextureDirectCHROMIUM(GLuint texture, GLenum target, |
| 1071 const GLbyte* key); | 1071 const GLbyte* key); |
| 1072 void ProduceTextureRef(const char* func_name, | 1072 void ProduceTextureRef(const char* func_name, |
| 1073 bool clear, |
| 1073 TextureRef* texture_ref, | 1074 TextureRef* texture_ref, |
| 1074 GLenum target, | 1075 GLenum target, |
| 1075 const GLbyte* data); | 1076 const GLbyte* data); |
| 1076 | 1077 |
| 1077 void EnsureTextureForClientId(GLenum target, GLuint client_id); | 1078 void EnsureTextureForClientId(GLenum target, GLuint client_id); |
| 1078 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key); | 1079 void DoConsumeTextureCHROMIUM(GLenum target, const GLbyte* key); |
| 1079 void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key, | 1080 void DoCreateAndConsumeTextureCHROMIUM(GLenum target, const GLbyte* key, |
| 1080 GLuint client_id); | 1081 GLuint client_id); |
| 1081 void DoApplyScreenSpaceAntialiasingCHROMIUM(); | 1082 void DoApplyScreenSpaceAntialiasingCHROMIUM(); |
| 1082 | 1083 |
| (...skipping 14722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15805 } | 15806 } |
| 15806 | 15807 |
| 15807 void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target, | 15808 void GLES2DecoderImpl::DoProduceTextureCHROMIUM(GLenum target, |
| 15808 const GLbyte* data) { | 15809 const GLbyte* data) { |
| 15809 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureCHROMIUM", | 15810 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureCHROMIUM", |
| 15810 "context", logger_.GetLogPrefix(), | 15811 "context", logger_.GetLogPrefix(), |
| 15811 "mailbox[0]", static_cast<unsigned char>(data[0])); | 15812 "mailbox[0]", static_cast<unsigned char>(data[0])); |
| 15812 | 15813 |
| 15813 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( | 15814 TextureRef* texture_ref = texture_manager()->GetTextureInfoForTarget( |
| 15814 &state_, target); | 15815 &state_, target); |
| 15815 ProduceTextureRef("glProduceTextureCHROMIUM", texture_ref, target, data); | 15816 ProduceTextureRef("glProduceTextureCHROMIUM", false, texture_ref, target, |
| 15817 data); |
| 15816 } | 15818 } |
| 15817 | 15819 |
| 15818 void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id, | 15820 void GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM(GLuint client_id, |
| 15819 GLenum target, const GLbyte* data) { | 15821 GLenum target, const GLbyte* data) { |
| 15820 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM", | 15822 TRACE_EVENT2("gpu", "GLES2DecoderImpl::DoProduceTextureDirectCHROMIUM", |
| 15821 "context", logger_.GetLogPrefix(), | 15823 "context", logger_.GetLogPrefix(), |
| 15822 "mailbox[0]", static_cast<unsigned char>(data[0])); | 15824 "mailbox[0]", static_cast<unsigned char>(data[0])); |
| 15823 | 15825 |
| 15824 ProduceTextureRef("glProduceTextureDirectCHROMIUM", GetTexture(client_id), | 15826 ProduceTextureRef("glProduceTextureDirectCHROMIUM", !client_id, |
| 15825 target, data); | 15827 GetTexture(client_id), target, data); |
| 15826 } | 15828 } |
| 15827 | 15829 |
| 15828 void GLES2DecoderImpl::ProduceTextureRef(const char* func_name, | 15830 void GLES2DecoderImpl::ProduceTextureRef(const char* func_name, |
| 15831 bool clear, |
| 15829 TextureRef* texture_ref, | 15832 TextureRef* texture_ref, |
| 15830 GLenum target, | 15833 GLenum target, |
| 15831 const GLbyte* data) { | 15834 const GLbyte* data) { |
| 15832 const Mailbox mailbox = *reinterpret_cast<const Mailbox*>(data); | 15835 const Mailbox mailbox = *reinterpret_cast<const Mailbox*>(data); |
| 15833 DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a " | 15836 DLOG_IF(ERROR, !mailbox.Verify()) << func_name << " was passed a " |
| 15834 "mailbox that was not generated by " | 15837 "mailbox that was not generated by " |
| 15835 "GenMailboxCHROMIUM."; | 15838 "GenMailboxCHROMIUM."; |
| 15836 | 15839 |
| 15840 if (clear) { |
| 15841 DCHECK(!texture_ref); |
| 15842 |
| 15843 group_->mailbox_manager()->ProduceTexture(mailbox, nullptr); |
| 15844 return; |
| 15845 } |
| 15846 |
| 15837 if (!texture_ref) { | 15847 if (!texture_ref) { |
| 15838 LOCAL_SET_GL_ERROR( | 15848 LOCAL_SET_GL_ERROR( |
| 15839 GL_INVALID_OPERATION, func_name, "unknown texture for target"); | 15849 GL_INVALID_OPERATION, func_name, "unknown texture for target"); |
| 15840 return; | 15850 return; |
| 15841 } | 15851 } |
| 15842 | 15852 |
| 15843 Texture* produced = texture_manager()->Produce(texture_ref); | 15853 Texture* produced = texture_manager()->Produce(texture_ref); |
| 15844 if (!produced) { | 15854 if (!produced) { |
| 15845 LOCAL_SET_GL_ERROR( | 15855 LOCAL_SET_GL_ERROR( |
| 15846 GL_INVALID_OPERATION, func_name, "invalid texture"); | 15856 GL_INVALID_OPERATION, func_name, "invalid texture"); |
| (...skipping 1913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 17760 } | 17770 } |
| 17761 | 17771 |
| 17762 // Include the auto-generated part of this file. We split this because it means | 17772 // Include the auto-generated part of this file. We split this because it means |
| 17763 // we can easily edit the non-auto generated parts right here in this file | 17773 // we can easily edit the non-auto generated parts right here in this file |
| 17764 // instead of having to edit some template or the code generator. | 17774 // instead of having to edit some template or the code generator. |
| 17765 #include "base/macros.h" | 17775 #include "base/macros.h" |
| 17766 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 17776 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
| 17767 | 17777 |
| 17768 } // namespace gles2 | 17778 } // namespace gles2 |
| 17769 } // namespace gpu | 17779 } // namespace gpu |
| OLD | NEW |