auto nativeInterface = GrGLMakeNativeInterface();
sContext = GrDirectContext::MakeGL(nativeInterface).release();
GrGLTextureInfo textureInfo;
GrBackendTexture allocated_texture = sContext->createBackendTexture(
400, 400, GrBackendFormats::MakeGL(GL_RGB8, GL_TEXTURE_2D), GrMipmapped::k, GrRenderable::kYes);
if (!GrBackendTextures::GetGLTextureInfo(allocated_texture,
&textureInfo)) {
std::cout << "allocating texture failed" << std::endl;
}
sSurface = SkSurfaces::WrapBackendTexture(sContext, allocated_texture, kTopLeft_GrSurfaceOrigin, 1, SkColorType::kRGBA_8888_SkColorType, nullptr,
nullptr, nullptr, nullptr).release();