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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 unsigned int row_pitch; // number of bytes between 2 successive rows. | 68 unsigned int row_pitch; // number of bytes between 2 successive rows. |
69 unsigned int slice_size; // size in bytes of a slice of data. | 69 unsigned int slice_size; // size in bytes of a slice of data. |
70 unsigned int slice_pitch; // number of bytes between 2 successive slices. | 70 unsigned int slice_pitch; // number of bytes between 2 successive slices. |
71 unsigned int total_size; // total size of the data. | 71 unsigned int total_size; // total size of the data. |
72 bool packed; // indicates whether the data is tightly packed. | 72 bool packed; // indicates whether the data is tightly packed. |
73 }; | 73 }; |
74 | 74 |
75 // Round a value up, so that it is divisible by the block size. | 75 // Round a value up, so that it is divisible by the block size. |
76 static inline unsigned int RoundToBlockSize(unsigned int base, | 76 static inline unsigned int RoundToBlockSize(unsigned int base, |
77 unsigned int block) { | 77 unsigned int block) { |
78 DCHECK_GT(base, 0); | 78 DCHECK_GT(base, 0U); |
79 DCHECK_GT(block, 0); | 79 DCHECK_GT(block, 0U); |
80 return block + base - 1 - (base - 1) % block; | 80 return block + base - 1 - (base - 1) % block; |
81 } | 81 } |
82 | 82 |
83 // Fills a MipLevelInfo structure from the base texture dimensions. | 83 // Fills a MipLevelInfo structure from the base texture dimensions. |
84 static inline void MakeMipLevelInfo(MipLevelInfo *mip_info, | 84 static inline void MakeMipLevelInfo(MipLevelInfo *mip_info, |
85 texture::Format format, | 85 texture::Format format, |
86 unsigned int base_width, | 86 unsigned int base_width, |
87 unsigned int base_height, | 87 unsigned int base_height, |
88 unsigned int base_depth, | 88 unsigned int base_depth, |
89 unsigned int level) { | 89 unsigned int level) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 const MipLevelInfo &mip_level, | 149 const MipLevelInfo &mip_level, |
150 const TransferInfo &dst_transfer_info, | 150 const TransferInfo &dst_transfer_info, |
151 void *dst_data, | 151 void *dst_data, |
152 const TransferInfo &src_transfer_info, | 152 const TransferInfo &src_transfer_info, |
153 const void *src_data); | 153 const void *src_data); |
154 | 154 |
155 } // namespace command_buffer | 155 } // namespace command_buffer |
156 } // namespace o3d | 156 } // namespace o3d |
157 | 157 |
158 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_TEXTURE_UTILS_H_ | 158 #endif // O3D_COMMAND_BUFFER_SERVICE_CROSS_TEXTURE_UTILS_H_ |
OLD | NEW |