| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" | 5 #include "content/common/gpu/gpu_memory_buffer_factory_io_surface.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 case gfx::BufferFormat::UYVY_422: | 39 case gfx::BufferFormat::UYVY_422: |
| 40 DCHECK_EQ(plane, 0); | 40 DCHECK_EQ(plane, 0); |
| 41 return 2; | 41 return 2; |
| 42 case gfx::BufferFormat::ATC: | 42 case gfx::BufferFormat::ATC: |
| 43 case gfx::BufferFormat::ATCIA: | 43 case gfx::BufferFormat::ATCIA: |
| 44 case gfx::BufferFormat::DXT1: | 44 case gfx::BufferFormat::DXT1: |
| 45 case gfx::BufferFormat::DXT5: | 45 case gfx::BufferFormat::DXT5: |
| 46 case gfx::BufferFormat::ETC1: | 46 case gfx::BufferFormat::ETC1: |
| 47 case gfx::BufferFormat::RGBA_4444: | 47 case gfx::BufferFormat::RGBA_4444: |
| 48 case gfx::BufferFormat::RGBA_8888: | 48 case gfx::BufferFormat::RGBA_8888: |
| 49 case gfx::BufferFormat::RGBX_8888: |
| 49 case gfx::BufferFormat::BGRX_8888: | 50 case gfx::BufferFormat::BGRX_8888: |
| 50 case gfx::BufferFormat::YUV_420: | 51 case gfx::BufferFormat::YUV_420: |
| 51 NOTREACHED(); | 52 NOTREACHED(); |
| 52 return 0; | 53 return 0; |
| 53 } | 54 } |
| 54 | 55 |
| 55 NOTREACHED(); | 56 NOTREACHED(); |
| 56 return 0; | 57 return 0; |
| 57 } | 58 } |
| 58 | 59 |
| 59 int32 PixelFormat(gfx::BufferFormat format) { | 60 int32 PixelFormat(gfx::BufferFormat format) { |
| 60 switch (format) { | 61 switch (format) { |
| 61 case gfx::BufferFormat::R_8: | 62 case gfx::BufferFormat::R_8: |
| 62 return 'L008'; | 63 return 'L008'; |
| 63 case gfx::BufferFormat::BGRA_8888: | 64 case gfx::BufferFormat::BGRA_8888: |
| 64 return 'BGRA'; | 65 return 'BGRA'; |
| 65 case gfx::BufferFormat::YUV_420_BIPLANAR: | 66 case gfx::BufferFormat::YUV_420_BIPLANAR: |
| 66 return '420v'; | 67 return '420v'; |
| 67 case gfx::BufferFormat::UYVY_422: | 68 case gfx::BufferFormat::UYVY_422: |
| 68 return '2vuy'; | 69 return '2vuy'; |
| 69 case gfx::BufferFormat::ATC: | 70 case gfx::BufferFormat::ATC: |
| 70 case gfx::BufferFormat::ATCIA: | 71 case gfx::BufferFormat::ATCIA: |
| 71 case gfx::BufferFormat::DXT1: | 72 case gfx::BufferFormat::DXT1: |
| 72 case gfx::BufferFormat::DXT5: | 73 case gfx::BufferFormat::DXT5: |
| 73 case gfx::BufferFormat::ETC1: | 74 case gfx::BufferFormat::ETC1: |
| 74 case gfx::BufferFormat::RGBA_4444: | 75 case gfx::BufferFormat::RGBA_4444: |
| 75 case gfx::BufferFormat::RGBA_8888: | 76 case gfx::BufferFormat::RGBA_8888: |
| 77 case gfx::BufferFormat::RGBX_8888: |
| 76 case gfx::BufferFormat::BGRX_8888: | 78 case gfx::BufferFormat::BGRX_8888: |
| 77 case gfx::BufferFormat::YUV_420: | 79 case gfx::BufferFormat::YUV_420: |
| 78 NOTREACHED(); | 80 NOTREACHED(); |
| 79 return 0; | 81 return 0; |
| 80 } | 82 } |
| 81 | 83 |
| 82 NOTREACHED(); | 84 NOTREACHED(); |
| 83 return 0; | 85 return 0; |
| 84 } | 86 } |
| 85 | 87 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 234 |
| 233 scoped_refptr<gfx::GLImageIOSurface> image( | 235 scoped_refptr<gfx::GLImageIOSurface> image( |
| 234 new gfx::GLImageIOSurface(size, internalformat)); | 236 new gfx::GLImageIOSurface(size, internalformat)); |
| 235 if (!image->Initialize(it->second.get(), handle.id, format)) | 237 if (!image->Initialize(it->second.get(), handle.id, format)) |
| 236 return scoped_refptr<gfx::GLImage>(); | 238 return scoped_refptr<gfx::GLImage>(); |
| 237 | 239 |
| 238 return image; | 240 return image; |
| 239 } | 241 } |
| 240 | 242 |
| 241 } // namespace content | 243 } // namespace content |
| OLD | NEW |