| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 | 32 |
| 33 // This file contains the implementation of the SamplerD3D9 class. | 33 // This file contains the implementation of the SamplerD3D9 class. |
| 34 | 34 |
| 35 #include "command_buffer/service/win/d3d9/gapi_d3d9.h" | 35 #include "command_buffer/service/win/d3d9/gapi_d3d9.h" |
| 36 #include "command_buffer/service/win/d3d9/sampler_d3d9.h" | 36 #include "command_buffer/service/win/d3d9/sampler_d3d9.h" |
| 37 #include "command_buffer/service/win/d3d9/texture_d3d9.h" | 37 #include "command_buffer/service/win/d3d9/texture_d3d9.h" |
| 38 | 38 |
| 39 namespace o3d { | 39 namespace o3d { |
| 40 namespace command_buffer { | 40 namespace command_buffer { |
| 41 namespace o3d { |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| 43 | 44 |
| 44 // Converts an addressing mode to corresponding D3D values. | 45 // Converts an addressing mode to corresponding D3D values. |
| 45 D3DTEXTUREADDRESS AddressModeToD3D(sampler::AddressingMode mode) { | 46 D3DTEXTUREADDRESS AddressModeToD3D(sampler::AddressingMode mode) { |
| 46 switch (mode) { | 47 switch (mode) { |
| 47 case sampler::kWrap: | 48 case sampler::kWrap: |
| 48 return D3DTADDRESS_WRAP; | 49 return D3DTADDRESS_WRAP; |
| 49 case sampler::kMirrorRepeat: | 50 case sampler::kMirrorRepeat: |
| 50 return D3DTADDRESS_MIRROR; | 51 return D3DTADDRESS_MIRROR; |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 ResourceId texture_id) { | 188 ResourceId texture_id) { |
| 188 SamplerD3D9 *sampler = samplers_.Get(id); | 189 SamplerD3D9 *sampler = samplers_.Get(id); |
| 189 if (!sampler) | 190 if (!sampler) |
| 190 return parse_error::kParseInvalidArguments; | 191 return parse_error::kParseInvalidArguments; |
| 191 // Dirty effect, because this sampler id may be used | 192 // Dirty effect, because this sampler id may be used |
| 192 DirtyEffect(); | 193 DirtyEffect(); |
| 193 sampler->SetTexture(texture_id); | 194 sampler->SetTexture(texture_id); |
| 194 return parse_error::kParseNoError; | 195 return parse_error::kParseNoError; |
| 195 } | 196 } |
| 196 | 197 |
| 197 | 198 } // namespace o3d |
| 198 } // namespace command_buffer | 199 } // namespace command_buffer |
| 199 } // namespace o3d | 200 } // namespace o3d |
| OLD | NEW |