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

Side by Side Diff: content/common/gpu/gpu_memory_buffer_factory_io_surface.cc

Issue 1415723006: ui: Add RGBX_8888 buffer format. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gles but no conversion needed case Created 5 years, 1 month 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
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_memory_buffer_impl_surface_texture.cc ('k') | gpu/command_buffer/service/image_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698