Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 1 | /* |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 2 | * Copyright 2020 Google LLC |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #include "src/gpu/d3d/GrD3DCaps.h" |
| 9 | #include "src/gpu/d3d/GrD3DGpu.h" |
| 10 | |
| 11 | sk_sp<GrGpu> GrD3DGpu::Make(const GrD3DBackendContext& backendContext, |
| 12 | const GrContextOptions& contextOptions, GrContext* context) { |
| 13 | return sk_sp<GrGpu>(new GrD3DGpu(context, contextOptions, backendContext)); |
| 14 | } |
| 15 | |
| 16 | GrD3DGpu::GrD3DGpu(GrContext* context, const GrContextOptions& contextOptions, |
| 17 | const GrD3DBackendContext& backendContext) |
Jim Van Verth | 03b8ab2 | 2020-02-24 11:36:15 -0500 | [diff] [blame] | 18 | : INHERITED(context) |
| 19 | , fDevice(backendContext.fDevice) |
| 20 | , fQueue(backendContext.fQueue) |
| 21 | , fProtectedContext(backendContext.fProtectedContext) { |
Jim Van Verth | 8ec1330 | 2020-02-26 12:59:56 -0500 | [diff] [blame] | 22 | fCaps.reset(new GrD3DCaps(contextOptions, |
| 23 | backendContext.fAdapter.Get(), |
| 24 | backendContext.fDevice.Get())); |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | GrOpsRenderPass* GrD3DGpu::getOpsRenderPass( |
| 28 | GrRenderTarget* rt, GrSurfaceOrigin origin, const SkIRect& bounds, |
| 29 | const GrOpsRenderPass::LoadAndStoreInfo& colorInfo, |
| 30 | const GrOpsRenderPass::StencilLoadAndStoreInfo&, |
| 31 | const SkTArray<GrSurfaceProxy*, true>& sampledProxies) { |
| 32 | // TODO |
| 33 | return nullptr; |
| 34 | } |
| 35 | |
| 36 | void GrD3DGpu::submit(GrOpsRenderPass* renderPass) { |
| 37 | // TODO: actually submit something here |
| 38 | delete renderPass; |
| 39 | } |
| 40 | |
| 41 | void GrD3DGpu::querySampleLocations(GrRenderTarget* rt, SkTArray<SkPoint>* sampleLocations) { |
| 42 | // TODO |
| 43 | } |
| 44 | |
| 45 | sk_sp<GrTexture> GrD3DGpu::onCreateTexture(SkISize dimensions, |
| 46 | const GrBackendFormat& format, |
| 47 | GrRenderable renderable, |
| 48 | int renderTargetSampleCnt, |
| 49 | SkBudgeted budgeted, |
| 50 | GrProtected isProtected, |
| 51 | int mipLevelCount, |
| 52 | uint32_t levelClearMask) { |
| 53 | // TODO |
| 54 | return nullptr; |
| 55 | } |
| 56 | |
| 57 | sk_sp<GrTexture> GrD3DGpu::onCreateCompressedTexture(SkISize dimensions, |
| 58 | const GrBackendFormat& format, |
| 59 | SkBudgeted budgeted, |
| 60 | GrMipMapped mipMapped, |
| 61 | GrProtected isProtected, |
| 62 | const void* data, size_t dataSize) { |
| 63 | // TODO |
| 64 | return nullptr; |
| 65 | } |
| 66 | |
| 67 | sk_sp<GrTexture> GrD3DGpu::onWrapBackendTexture(const GrBackendTexture& tex, GrColorType colorType, |
| 68 | GrWrapOwnership ownership, |
| 69 | GrWrapCacheable wrapType, GrIOType ioType) { |
| 70 | // TODO |
| 71 | return nullptr; |
| 72 | } |
| 73 | |
| 74 | sk_sp<GrTexture> GrD3DGpu::onWrapCompressedBackendTexture(const GrBackendTexture& tex, |
| 75 | GrWrapOwnership ownership, |
| 76 | GrWrapCacheable wrapType) { |
| 77 | return nullptr; |
| 78 | } |
| 79 | |
| 80 | sk_sp<GrTexture> GrD3DGpu::onWrapRenderableBackendTexture(const GrBackendTexture& tex, |
| 81 | int sampleCnt, |
| 82 | GrColorType colorType, |
| 83 | GrWrapOwnership ownership, |
| 84 | GrWrapCacheable cacheable) { |
| 85 | // TODO |
| 86 | return nullptr; |
| 87 | } |
| 88 | |
| 89 | sk_sp<GrRenderTarget> GrD3DGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& rt, |
| 90 | GrColorType colorType) { |
| 91 | // TODO |
| 92 | return nullptr; |
| 93 | } |
| 94 | |
| 95 | sk_sp<GrRenderTarget> GrD3DGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTexture& tex, |
| 96 | int sampleCnt, |
| 97 | GrColorType colorType) { |
| 98 | // TODO |
| 99 | return nullptr; |
| 100 | } |
| 101 | |
| 102 | sk_sp<GrGpuBuffer> GrD3DGpu::onCreateBuffer(size_t sizeInBytes, GrGpuBufferType type, |
| 103 | GrAccessPattern accessPattern, const void*) { |
| 104 | // TODO |
| 105 | return nullptr; |
| 106 | } |
| 107 | |
| 108 | GrStencilAttachment* GrD3DGpu::createStencilAttachmentForRenderTarget( |
| 109 | const GrRenderTarget* rt, int width, int height, int numStencilSamples) { |
| 110 | // TODO |
| 111 | return nullptr; |
| 112 | } |
| 113 | |
| 114 | GrBackendTexture GrD3DGpu::onCreateBackendTexture(SkISize dimensions, |
| 115 | const GrBackendFormat& format, |
| 116 | GrRenderable, |
| 117 | GrMipMapped mipMapped, |
| 118 | GrProtected, |
| 119 | const BackendTextureData*) { |
| 120 | // TODO |
| 121 | return GrBackendTexture(); |
| 122 | } |
| 123 | |
| 124 | GrBackendTexture GrD3DGpu::onCreateCompressedBackendTexture(SkISize dimensions, |
| 125 | const GrBackendFormat& format, |
| 126 | GrMipMapped mipMapped, |
| 127 | GrProtected, |
| 128 | const BackendTextureData*) { |
| 129 | // TODO |
| 130 | return GrBackendTexture(); |
| 131 | } |
| 132 | |
| 133 | void GrD3DGpu::deleteBackendTexture(const GrBackendTexture& tex) { |
| 134 | // TODO |
| 135 | } |
| 136 | |
Robert Phillips | 979b223 | 2020-02-20 10:47:29 -0500 | [diff] [blame] | 137 | bool GrD3DGpu::compile(const GrProgramDesc&, const GrProgramInfo&) { |
| 138 | return false; |
| 139 | } |
| 140 | |
Jim Van Verth | d2d4c5e | 2020-02-19 14:57:58 -0500 | [diff] [blame] | 141 | #if GR_TEST_UTILS |
| 142 | bool GrD3DGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const { |
| 143 | // TODO |
| 144 | return false; |
| 145 | } |
| 146 | |
| 147 | GrBackendRenderTarget GrD3DGpu::createTestingOnlyBackendRenderTarget(int w, int h, |
| 148 | GrColorType colorType) { |
| 149 | // TODO |
| 150 | return GrBackendRenderTarget(); |
| 151 | } |
| 152 | |
| 153 | void GrD3DGpu::deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) {} |
| 154 | #endif |