| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009, Google Inc. | 2 * Copyright 2009, Google Inc. |
| 3 * All rights reserved. | 3 * All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 | 32 |
| 33 // This file implements the sampler-related GAPI functions on GL. | 33 // This file implements the sampler-related GAPI functions on GL. |
| 34 | 34 |
| 35 #include "command_buffer/service/cross/gl/gapi_gl.h" | 35 #include "command_buffer/service/cross/gl/gapi_gl.h" |
| 36 #include "command_buffer/service/cross/gl/sampler_gl.h" | 36 #include "command_buffer/service/cross/gl/sampler_gl.h" |
| 37 | 37 |
| 38 namespace o3d { | 38 namespace o3d { |
| 39 namespace command_buffer { | 39 namespace command_buffer { |
| 40 namespace o3d { |
| 40 | 41 |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 // Gets the GL enum corresponding to an addressing mode. | 44 // Gets the GL enum corresponding to an addressing mode. |
| 44 GLenum GLAddressMode(sampler::AddressingMode o3d_mode) { | 45 GLenum GLAddressMode(sampler::AddressingMode o3d_mode) { |
| 45 switch (o3d_mode) { | 46 switch (o3d_mode) { |
| 46 case sampler::kWrap: | 47 case sampler::kWrap: |
| 47 return GL_REPEAT; | 48 return GL_REPEAT; |
| 48 case sampler::kMirrorRepeat: | 49 case sampler::kMirrorRepeat: |
| 49 return GL_MIRRORED_REPEAT; | 50 return GL_MIRRORED_REPEAT; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 ResourceId texture_id) { | 227 ResourceId texture_id) { |
| 227 SamplerGL *sampler = samplers_.Get(id); | 228 SamplerGL *sampler = samplers_.Get(id); |
| 228 if (!sampler) | 229 if (!sampler) |
| 229 return parse_error::kParseInvalidArguments; | 230 return parse_error::kParseInvalidArguments; |
| 230 // Dirty effect, because this sampler id may be used. | 231 // Dirty effect, because this sampler id may be used. |
| 231 DirtyEffect(); | 232 DirtyEffect(); |
| 232 sampler->SetTexture(texture_id); | 233 sampler->SetTexture(texture_id); |
| 233 return parse_error::kParseNoError; | 234 return parse_error::kParseNoError; |
| 234 } | 235 } |
| 235 | 236 |
| 236 | 237 } // namespace o3d |
| 237 } // namespace command_buffer | 238 } // namespace command_buffer |
| 238 } // namespace o3d | 239 } // namespace o3d |
| OLD | NEW |