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 16 matching lines...) Expand all Loading... |
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 | 32 |
33 // This file contains the implementation of the helper functions for resources. | 33 // This file contains the implementation of the helper functions for resources. |
34 | 34 |
35 #include "gpu/command_buffer/common/resource.h" | 35 #include "gpu/command_buffer/common/resource.h" |
36 | 36 |
37 namespace command_buffer { | 37 namespace gpu { |
38 | 38 |
39 namespace texture { | 39 namespace texture { |
40 | 40 |
41 // Gets the number of bytes per block for a given format. | 41 // Gets the number of bytes per block for a given format. |
42 unsigned int GetBytesPerBlock(Format format) { | 42 unsigned int GetBytesPerBlock(Format format) { |
43 switch (format) { | 43 switch (format) { |
44 case kXRGB8: | 44 case kXRGB8: |
45 case kARGB8: | 45 case kARGB8: |
46 case kR32F: | 46 case kR32F: |
47 return 4; | 47 return 4; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 case kTexture: | 110 case kTexture: |
111 return sizeof(ResourceId); // NOLINT | 111 return sizeof(ResourceId); // NOLINT |
112 default: | 112 default: |
113 LOG(FATAL) << "Invalid type."; | 113 LOG(FATAL) << "Invalid type."; |
114 return 0; | 114 return 0; |
115 } | 115 } |
116 } | 116 } |
117 | 117 |
118 } // namespace effect_param | 118 } // namespace effect_param |
119 | 119 |
120 } // namespace command_buffer | 120 } // namespace gpu |
OLD | NEW |