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