Index: content/common/gpu/gpu_command_buffer_stub.cc |
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc |
index 25380102fdbd0b73e97ca16ecbb02522afb80e84..780c0e483eefe09595a349994ce70f15317c2868 100644 |
--- a/content/common/gpu/gpu_command_buffer_stub.cc |
+++ b/content/common/gpu/gpu_command_buffer_stub.cc |
@@ -51,6 +51,10 @@ |
#include "content/common/gpu/stream_texture_android.h" |
#endif |
+#if defined(ENABLE_VULKAN) |
+#include "gpu/vulkan/vulkan_surface.h" |
+#endif |
+ |
namespace content { |
struct WaitForCommandState { |
WaitForCommandState(int32_t start, int32_t end, IPC::Message* reply) |
@@ -491,6 +495,13 @@ void GpuCommandBufferStub::Destroy() { |
command_buffer_.reset(); |
+#if defined(ENABLE_VULKAN) |
+ if (vk_surface_) { |
+ vk_surface_->Destroy(); |
+ vk_surface_.reset(); |
+ } |
+#endif |
+ |
// Remove this after crbug.com/248395 is sorted out. |
surface_ = NULL; |
} |
@@ -539,6 +550,12 @@ void GpuCommandBufferStub::OnInitialize( |
this, |
handle_, |
surface_format_); |
+#if defined(ENABLE_VULKAN) |
+ vk_surface_ = gfx::VulkanSurface::CreateViewSurface(handle_.handle); |
+ bool vk_result = vk_surface_->Initialize( |
+ static_cast<gfx::VulkanSurface::Format>(surface_format_)); |
+ DCHECK(vk_result); |
+#endif |
} else { |
surface_ = manager->GetDefaultOffscreenSurface(); |
} |