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 "ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h" | 5 #include "ui/ozone/gpu/gpu_memory_buffer_factory_ozone_native_buffer.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/gl/gl_image_egl.h" | 8 #include "ui/gl/gl_image_egl.h" |
9 #include "ui/gl/gl_image_linux_dma_buffer.h" | 9 #include "ui/gl/gl_image_linux_dma_buffer.h" |
10 #include "ui/ozone/public/native_pixmap.h" | 10 #include "ui/ozone/public/native_pixmap.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 scoped_refptr<NativePixmap> pixmap_; | 73 scoped_refptr<NativePixmap> pixmap_; |
74 }; | 74 }; |
75 | 75 |
76 SurfaceFactoryOzone::BufferFormat GetOzoneFormatFor( | 76 SurfaceFactoryOzone::BufferFormat GetOzoneFormatFor( |
77 gfx::GpuMemoryBuffer::Format format) { | 77 gfx::GpuMemoryBuffer::Format format) { |
78 switch (format) { | 78 switch (format) { |
79 case gfx::GpuMemoryBuffer::RGBA_8888: | 79 case gfx::GpuMemoryBuffer::RGBA_8888: |
80 return SurfaceFactoryOzone::RGBA_8888; | 80 return SurfaceFactoryOzone::RGBA_8888; |
81 case gfx::GpuMemoryBuffer::RGBX_8888: | 81 case gfx::GpuMemoryBuffer::RGBX_8888: |
82 return SurfaceFactoryOzone::RGBX_8888; | 82 return SurfaceFactoryOzone::RGBX_8888; |
| 83 case gfx::GpuMemoryBuffer::ATC: |
| 84 case gfx::GpuMemoryBuffer::ATCIA: |
| 85 case gfx::GpuMemoryBuffer::DXT1: |
| 86 case gfx::GpuMemoryBuffer::DXT5: |
| 87 case gfx::GpuMemoryBuffer::ETC1: |
83 case gfx::GpuMemoryBuffer::BGRA_8888: | 88 case gfx::GpuMemoryBuffer::BGRA_8888: |
84 NOTREACHED(); | 89 NOTREACHED(); |
85 return SurfaceFactoryOzone::RGBA_8888; | 90 return SurfaceFactoryOzone::RGBA_8888; |
86 } | 91 } |
87 | 92 |
88 NOTREACHED(); | 93 NOTREACHED(); |
89 return SurfaceFactoryOzone::RGBA_8888; | 94 return SurfaceFactoryOzone::RGBA_8888; |
90 } | 95 } |
91 | 96 |
92 SurfaceFactoryOzone::BufferUsage GetOzoneUsageFor( | 97 SurfaceFactoryOzone::BufferUsage GetOzoneUsageFor( |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 new GLImageOzoneNativePixmapDmaBuf(size, internalformat); | 188 new GLImageOzoneNativePixmapDmaBuf(size, internalformat); |
184 if (!image->Initialize(pixmap.get(), format)) { | 189 if (!image->Initialize(pixmap.get(), format)) { |
185 return scoped_refptr<gfx::GLImage>(); | 190 return scoped_refptr<gfx::GLImage>(); |
186 } | 191 } |
187 return image; | 192 return image; |
188 } | 193 } |
189 return scoped_refptr<gfx::GLImage>(); | 194 return scoped_refptr<gfx::GLImage>(); |
190 } | 195 } |
191 | 196 |
192 } // namespace ui | 197 } // namespace ui |
OLD | NEW |