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

Unified Diff: ui/gfx/mac/io_surface.cc

Issue 2786103003: Add half-float IOSurface GpuMemoryBuffer support (Closed)
Patch Set: Review feedback Created 3 years, 8 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/mac/io_surface.cc
diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
index c4a30c13c56c17fc0374e38c71a96f292f6783ab..4441138e4d8985b7c4bfd4e5ec0ca353f6239745 100644
--- a/ui/gfx/mac/io_surface.cc
+++ b/ui/gfx/mac/io_surface.cc
@@ -37,6 +37,9 @@ int32_t BytesPerElement(gfx::BufferFormat format, int plane) {
case gfx::BufferFormat::RGBA_8888:
DCHECK_EQ(plane, 0);
return 4;
+ case gfx::BufferFormat::RGBA_F16:
+ DCHECK_EQ(plane, 0);
+ return 8;
case gfx::BufferFormat::YUV_420_BIPLANAR:
static int32_t bytes_per_element[] = {1, 2};
DCHECK_LT(static_cast<size_t>(plane), arraysize(bytes_per_element));
@@ -70,6 +73,8 @@ int32_t PixelFormat(gfx::BufferFormat format) {
case gfx::BufferFormat::BGRX_8888:
case gfx::BufferFormat::RGBA_8888:
return 'BGRA';
+ case gfx::BufferFormat::RGBA_F16:
+ return 'RGhA';
case gfx::BufferFormat::YUV_420_BIPLANAR:
return '420v';
case gfx::BufferFormat::UYVY_422:
« 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