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 <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 9064 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9075 } | 9075 } |
9076 | 9076 |
9077 return error::kNoError; | 9077 return error::kNoError; |
9078 } | 9078 } |
9079 | 9079 |
9080 error::Error GLES2DecoderImpl::HandlePixelStorei(uint32 immediate_data_size, | 9080 error::Error GLES2DecoderImpl::HandlePixelStorei(uint32 immediate_data_size, |
9081 const void* cmd_data) { | 9081 const void* cmd_data) { |
9082 const gles2::cmds::PixelStorei& c = | 9082 const gles2::cmds::PixelStorei& c = |
9083 *static_cast<const gles2::cmds::PixelStorei*>(cmd_data); | 9083 *static_cast<const gles2::cmds::PixelStorei*>(cmd_data); |
9084 GLenum pname = c.pname; | 9084 GLenum pname = c.pname; |
9085 GLenum param = c.param; | 9085 GLint param = c.param; |
9086 if (!validators_->pixel_store.IsValid(pname)) { | 9086 if (!validators_->pixel_store.IsValid(pname)) { |
9087 LOCAL_SET_GL_ERROR_INVALID_ENUM("glPixelStorei", pname, "pname"); | 9087 LOCAL_SET_GL_ERROR_INVALID_ENUM("glPixelStorei", pname, "pname"); |
9088 return error::kNoError; | 9088 return error::kNoError; |
9089 } | 9089 } |
9090 switch (pname) { | 9090 switch (pname) { |
9091 case GL_PACK_ALIGNMENT: | 9091 case GL_PACK_ALIGNMENT: |
9092 case GL_UNPACK_ALIGNMENT: | 9092 case GL_UNPACK_ALIGNMENT: |
9093 if (!validators_->pixel_store_alignment.IsValid(param)) { | 9093 if (!validators_->pixel_store_alignment.IsValid(param)) { |
9094 LOCAL_SET_GL_ERROR( | 9094 LOCAL_SET_GL_ERROR( |
9095 GL_INVALID_VALUE, "glPixelStorei", "param GL_INVALID_VALUE"); | 9095 GL_INVALID_VALUE, "glPixelStorei", "invalid param"); |
9096 return error::kNoError; | 9096 return error::kNoError; |
9097 } | 9097 } |
9098 break; | 9098 break; |
| 9099 case GL_PACK_ROW_LENGTH: |
| 9100 case GL_PACK_SKIP_PIXELS: |
| 9101 case GL_PACK_SKIP_ROWS: |
| 9102 case GL_UNPACK_ROW_LENGTH: |
| 9103 case GL_UNPACK_IMAGE_HEIGHT: |
| 9104 case GL_UNPACK_SKIP_PIXELS: |
| 9105 case GL_UNPACK_SKIP_ROWS: |
| 9106 case GL_UNPACK_SKIP_IMAGES: |
| 9107 if (param < 0) { |
| 9108 LOCAL_SET_GL_ERROR( |
| 9109 GL_INVALID_VALUE, "glPixelStorei", "invalid param"); |
| 9110 return error::kNoError; |
| 9111 } |
9099 default: | 9112 default: |
9100 break; | 9113 break; |
9101 } | 9114 } |
9102 glPixelStorei(pname, param); | 9115 glPixelStorei(pname, param); |
9103 switch (pname) { | 9116 switch (pname) { |
9104 case GL_PACK_ALIGNMENT: | 9117 case GL_PACK_ALIGNMENT: |
9105 state_.pack_alignment = param; | 9118 state_.pack_alignment = param; |
9106 break; | 9119 break; |
9107 case GL_PACK_REVERSE_ROW_ORDER_ANGLE: | 9120 case GL_PACK_REVERSE_ROW_ORDER_ANGLE: |
9108 state_.pack_reverse_row_order = (param != 0); | 9121 state_.pack_reverse_row_order = (param != 0); |
9109 break; | 9122 break; |
| 9123 case GL_PACK_ROW_LENGTH: |
| 9124 state_.pack_row_length = param; |
| 9125 break; |
| 9126 case GL_PACK_SKIP_PIXELS: |
| 9127 state_.pack_skip_pixels = param; |
| 9128 break; |
| 9129 case GL_PACK_SKIP_ROWS: |
| 9130 state_.pack_skip_rows = param; |
| 9131 break; |
9110 case GL_UNPACK_ALIGNMENT: | 9132 case GL_UNPACK_ALIGNMENT: |
9111 state_.unpack_alignment = param; | 9133 state_.unpack_alignment = param; |
9112 break; | 9134 break; |
| 9135 case GL_UNPACK_ROW_LENGTH: |
| 9136 state_.unpack_row_length = param; |
| 9137 break; |
| 9138 case GL_UNPACK_IMAGE_HEIGHT: |
| 9139 state_.unpack_image_height = param; |
| 9140 break; |
| 9141 case GL_UNPACK_SKIP_PIXELS: |
| 9142 state_.unpack_skip_pixels = param; |
| 9143 break; |
| 9144 case GL_UNPACK_SKIP_ROWS: |
| 9145 state_.unpack_skip_rows = param; |
| 9146 break; |
| 9147 case GL_UNPACK_SKIP_IMAGES: |
| 9148 state_.unpack_skip_images = param; |
| 9149 break; |
9113 default: | 9150 default: |
9114 // Validation should have prevented us from getting here. | 9151 // Validation should have prevented us from getting here. |
9115 NOTREACHED(); | 9152 NOTREACHED(); |
9116 break; | 9153 break; |
9117 } | 9154 } |
9118 return error::kNoError; | 9155 return error::kNoError; |
9119 } | 9156 } |
9120 | 9157 |
9121 error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( | 9158 error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM( |
9122 uint32 immediate_data_size, | 9159 uint32 immediate_data_size, |
9123 const void* cmd_data) { | 9160 const void* cmd_data) { |
9124 const gles2::cmds::PostSubBufferCHROMIUM& c = | 9161 const gles2::cmds::PostSubBufferCHROMIUM& c = |
9125 *static_cast<const gles2::cmds::PostSubBufferCHROMIUM*>(cmd_data); | 9162 *static_cast<const gles2::cmds::PostSubBufferCHROMIUM*>(cmd_data); |
9126 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM"); | 9163 TRACE_EVENT0("gpu", "GLES2DecoderImpl::HandlePostSubBufferCHROMIUM"); |
(...skipping 6157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
15284 return error::kNoError; | 15321 return error::kNoError; |
15285 } | 15322 } |
15286 | 15323 |
15287 // Include the auto-generated part of this file. We split this because it means | 15324 // Include the auto-generated part of this file. We split this because it means |
15288 // we can easily edit the non-auto generated parts right here in this file | 15325 // we can easily edit the non-auto generated parts right here in this file |
15289 // instead of having to edit some template or the code generator. | 15326 // instead of having to edit some template or the code generator. |
15290 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" | 15327 #include "gpu/command_buffer/service/gles2_cmd_decoder_autogen.h" |
15291 | 15328 |
15292 } // namespace gles2 | 15329 } // namespace gles2 |
15293 } // namespace gpu | 15330 } // namespace gpu |
OLD | NEW |