Use GrBackendRenderTarget rather than the deprecated GrBackendRenderTargetDesc. (flutter/engine#4028)

This commit is contained in:
Chinmay Garde
2017-08-28 15:53:57 -07:00
committed by GitHub
parent 48fe9dcb3b
commit c78cf3d594

View File

@@ -9,6 +9,7 @@
#include "flutter/vulkan/vulkan_image.h"
#include "flutter/vulkan/vulkan_proc_table.h"
#include "flutter/vulkan/vulkan_surface.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
#include "third_party/skia/include/gpu/vk/GrVkTypes.h"
#include "third_party/skia/src/gpu/vk/GrVkUtil.h"
@@ -205,26 +206,18 @@ sk_sp<SkSurface> VulkanSwapchain::CreateSkiaSurface(GrContext* gr_context,
.fLevelCount = 1,
};
GrBackendRenderTargetDesc desc;
desc.fWidth = size.fWidth;
desc.fHeight = size.fHeight;
desc.fConfig = pixel_config;
desc.fOrigin = kTopLeft_GrSurfaceOrigin;
// TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt.
desc.fSampleCnt = 0;
desc.fStencilBits = 0;
desc.fRenderTargetHandle = reinterpret_cast<GrBackendObject>(&image_info);
GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0, 0,
image_info);
SkSurfaceProps props(SkSurfaceProps::InitType::kLegacyFontHost_InitType);
return SkSurface::MakeFromBackendRenderTarget(
gr_context, // context
desc, // backend render target description
gr_context, // context
backend_render_target, // backend render target
kTopLeft_GrSurfaceOrigin,
SkColorSpaceFromVkFormat(surface_format_.format), // colorspace
&props // surface properties
);
);
}
bool VulkanSwapchain::CreateSwapchainImages(GrContext* skia_context) {