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" | |
12 #include "ui/gfx/swap_result.h" | |
9 | 13 |
10 namespace gpu { | 14 namespace gpu { |
11 | 15 |
12 class VULKAN_EXPORT VulkanSurface { | 16 class VULKAN_EXPORT VulkanSurface { |
13 public: | 17 public: |
18 static bool InitializeOneOff(); | |
19 | |
20 // Minimum bit depth of surface. | |
21 enum Format { | |
22 SURFACE_GBRA8888, | |
piman
2016/03/11 03:07:52
nit: GBRA->BGRA?
BTW, we can start with this, but
David Yen
2016/03/21 18:26:31
Done.
That's interesting about the format choice,
| |
23 SURFACE_RGB565, | |
24 | |
25 NUM_SURFACE_FORMATS, | |
26 SURFACE_DEFAULT = SURFACE_GBRA8888 | |
27 }; | |
28 | |
29 virtual ~VulkanSurface() = 0; | |
30 | |
31 virtual bool Initialize(VulkanSurface::Format format) = 0; | |
32 virtual void Destroy() = 0; | |
33 | |
34 virtual gfx::SwapResult SwapBuffers() = 0; | |
35 | |
36 // Create a surface that render directlys into a surface. | |
37 static scoped_ptr<VulkanSurface> CreateViewSurface( | |
38 gfx::AcceleratedWidget window); | |
39 | |
40 protected: | |
14 VulkanSurface(); | 41 VulkanSurface(); |
15 | 42 |
16 static bool InitializeOneOff(); | 43 private: |
17 | 44 DISALLOW_COPY_AND_ASSIGN(VulkanSurface); |
18 protected: | |
19 virtual ~VulkanSurface(); | |
20 }; | 45 }; |
21 | 46 |
22 } // namespace gpu | 47 } // namespace gpu |
23 | 48 |
24 #endif // GPU_VULKAN_VULKAN_SURFACE_H_ | 49 #endif // GPU_VULKAN_VULKAN_SURFACE_H_ |
OLD | NEW |