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

Side by Side Diff: gpu/vulkan/vulkan_surface.h

Issue 1829163003: Added initial implementation of the Vulkan Context Provider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@vk_surface_patch
Patch Set: Block off vulkan_cc with enable_vulkan (not relevant in future patch) Created 4 years, 8 months 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
« no previous file with comments | « gpu/vulkan/vulkan_render_pass.cc ('k') | gpu/vulkan/vulkan_surface.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/memory/scoped_ptr.h"
9 #include "gpu/vulkan/vulkan_export.h" 9 #include "gpu/vulkan/vulkan_export.h"
10 #include "ui/gfx/geometry/size.h" 10 #include "ui/gfx/geometry/size.h"
11 #include "ui/gfx/native_widget_types.h" 11 #include "ui/gfx/native_widget_types.h"
12 #include "ui/gfx/swap_result.h" 12 #include "ui/gfx/swap_result.h"
13 13
14 namespace gpu { 14 namespace gpu {
15 15
16 class VulkanDeviceQueue;
16 class VulkanSwapChain; 17 class VulkanSwapChain;
17 18
18 class VULKAN_EXPORT VulkanSurface { 19 class VULKAN_EXPORT VulkanSurface {
19 public: 20 public:
20 static bool InitializeOneOff(); 21 static bool InitializeOneOff();
21 22
22 // Minimum bit depth of surface. 23 // Minimum bit depth of surface.
23 enum Format { 24 enum Format {
24 FORMAT_BGRA8888, 25 FORMAT_BGRA8888,
25 FORMAT_RGB565, 26 FORMAT_RGB565,
26 27
27 NUM_SURFACE_FORMATS, 28 NUM_SURFACE_FORMATS,
28 DEFAULT_SURFACE_FORMAT = FORMAT_BGRA8888 29 DEFAULT_SURFACE_FORMAT = FORMAT_BGRA8888
29 }; 30 };
30 31
31 virtual ~VulkanSurface() = 0; 32 virtual ~VulkanSurface() = 0;
32 33
33 virtual bool Initialize(VulkanSurface::Format format) = 0; 34 virtual bool Initialize(VulkanDeviceQueue* device_queue,
35 VulkanSurface::Format format) = 0;
34 virtual void Destroy() = 0; 36 virtual void Destroy() = 0;
35 37
36 virtual gfx::SwapResult SwapBuffers() = 0; 38 virtual gfx::SwapResult SwapBuffers() = 0;
37 39
38 virtual VulkanSwapChain* GetSwapChain() = 0; 40 virtual VulkanSwapChain* GetSwapChain() = 0;
39 41
40 virtual void Finish() = 0; 42 virtual void Finish() = 0;
41 43
42 // Create a surface that render directlys into a surface. 44 // Create a surface that render directlys into a surface.
43 static scoped_ptr<VulkanSurface> CreateViewSurface( 45 static scoped_ptr<VulkanSurface> CreateViewSurface(
44 gfx::AcceleratedWidget window); 46 gfx::AcceleratedWidget window);
45 47
46 protected: 48 protected:
47 VulkanSurface(); 49 VulkanSurface();
48 50
49 private: 51 private:
50 DISALLOW_COPY_AND_ASSIGN(VulkanSurface); 52 DISALLOW_COPY_AND_ASSIGN(VulkanSurface);
51 }; 53 };
52 54
53 } // namespace gpu 55 } // namespace gpu
54 56
55 #endif // GPU_VULKAN_VULKAN_SURFACE_H_ 57 #endif // GPU_VULKAN_VULKAN_SURFACE_H_
OLDNEW
« no previous file with comments | « gpu/vulkan/vulkan_render_pass.cc ('k') | gpu/vulkan/vulkan_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698