| 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 implements the D3D9 versions of the texture resources, as well as | 33 // This file implements the D3D9 versions of the texture resources, as well as |
| 34 // the related GAPID3D9 function implementations. | 34 // the related GAPID3D9 function implementations. |
| 35 | 35 |
| 36 #include "command_buffer/service/win/d3d9/gapi_d3d9.h" | 36 #include "command_buffer/service/win/d3d9/gapi_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 // Converts a texture format to a D3D texture format. | 43 // Converts a texture format to a D3D texture format. |
| 43 D3DFORMAT TextureD3D9::D3DFormat(texture::Format format) { | 44 D3DFORMAT TextureD3D9::D3DFormat(texture::Format format) { |
| 44 switch (format) { | 45 switch (format) { |
| 45 case texture::kXRGB8: return D3DFMT_X8R8G8B8; | 46 case texture::kXRGB8: return D3DFMT_X8R8G8B8; |
| 46 case texture::kARGB8: return D3DFMT_A8R8G8B8; | 47 case texture::kARGB8: return D3DFMT_A8R8G8B8; |
| 47 case texture::kABGR16F: return D3DFMT_A16B16G16R16F; | 48 case texture::kABGR16F: return D3DFMT_A16B16G16R16F; |
| 48 case texture::kR32F: return D3DFMT_R32F; | 49 case texture::kR32F: return D3DFMT_R32F; |
| 49 case texture::kABGR32F: return D3DFMT_A32B32G32R32F; | 50 case texture::kABGR32F: return D3DFMT_A32B32G32R32F; |
| 50 case texture::kDXT1: return D3DFMT_DXT1; | 51 case texture::kDXT1: return D3DFMT_DXT1; |
| (...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 TextureD3D9 *texture = textures_.Get(id); | 720 TextureD3D9 *texture = textures_.Get(id); |
| 720 if (!texture) | 721 if (!texture) |
| 721 return parse_error::kParseInvalidArguments; | 722 return parse_error::kParseInvalidArguments; |
| 722 Volume volume = {x, y, z, width, height, depth}; | 723 Volume volume = {x, y, z, width, height, depth}; |
| 723 return texture->GetData(this, volume, level, face, row_pitch, slice_pitch, | 724 return texture->GetData(this, volume, level, face, row_pitch, slice_pitch, |
| 724 size, data) ? | 725 size, data) ? |
| 725 parse_error::kParseNoError : | 726 parse_error::kParseNoError : |
| 726 parse_error::kParseInvalidArguments; | 727 parse_error::kParseInvalidArguments; |
| 727 } | 728 } |
| 728 | 729 |
| 730 } // namespace o3d |
| 729 } // namespace command_buffer | 731 } // namespace command_buffer |
| 730 } // namespace o3d | 732 } // namespace o3d |
| OLD | NEW |