blob: 579b4c1fbdf280d93b04af91fe4037b71881b177 [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 Verth8ec13302020-02-26 12:59:56 -050022 fCaps.reset(new GrD3DCaps(contextOptions,
23 backendContext.fAdapter.Get(),
24 backendContext.fDevice.Get()));
Jim Van Verthd2d4c5e2020-02-19 14:57:58 -050025}
26
27GrOpsRenderPass* 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
36void GrD3DGpu::submit(GrOpsRenderPass* renderPass) {
37 // TODO: actually submit something here
38 delete renderPass;
39}
40
41void GrD3DGpu::querySampleLocations(GrRenderTarget* rt, SkTArray<SkPoint>* sampleLocations) {
42 // TODO
43}
44
45sk_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
57sk_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
67sk_sp<GrTexture> GrD3DGpu::onWrapBackendTexture(const GrBackendTexture& tex, GrColorType colorType,
68 GrWrapOwnership ownership,
69 GrWrapCacheable wrapType, GrIOType ioType) {
70 // TODO
71 return nullptr;
72}
73
74sk_sp<GrTexture> GrD3DGpu::onWrapCompressedBackendTexture(const GrBackendTexture& tex,
75 GrWrapOwnership ownership,
76 GrWrapCacheable wrapType) {
77 return nullptr;
78}
79
80sk_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
89sk_sp<GrRenderTarget> GrD3DGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& rt,
90 GrColorType colorType) {
91 // TODO
92 return nullptr;
93}
94
95sk_sp<GrRenderTarget> GrD3DGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTexture& tex,
96 int sampleCnt,
97 GrColorType colorType) {
98 // TODO
99 return nullptr;
100}
101
102sk_sp<GrGpuBuffer> GrD3DGpu::onCreateBuffer(size_t sizeInBytes, GrGpuBufferType type,
103 GrAccessPattern accessPattern, const void*) {
104 // TODO
105 return nullptr;
106}
107
108GrStencilAttachment* GrD3DGpu::createStencilAttachmentForRenderTarget(
109 const GrRenderTarget* rt, int width, int height, int numStencilSamples) {
110 // TODO
111 return nullptr;
112}
113
114GrBackendTexture 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
124GrBackendTexture GrD3DGpu::onCreateCompressedBackendTexture(SkISize dimensions,
125 const GrBackendFormat& format,
126 GrMipMapped mipMapped,
127 GrProtected,
128 const BackendTextureData*) {
129 // TODO
130 return GrBackendTexture();
131}
132
133void GrD3DGpu::deleteBackendTexture(const GrBackendTexture& tex) {
134 // TODO
135}
136
Robert Phillips979b2232020-02-20 10:47:29 -0500137bool GrD3DGpu::compile(const GrProgramDesc&, const GrProgramInfo&) {
138 return false;
139}
140
Jim Van Verthd2d4c5e2020-02-19 14:57:58 -0500141#if GR_TEST_UTILS
142bool GrD3DGpu::isTestingOnlyBackendTexture(const GrBackendTexture& tex) const {
143 // TODO
144 return false;
145}
146
147GrBackendRenderTarget GrD3DGpu::createTestingOnlyBackendRenderTarget(int w, int h,
148 GrColorType colorType) {
149 // TODO
150 return GrBackendRenderTarget();
151}
152
153void GrD3DGpu::deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) {}
154#endif