| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/gfx/mac/io_surface.h" | 5 #include "ui/gfx/mac/io_surface.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 case gfx::BufferFormat::RGBA_8888: | 39 case gfx::BufferFormat::RGBA_8888: |
| 40 DCHECK_EQ(plane, 0); | 40 DCHECK_EQ(plane, 0); |
| 41 return 4; | 41 return 4; |
| 42 case gfx::BufferFormat::RGBA_F16: | 42 case gfx::BufferFormat::RGBA_F16: |
| 43 DCHECK_EQ(plane, 0); | 43 DCHECK_EQ(plane, 0); |
| 44 return 8; | 44 return 8; |
| 45 case gfx::BufferFormat::YUV_420_BIPLANAR: | 45 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 46 static int32_t bytes_per_element[] = {1, 2}; | 46 static int32_t bytes_per_element[] = {1, 2}; |
| 47 DCHECK_LT(static_cast<size_t>(plane), arraysize(bytes_per_element)); | 47 DCHECK_LT(static_cast<size_t>(plane), arraysize(bytes_per_element)); |
| 48 return bytes_per_element[plane]; | 48 return bytes_per_element[plane]; |
| 49 case gfx::BufferFormat::R_16: |
| 49 case gfx::BufferFormat::RG_88: | 50 case gfx::BufferFormat::RG_88: |
| 50 case gfx::BufferFormat::UYVY_422: | 51 case gfx::BufferFormat::UYVY_422: |
| 51 DCHECK_EQ(plane, 0); | 52 DCHECK_EQ(plane, 0); |
| 52 return 2; | 53 return 2; |
| 53 case gfx::BufferFormat::ATC: | 54 case gfx::BufferFormat::ATC: |
| 54 case gfx::BufferFormat::ATCIA: | 55 case gfx::BufferFormat::ATCIA: |
| 55 case gfx::BufferFormat::DXT1: | 56 case gfx::BufferFormat::DXT1: |
| 56 case gfx::BufferFormat::DXT5: | 57 case gfx::BufferFormat::DXT5: |
| 57 case gfx::BufferFormat::ETC1: | 58 case gfx::BufferFormat::ETC1: |
| 58 case gfx::BufferFormat::BGR_565: | 59 case gfx::BufferFormat::BGR_565: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 74 case gfx::BufferFormat::BGRA_8888: | 75 case gfx::BufferFormat::BGRA_8888: |
| 75 case gfx::BufferFormat::BGRX_8888: | 76 case gfx::BufferFormat::BGRX_8888: |
| 76 case gfx::BufferFormat::RGBA_8888: | 77 case gfx::BufferFormat::RGBA_8888: |
| 77 return 'BGRA'; | 78 return 'BGRA'; |
| 78 case gfx::BufferFormat::RGBA_F16: | 79 case gfx::BufferFormat::RGBA_F16: |
| 79 return 'RGhA'; | 80 return 'RGhA'; |
| 80 case gfx::BufferFormat::YUV_420_BIPLANAR: | 81 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 81 return '420v'; | 82 return '420v'; |
| 82 case gfx::BufferFormat::UYVY_422: | 83 case gfx::BufferFormat::UYVY_422: |
| 83 return '2vuy'; | 84 return '2vuy'; |
| 85 case gfx::BufferFormat::R_16: |
| 84 case gfx::BufferFormat::RG_88: | 86 case gfx::BufferFormat::RG_88: |
| 85 case gfx::BufferFormat::ATC: | 87 case gfx::BufferFormat::ATC: |
| 86 case gfx::BufferFormat::ATCIA: | 88 case gfx::BufferFormat::ATCIA: |
| 87 case gfx::BufferFormat::DXT1: | 89 case gfx::BufferFormat::DXT1: |
| 88 case gfx::BufferFormat::DXT5: | 90 case gfx::BufferFormat::DXT5: |
| 89 case gfx::BufferFormat::ETC1: | 91 case gfx::BufferFormat::ETC1: |
| 90 case gfx::BufferFormat::BGR_565: | 92 case gfx::BufferFormat::BGR_565: |
| 91 case gfx::BufferFormat::RGBA_4444: | 93 case gfx::BufferFormat::RGBA_4444: |
| 92 case gfx::BufferFormat::RGBX_8888: | 94 case gfx::BufferFormat::RGBX_8888: |
| 93 case gfx::BufferFormat::YVU_420: | 95 case gfx::BufferFormat::YVU_420: |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 // Note that nullptr is an acceptable input to IOSurfaceSetValue. | 226 // Note that nullptr is an acceptable input to IOSurfaceSetValue. |
| 225 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); | 227 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); |
| 226 } | 228 } |
| 227 | 229 |
| 228 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime", | 230 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime", |
| 229 base::TimeTicks::Now() - start_time); | 231 base::TimeTicks::Now() - start_time); |
| 230 return surface; | 232 return surface; |
| 231 } | 233 } |
| 232 | 234 |
| 233 } // namespace gfx | 235 } // namespace gfx |
| OLD | NEW |