diff options
author | 2017-07-25 10:05:01 -0400 | |
---|---|---|
committer | 2017-07-25 14:33:03 +0000 | |
commit | 02611d9afdd887ee443825ac88377f2eea093380 (patch) | |
tree | 3e35b4e4fde4b6f387f7bdb345b049c1ab76e182 /src/gpu/mock/GrMockGpu.cpp | |
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 'src/gpu/mock/GrMockGpu.cpp')
-rw-r--r-- | src/gpu/mock/GrMockGpu.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gpu/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp index 1778ee2ba5..614e627867 100644 --- a/src/gpu/mock/GrMockGpu.cpp +++ b/src/gpu/mock/GrMockGpu.cpp @@ -26,14 +26,19 @@ int GrMockGpu::NextExternalTextureID() { GrGpu* GrMockGpu::Create(GrBackendContext backendContext, const GrContextOptions& contextOptions, GrContext* context) { + return Create(reinterpret_cast<const GrMockOptions*>(backendContext), contextOptions, context); +} + +GrGpu* GrMockGpu::Create(const GrMockOptions* mockOptions, const GrContextOptions& contextOptions, + GrContext* context) { static const GrMockOptions kDefaultOptions = GrMockOptions(); - const GrMockOptions* options = reinterpret_cast<const GrMockOptions*>(backendContext); - if (!options) { - options = &kDefaultOptions; + if (!mockOptions) { + mockOptions = &kDefaultOptions; } - return new GrMockGpu(context, *options, contextOptions); + return new GrMockGpu(context, *mockOptions, contextOptions); } + GrGpuCommandBuffer* GrMockGpu::createCommandBuffer(const GrGpuCommandBuffer::LoadAndStoreInfo&, const GrGpuCommandBuffer::LoadAndStoreInfo&) { return new GrMockGpuCommandBuffer(this); |