Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: ui/gfx/mac/io_surface.cc

Issue 2920793005: gpu: support R16 GPUMemoryBuffer (Closed)
Patch Set: Add bug number to TODO. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/buffer_types.h ('k') | ui/gfx/mojo/buffer_types.mojom » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // Note that nullptr is an acceptable input to IOSurfaceSetValue. 225 // Note that nullptr is an acceptable input to IOSurfaceSetValue.
224 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc); 226 IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), color_space_icc);
225 } 227 }
226 228
227 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime", 229 UMA_HISTOGRAM_TIMES("GPU.IOSurface.CreateTime",
228 base::TimeTicks::Now() - start_time); 230 base::TimeTicks::Now() - start_time);
229 return surface; 231 return surface;
230 } 232 }
231 233
232 } // namespace gfx 234 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/buffer_types.h ('k') | ui/gfx/mojo/buffer_types.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698