73 {
74
75
76
77
78
79
80
81 SkASSERT(fTarget && fTarget->isInstantiated());
82
83 if (fTarget->texture() == replayData.fTarget) {
84 commandBuffer->setReplayTranslation(replayData.fTranslation);
85 } else {
86 commandBuffer->clearReplayTranslation();
87 }
88
89
90
95 SkASSERT(fTarget->numSamples() == 1 &&
97 colorAttachment = resourceProvider->findOrCreateDiscardableMSAAAttachment(
99 if (!colorAttachment) {
100 SKGPU_LOG_W(
"Could not get Color attachment for RenderPassTask");
101 return Status::kFail;
102 }
103 resolveAttachment = fTarget->refTexture();
104 } else {
105 colorAttachment = fTarget->refTexture();
106 }
107
110
111 SkASSERT(fTarget->isInstantiated());
112 SkISize dimensions = context->priv().caps()->getDepthAttachmentDimensions(
113 fTarget->texture()->textureInfo(), fTarget->dimensions());
114 depthStencilAttachment = resourceProvider->findOrCreateDepthStencilAttachment(
116 if (!depthStencilAttachment) {
117 SKGPU_LOG_W(
"Could not get DepthStencil attachment for RenderPassTask");
118 return Status::kFail;
119 }
120 }
121
122
123
124
125 if (commandBuffer->addRenderPass(fRenderPassDesc,
126 std::move(colorAttachment),
127 std::move(resolveAttachment),
128 std::move(depthStencilAttachment),
130 fDrawPasses)) {
131 return Status::kSuccess;
132 } else {
133 return Status::kFail;
134 }
135}
#define SKGPU_LOG_W(fmt,...)
uint32_t numSamples() const
static SkRect Make(const SkISize &size)
AttachmentDesc fDepthStencilAttachment
AttachmentDesc fColorResolveAttachment
AttachmentDesc fColorAttachment