diff options
author | Greg Daniel <egdaniel@google.com> | 2017-07-25 10:05:01 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-25 14:33:03 +0000 |
commit | 02611d9afdd887ee443825ac88377f2eea093380 (patch) | |
tree | 3e35b4e4fde4b6f387f7bdb345b049c1ab76e182 /site | |
parent | 10b6ad13f996d2f522bc057d17acea58e43a7f0b (diff) |
Add Make[backend] calls for creating GrContexts
Docs-Preview: https://skia.org/?cl=26369
Bug: skia:
Change-Id: I460ee63e466f85b05918479f068a2e5ca2d70550
Reviewed-on: https://skia-review.googlesource.com/26369
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'site')
-rw-r--r-- | site/user/api/canvas.md | 2 | ||||
-rw-r--r-- | site/user/special/vulkan.md | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/site/user/api/canvas.md b/site/user/api/canvas.md index d9e15592dc..d6aa7b6b7c 100644 --- a/site/user/api/canvas.md +++ b/site/user/api/canvas.md @@ -98,7 +98,7 @@ has been made current to the current thread when Skia calls are made. // context in a platform-specific way. Alternatively, you may create your own GrGLInterface and // initialize it however you like to attach to an alternate OpenGL implementation or intercept // Skia's OpenGL calls. - GrContext* context = GrContext::Create(kOpenGL_GrBackend, (GrBackendContext) interface); + sk_sp<GrContext> context = GrContext::MakeGL(interface); SkImageInfo info = SkImageInfo:: MakeN32Premul(width, height); sk_sp<SkSurface> gpuSurface( SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info)); diff --git a/site/user/special/vulkan.md b/site/user/special/vulkan.md index 8dfd26a46b..5b5c2d93f3 100644 --- a/site/user/special/vulkan.md +++ b/site/user/special/vulkan.md @@ -21,7 +21,7 @@ To build the Vulkan backend, set `ndk_api = 24` in `args.gn` to target Android N Using the Vulkan Backend ------------------------ -To create a GrContext that is backed by Vulkan the client creates a Vulkan device and queue, initializes a GrVkBackendContext to describe the context, and then calls GrContext::Create: +To create a GrContext that is backed by Vulkan the client creates a Vulkan device and queue, initializes a GrVkBackendContext to describe the context, and then calls GrContext::MakeVulkan: <!--?prettify lang=c++?--> sk_sp<GrVkBackendContext> vkContext = new GrVkBackendContext; @@ -31,7 +31,7 @@ To create a GrContext that is backed by Vulkan the client creates a Vulkan devic vkBackendContext.fInterface.reset(GrVkCreateInterface(instance, vkPhysDevice, extensionFlags); ... - sk_sp<GrContext> context = GrContext::Create(kVulkan_GrBackend, (GrBackendContext) vkBackendContext); + sk_sp<GrContext> context = GrContext::MakeVulkan(vkBackendContext); When using the Vulkan backend the GrBackendObject field in GrBackendRenderTargetDesc and GrBackendTextureDesc is interpeted as a pointer |