Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #ifndef GPU_VULKAN_VULKAN_SURFACE_H_ | 5 #ifndef GPU_VULKAN_VULKAN_SURFACE_H_ |
| 6 #define GPU_VULKAN_VULKAN_SURFACE_H_ | 6 #define GPU_VULKAN_VULKAN_SURFACE_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | |
| 8 #include "gpu/vulkan/vulkan_export.h" | 9 #include "gpu/vulkan/vulkan_export.h" |
| 10 #include "ui/gfx/geometry/size.h" | |
| 11 #include "ui/gfx/native_widget_types.h" | |
| 9 | 12 |
| 10 namespace gfx { | 13 namespace gfx { |
| 11 | 14 |
| 12 class VULKAN_EXPORT VulkanSurface { | 15 class VULKAN_EXPORT VulkanSurface { |
| 13 public: | 16 public: |
| 17 static bool InitializeOneOff(); | |
| 18 | |
| 19 // Minimum bit depth of surface. | |
| 20 enum Format { | |
| 21 SURFACE_ARGB8888, | |
| 22 SURFACE_RGB565, | |
| 23 SURFACE_OSMESA_BGRA, | |
| 24 SURFACE_OSMESA_RGBA, | |
|
piman
2016/03/09 01:25:34
I doubt OSMesa will ever support Vulkan.
David Yen
2016/03/10 01:39:49
Done.
| |
| 25 | |
| 26 NUM_SURFACE_FORMATS, | |
| 27 SURFACE_DEFAULT = SURFACE_ARGB8888 | |
| 28 }; | |
| 29 | |
| 30 virtual bool Initialize(VulkanSurface::Format format) = 0; | |
| 31 virtual void Destroy() = 0; | |
| 32 | |
| 33 virtual ~VulkanSurface(); | |
| 34 | |
| 35 // Create a surface that render directlys into a surface. | |
| 36 static scoped_ptr<gfx::VulkanSurface> CreateViewSurface( | |
| 37 gfx::AcceleratedWidget window); | |
| 38 | |
| 39 // Create a surface for offscreen rendering. | |
|
piman
2016/03/09 01:25:34
I don't think we want this. It was necessary in GL
David Yen
2016/03/10 01:39:49
Done.
| |
| 40 static scoped_ptr<gfx::VulkanSurface> CreateOffscreenSurface( | |
| 41 const gfx::Size& size); | |
| 42 | |
| 43 protected: | |
| 14 VulkanSurface(); | 44 VulkanSurface(); |
| 15 | 45 |
| 16 static bool InitializeOneOff(); | 46 private: |
| 17 | 47 DISALLOW_COPY_AND_ASSIGN(VulkanSurface); |
| 18 protected: | |
| 19 virtual ~VulkanSurface(); | |
| 20 }; | 48 }; |
| 21 | 49 |
| 22 } // namespace gfx | 50 } // namespace gfx |
| 23 | 51 |
| 24 #endif // GPU_VULKAN_VULKAN_SURFACE_H_ | 52 #endif // GPU_VULKAN_VULKAN_SURFACE_H_ |
| OLD | NEW |