Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
GrGLOpsRenderPass Class Reference

#include <GrGLOpsRenderPass.h>

Inheritance diagram for GrGLOpsRenderPass:
GrOpsRenderPass

Public Member Functions

 GrGLOpsRenderPass (GrGLGpu *gpu)
 
void inlineUpload (GrOpFlushState *state, GrDeferredTextureUploadFn &upload) override
 
void set (GrRenderTarget *, bool useMSAASurface, const SkIRect &contentBounds, GrSurfaceOrigin, const LoadAndStoreInfo &, const StencilLoadAndStoreInfo &)
 
void reset ()
 
- Public Member Functions inherited from GrOpsRenderPass
virtual ~GrOpsRenderPass ()
 
void begin ()
 
void end ()
 
void bindPipeline (const GrProgramInfo &, const SkRect &drawBounds)
 
void setScissorRect (const SkIRect &)
 
void bindTextures (const GrGeometryProcessor &, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &)
 
void bindBuffers (sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart=GrPrimitiveRestart::kNo)
 
void draw (int vertexCount, int baseVertex)
 
void drawIndexed (int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, int baseVertex)
 
void drawInstanced (int instanceCount, int baseInstance, int vertexCount, int baseVertex)
 
void drawIndexedInstanced (int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex)
 
void drawIndirect (const GrBuffer *drawIndirectBuffer, size_t bufferOffset, int drawCount)
 
void drawIndexedIndirect (const GrBuffer *drawIndirectBuffer, size_t bufferOffset, int drawCount)
 
void drawIndexPattern (int patternIndexCount, int patternRepeatCount, int maxPatternRepetitionsInIndexBuffer, int patternVertexCount, int baseVertex)
 
void clear (const GrScissorState &scissor, std::array< float, 4 > color)
 
void clearStencilClip (const GrScissorState &scissor, bool insideStencilMask)
 
void executeDrawable (std::unique_ptr< SkDrawable::GpuDrawHandler >)
 

Private Member Functions

GrGpugpu () override
 
void onBegin () override
 
void onEnd () override
 
bool onBindPipeline (const GrProgramInfo &programInfo, const SkRect &drawBounds) override
 
void onSetScissorRect (const SkIRect &scissor) override
 
bool onBindTextures (const GrGeometryProcessor &, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &) override
 
void onBindBuffers (sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart) override
 
void onDraw (int vertexCount, int baseVertex) override
 
void onDrawIndexed (int indexCount, int baseIndex, uint16_t minIndexValue, uint16_t maxIndexValue, int baseVertex) override
 
void onDrawInstanced (int instanceCount, int baseInstance, int vertexCount, int baseVertex) override
 
void onDrawIndexedInstanced (int indexCount, int baseIndex, int instanceCount, int baseInstance, int baseVertex) override
 
void onDrawIndirect (const GrBuffer *drawIndirectBuffer, size_t offset, int drawCount) override
 
void onDrawIndexedIndirect (const GrBuffer *drawIndirectBuffer, size_t offset, int drawCount) override
 
void onClear (const GrScissorState &scissor, std::array< float, 4 > color) override
 
void onClearStencilClip (const GrScissorState &scissor, bool insideStencilMask) override
 

Additional Inherited Members

- Protected Member Functions inherited from GrOpsRenderPass
 GrOpsRenderPass ()
 
 GrOpsRenderPass (GrRenderTarget *rt, GrSurfaceOrigin origin)
 
void set (GrRenderTarget *rt, GrSurfaceOrigin origin)
 
- Protected Attributes inherited from GrOpsRenderPass
GrSurfaceOrigin fOrigin
 
GrRenderTargetfRenderTarget
 
sk_sp< const GrBufferfActiveIndexBuffer
 
sk_sp< const GrBufferfActiveVertexBuffer
 
sk_sp< const GrBufferfActiveInstanceBuffer
 

Detailed Description

Definition at line 20 of file GrGLOpsRenderPass.h.

Constructor & Destructor Documentation

◆ GrGLOpsRenderPass()

GrGLOpsRenderPass::GrGLOpsRenderPass ( GrGLGpu gpu)
inline

We do not actually buffer up draws or do any work in the this class for GL. Instead commands are immediately sent to the gpu to execute. Thus all the commands in this class are simply pass through functions to corresponding calls in the GrGLGpu class.

Definition at line 27 of file GrGLOpsRenderPass.h.

27: fGpu(gpu) {}
GrGpu * gpu() override

Member Function Documentation

◆ gpu()

GrGpu * GrGLOpsRenderPass::gpu ( )
inlineoverrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 41 of file GrGLOpsRenderPass.h.

41{ return fGpu; }

◆ inlineUpload()

void GrGLOpsRenderPass::inlineUpload ( GrOpFlushState state,
GrDeferredTextureUploadFn upload 
)
inlineoverridevirtual

Implements GrOpsRenderPass.

Definition at line 29 of file GrGLOpsRenderPass.h.

29 {
30 state->doUpload(upload);
31 }
AtkStateType state

◆ onBegin()

void GrGLOpsRenderPass::onBegin ( )
overrideprivatevirtual

Reimplemented from GrOpsRenderPass.

Definition at line 48 of file GrGLOpsRenderPass.cpp.

48 {
49 auto glRT = static_cast<GrGLRenderTarget*>(fRenderTarget);
50 if (fUseMultisampleFBO &&
51 fColorLoadAndStoreInfo.fLoadOp == GrLoadOp::kLoad &&
52 glRT->hasDynamicMSAAAttachment()) {
53 // Load the single sample fbo into the dmsaa attachment.
54 if (fGpu->glCaps().canResolveSingleToMSAA()) {
55 fGpu->resolveRenderFBOs(glRT, this->dmsaaLoadStoreBounds().asSkIRect(),
56 GrGLGpu::ResolveDirection::kSingleToMSAA);
57 } else {
58 fGpu->drawSingleIntoMSAAFBO(glRT, this->dmsaaLoadStoreBounds().asSkIRect());
59 }
60 }
61
62 fGpu->beginCommandBuffer(glRT, fUseMultisampleFBO, fContentBounds, fOrigin,
63 fColorLoadAndStoreInfo, fStencilLoadAndStoreInfo);
64}
bool canResolveSingleToMSAA() const
Definition GrGLCaps.h:308
const GrGLCaps & glCaps() const
Definition GrGLGpu.h:108
void resolveRenderFBOs(GrGLRenderTarget *, const SkIRect &resolveRect, ResolveDirection, bool invalidateReadBufferAfterBlit=false)
Definition GrGLGpu.cpp:2551
void beginCommandBuffer(GrGLRenderTarget *, bool useMultisampleFBO, const SkIRect &bounds, GrSurfaceOrigin, const GrOpsRenderPass::LoadAndStoreInfo &colorLoadStore, const GrOpsRenderPass::StencilLoadAndStoreInfo &stencilLoadStore)
Definition GrGLGpu.cpp:2200
void drawSingleIntoMSAAFBO(GrGLRenderTarget *rt, const SkIRect &drawBounds)
Definition GrGLGpu.h:179
GrSurfaceOrigin fOrigin
GrRenderTarget * fRenderTarget
SkIRect asSkIRect() const

◆ onBindBuffers()

void GrGLOpsRenderPass::onBindBuffers ( sk_sp< const GrBuffer indexBuffer,
sk_sp< const GrBuffer instanceBuffer,
sk_sp< const GrBuffer vertexBuffer,
GrPrimitiveRestart  primitiveRestart 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 100 of file GrGLOpsRenderPass.cpp.

103 {
104 SkASSERT((primitiveRestart == GrPrimitiveRestart::kNo) || indexBuffer);
105 GrGLProgram* program = fGpu->currentProgram();
106 SkASSERT(program);
107
108#ifdef SK_DEBUG
109 fDidBindInstanceBuffer = false;
110 fDidBindVertexBuffer = false;
111#endif
112
113 int numAttribs = program->numVertexAttributes() + program->numInstanceAttributes();
114 fAttribArrayState = fGpu->bindInternalVertexArray(indexBuffer.get(), numAttribs,
115 primitiveRestart);
116
117 if (indexBuffer) {
118 if (indexBuffer->isCpuBuffer()) {
119 auto* cpuIndexBuffer = static_cast<const GrCpuBuffer*>(indexBuffer.get());
120 fIndexPointer = reinterpret_cast<const uint16_t*>(cpuIndexBuffer->data());
121 } else {
122 fIndexPointer = nullptr;
123 }
124 }
125
126 // If this platform does not support baseInstance, defer binding of the instance buffer.
128 this->bindInstanceBuffer(instanceBuffer.get(), 0);
129 SkDEBUGCODE(fDidBindInstanceBuffer = true;)
130 }
131 fActiveInstanceBuffer = std::move(instanceBuffer);
132
133 // We differ binding the vertex buffer for one of two situations:
134 // 1) This platform does not support baseVertex with indexed draws.
135 // 2) There is a driver bug affecting glDrawArrays.
136 if ((indexBuffer && fGpu->glCaps().baseVertexBaseInstanceSupport()) ||
137 (!indexBuffer && !fGpu->glCaps().drawArraysBaseVertexIsBroken())) {
138 this->bindVertexBuffer(vertexBuffer.get(), 0);
139 SkDEBUGCODE(fDidBindVertexBuffer = true;)
140 }
141 fActiveVertexBuffer = std::move(vertexBuffer);
142 fActiveIndexBuffer = std::move(indexBuffer);
143}
#define SkASSERT(cond)
Definition SkAssert.h:116
#define SkDEBUGCODE(...)
Definition SkDebug.h:23
virtual bool isCpuBuffer() const =0
bool baseVertexBaseInstanceSupport() const
Are the glDraw*Base(VertexBase)Instance methods, and baseInstance fields in indirect draw.
Definition GrGLCaps.h:369
bool drawArraysBaseVertexIsBroken() const
Definition GrGLCaps.h:407
GrGLProgram * currentProgram()
Definition GrGLGpu.h:144
GrGLAttribArrayState * bindInternalVertexArray(const GrBuffer *indexBuffer, int numAttribs, GrPrimitiveRestart primitiveRestart)
Definition GrGLGpu.h:156
int numVertexAttributes() const
int numInstanceAttributes() const
sk_sp< const GrBuffer > fActiveIndexBuffer
sk_sp< const GrBuffer > fActiveInstanceBuffer
sk_sp< const GrBuffer > fActiveVertexBuffer
T * get() const
Definition SkRefCnt.h:303

◆ onBindPipeline()

bool GrGLOpsRenderPass::onBindPipeline ( const GrProgramInfo programInfo,
const SkRect drawBounds 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 81 of file GrGLOpsRenderPass.cpp.

82 {
83 fPrimitiveType = programInfo.primitiveType();
84 return fGpu->flushGLState(fRenderTarget, fUseMultisampleFBO, programInfo);
85}
bool flushGLState(GrRenderTarget *, bool useMultisampleFBO, const GrProgramInfo &)
Definition GrGLGpu.cpp:2065
GrPrimitiveType primitiveType() const

◆ onBindTextures()

bool GrGLOpsRenderPass::onBindTextures ( const GrGeometryProcessor geomProc,
const GrSurfaceProxy *const  geomProcTextures[],
const GrPipeline pipeline 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 91 of file GrGLOpsRenderPass.cpp.

93 {
94 GrGLProgram* program = fGpu->currentProgram();
95 SkASSERT(program);
96 program->bindTextures(geomProc, geomProcTextures, pipeline);
97 return true;
98}
void bindTextures(const GrGeometryProcessor &, const GrSurfaceProxy *const geomProcTextures[], const GrPipeline &)

◆ onClear()

void GrGLOpsRenderPass::onClear ( const GrScissorState scissor,
std::array< float, 4 >  color 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 433 of file GrGLOpsRenderPass.cpp.

433 {
434 fGpu->clear(scissor, color, fRenderTarget, fUseMultisampleFBO, fOrigin);
435}
SkColor4f color
void clear(const GrScissorState &, std::array< float, 4 > color, GrRenderTarget *, bool useMultisampleFBO, GrSurfaceOrigin)
Definition GrGLGpu.cpp:2169

◆ onClearStencilClip()

void GrGLOpsRenderPass::onClearStencilClip ( const GrScissorState scissor,
bool  insideStencilMask 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 437 of file GrGLOpsRenderPass.cpp.

437 {
438 fGpu->clearStencilClip(scissor, insideStencilMask, fRenderTarget, fUseMultisampleFBO, fOrigin);
439}
void clearStencilClip(const GrScissorState &, bool insideStencilMask, GrRenderTarget *, bool useMultisampleFBO, GrSurfaceOrigin)
Definition GrGLGpu.cpp:2291

◆ onDraw()

void GrGLOpsRenderPass::onDraw ( int  vertexCount,
int  baseVertex 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 182 of file GrGLOpsRenderPass.cpp.

182 {
183 SkASSERT(fDidBindVertexBuffer || fGpu->glCaps().drawArraysBaseVertexIsBroken());
184 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
185 if (fGpu->glCaps().drawArraysBaseVertexIsBroken()) {
186 this->bindVertexBuffer(fActiveVertexBuffer.get(), baseVertex);
187 baseVertex = 0;
188 }
189 GL_CALL(DrawArrays(glPrimType, baseVertex, vertexCount));
191}
#define GL_CALL(X)
unsigned int GrGLenum
Definition GrGLTypes.h:102
GrGLenum prepareToDraw(GrPrimitiveType primitiveType)
Definition GrGLGpu.cpp:2516
void didDrawTo(GrRenderTarget *)
Definition GrGLGpu.cpp:2134

◆ onDrawIndexed()

void GrGLOpsRenderPass::onDrawIndexed ( int  indexCount,
int  baseIndex,
uint16_t  minIndexValue,
uint16_t  maxIndexValue,
int  baseVertex 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 193 of file GrGLOpsRenderPass.cpp.

194 {
195 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
198 SkASSERT(fDidBindVertexBuffer);
199 if (baseVertex != 0) {
200 GL_CALL(DrawElementsInstancedBaseVertexBaseInstance(
201 glPrimType, indexCount, GR_GL_UNSIGNED_SHORT,
202 this->offsetForBaseIndex(baseIndex), 1, baseVertex, 0));
203 return;
204 }
205 } else {
206 this->bindVertexBuffer(fActiveVertexBuffer.get(), baseVertex);
207 }
208
209 if (fGpu->glCaps().drawRangeElementsSupport()) {
210 GL_CALL(DrawRangeElements(glPrimType, minIndexValue, maxIndexValue, indexCount,
211 GR_GL_UNSIGNED_SHORT, this->offsetForBaseIndex(baseIndex)));
212 } else {
213 GL_CALL(DrawElements(glPrimType, indexCount, GR_GL_UNSIGNED_SHORT,
214 this->offsetForBaseIndex(baseIndex)));
215 }
217}
#define GR_GL_UNSIGNED_SHORT
bool drawInstancedSupport() const
Definition GrCaps.h:80
bool drawRangeElementsSupport() const
Is there support for glDrawRangeElements?
Definition GrGLCaps.h:365

◆ onDrawIndexedIndirect()

void GrGLOpsRenderPass::onDrawIndexedIndirect ( const GrBuffer drawIndirectBuffer,
size_t  offset,
int  drawCount 
)
overrideprivatevirtual

Reimplemented from GrOpsRenderPass.

Definition at line 353 of file GrGLOpsRenderPass.cpp.

354 {
355 using MultiDrawType = GrGLCaps::MultiDrawType;
356
360 // The vertex buffer should have already gotten bound (as opposed us stashing it away during
361 // onBindBuffers and not expecting to bind it until this point).
362 SkASSERT(fDidBindVertexBuffer);
363
364 if (fGpu->glCaps().multiDrawType() == MultiDrawType::kANGLEOrWebGL) {
365 // ANGLE and WebGL don't support glDrawElementsIndirect. We draw everything as a multi draw.
366 this->multiDrawElementsANGLEOrWebGL(drawIndirectBuffer, offset, drawCount);
367 return;
368 }
369
370 fGpu->bindBuffer(GrGpuBufferType::kDrawIndirect, drawIndirectBuffer);
371
372 if (drawCount > 1 && fGpu->glCaps().multiDrawType() == MultiDrawType::kMultiDrawIndirect) {
373 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
374 GL_CALL(MultiDrawElementsIndirect(glPrimType, GR_GL_UNSIGNED_SHORT,
375 buffer_offset_to_gl_address(drawIndirectBuffer, offset),
376 drawCount, sizeof(GrDrawIndexedIndirectCommand)));
377 return;
378 }
379
380 for (int i = 0; i < drawCount; ++i) {
381 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
382 GL_CALL(DrawElementsIndirect(glPrimType, GR_GL_UNSIGNED_SHORT,
383 buffer_offset_to_gl_address(drawIndirectBuffer, offset)));
385 }
387}
static const void * buffer_offset_to_gl_address(const GrBuffer *drawIndirectBuffer, size_t offset)
bool nativeDrawIndirectSupport() const
Definition GrCaps.h:84
bool nativeDrawIndexedIndirectIsBroken() const
Definition GrCaps.h:144
MultiDrawType multiDrawType() const
How are multi draws implemented (if at all)?
Definition GrGLCaps.h:338
GrGLenum bindBuffer(GrGpuBufferType type, const GrBuffer *)
Definition GrGLGpu.cpp:2143
const GrCaps * caps() const
Definition GrGpu.h:73
Point offset

◆ onDrawIndexedInstanced()

void GrGLOpsRenderPass::onDrawIndexedInstanced ( int  indexCount,
int  baseIndex,
int  instanceCount,
int  baseInstance,
int  baseVertex 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 244 of file GrGLOpsRenderPass.cpp.

245 {
246 int maxInstances = fGpu->glCaps().maxInstancesPerDrawWithoutCrashing(instanceCount);
247 for (int i = 0; i < instanceCount; i += maxInstances) {
248 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
249 int instanceCountForDraw = std::min(instanceCount - i, maxInstances);
250 int baseInstanceForDraw = baseInstance + i;
252 SkASSERT(fDidBindInstanceBuffer);
253 SkASSERT(fDidBindVertexBuffer);
254 GL_CALL(DrawElementsInstancedBaseVertexBaseInstance(
255 glPrimType, indexCount, GR_GL_UNSIGNED_SHORT,
256 this->offsetForBaseIndex(baseIndex), instanceCountForDraw, baseVertex,
257 baseInstanceForDraw));
258 } else {
259 this->bindInstanceBuffer(fActiveInstanceBuffer.get(), baseInstanceForDraw);
260 this->bindVertexBuffer(fActiveVertexBuffer.get(), baseVertex);
261 GL_CALL(DrawElementsInstanced(glPrimType, indexCount, GR_GL_UNSIGNED_SHORT,
262 this->offsetForBaseIndex(baseIndex), instanceCountForDraw));
263 }
264 }
266}
int maxInstancesPerDrawWithoutCrashing(int pendingInstanceCount) const
Definition GrGLCaps.h:468

◆ onDrawIndirect()

void GrGLOpsRenderPass::onDrawIndirect ( const GrBuffer drawIndirectBuffer,
size_t  offset,
int  drawCount 
)
overrideprivatevirtual

Reimplemented from GrOpsRenderPass.

Definition at line 276 of file GrGLOpsRenderPass.cpp.

277 {
278 using MultiDrawType = GrGLCaps::MultiDrawType;
279
282 SkASSERT(fDidBindVertexBuffer || fGpu->glCaps().drawArraysBaseVertexIsBroken());
283
284 if (fGpu->glCaps().drawArraysBaseVertexIsBroken()) {
285 // We weren't able to bind the vertex buffer during onBindBuffers because of a driver bug
286 // affecting glDrawArrays.
287 this->bindVertexBuffer(fActiveVertexBuffer.get(), 0);
288 }
289
290 if (fGpu->glCaps().multiDrawType() == MultiDrawType::kANGLEOrWebGL) {
291 // ANGLE and WebGL don't support glDrawElementsIndirect. We draw everything as a multi draw.
292 this->multiDrawArraysANGLEOrWebGL(drawIndirectBuffer, offset, drawCount);
293 return;
294 }
295
296 fGpu->bindBuffer(GrGpuBufferType::kDrawIndirect, drawIndirectBuffer);
297
298 if (drawCount > 1 && fGpu->glCaps().multiDrawType() == MultiDrawType::kMultiDrawIndirect) {
299 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
300 GL_CALL(MultiDrawArraysIndirect(glPrimType,
301 buffer_offset_to_gl_address(drawIndirectBuffer, offset),
302 drawCount, sizeof(GrDrawIndirectCommand)));
303 return;
304 }
305
306 for (int i = 0; i < drawCount; ++i) {
307 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
308 GL_CALL(DrawArraysIndirect(glPrimType,
309 buffer_offset_to_gl_address(drawIndirectBuffer, offset)));
310 offset += sizeof(GrDrawIndirectCommand);
311 }
313}

◆ onDrawInstanced()

void GrGLOpsRenderPass::onDrawInstanced ( int  instanceCount,
int  baseInstance,
int  vertexCount,
int  baseVertex 
)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 219 of file GrGLOpsRenderPass.cpp.

220 {
221 SkASSERT(fDidBindVertexBuffer || fGpu->glCaps().drawArraysBaseVertexIsBroken());
222 if (fGpu->glCaps().drawArraysBaseVertexIsBroken()) {
223 // We weren't able to bind the vertex buffer during onBindBuffers because of a driver bug
224 // affecting glDrawArrays.
225 this->bindVertexBuffer(fActiveVertexBuffer.get(), 0);
226 }
227 int maxInstances = fGpu->glCaps().maxInstancesPerDrawWithoutCrashing(instanceCount);
228 for (int i = 0; i < instanceCount; i += maxInstances) {
229 GrGLenum glPrimType = fGpu->prepareToDraw(fPrimitiveType);
230 int instanceCountForDraw = std::min(instanceCount - i, maxInstances);
231 int baseInstanceForDraw = baseInstance + i;
233 SkASSERT(fDidBindInstanceBuffer);
234 GL_CALL(DrawArraysInstancedBaseInstance(glPrimType, baseVertex, vertexCount,
235 instanceCountForDraw, baseInstanceForDraw));
236 } else {
237 this->bindInstanceBuffer(fActiveInstanceBuffer.get(), baseInstanceForDraw);
238 GL_CALL(DrawArraysInstanced(glPrimType, baseVertex, vertexCount, instanceCountForDraw));
239 }
240 }
242}

◆ onEnd()

void GrGLOpsRenderPass::onEnd ( )
overrideprivatevirtual

Reimplemented from GrOpsRenderPass.

Definition at line 66 of file GrGLOpsRenderPass.cpp.

66 {
67 auto glRT = static_cast<GrGLRenderTarget*>(fRenderTarget);
68 fGpu->endCommandBuffer(glRT, fUseMultisampleFBO, fColorLoadAndStoreInfo,
69 fStencilLoadAndStoreInfo);
70
71 if (fUseMultisampleFBO &&
72 fColorLoadAndStoreInfo.fStoreOp == GrStoreOp::kStore &&
73 glRT->hasDynamicMSAAAttachment()) {
74 // Blit the msaa attachment into the single sample fbo.
75 fGpu->resolveRenderFBOs(glRT, this->dmsaaLoadStoreBounds().asSkIRect(),
76 GrGLGpu::ResolveDirection::kMSAAToSingle,
77 true /*invalidateReadBufferAfterBlit*/);
78 }
79}
void endCommandBuffer(GrGLRenderTarget *, bool useMultisampleFBO, const GrOpsRenderPass::LoadAndStoreInfo &colorLoadStore, const GrOpsRenderPass::StencilLoadAndStoreInfo &stencilLoadStore)
Definition GrGLGpu.cpp:2243

◆ onSetScissorRect()

void GrGLOpsRenderPass::onSetScissorRect ( const SkIRect scissor)
overrideprivatevirtual

Implements GrOpsRenderPass.

Definition at line 87 of file GrGLOpsRenderPass.cpp.

87 {
88 fGpu->flushScissorRect(scissor, fRenderTarget->height(), fOrigin);
89}
void flushScissorRect(const SkIRect &scissor, int rtHeight, GrSurfaceOrigin)
Definition GrGLGpu.cpp:2005
int height() const
Definition GrSurface.h:37

◆ reset()

void GrGLOpsRenderPass::reset ( )
inline

Definition at line 36 of file GrGLOpsRenderPass.h.

36 {
37 fRenderTarget = nullptr;
38 }

◆ set()

void GrGLOpsRenderPass::set ( GrRenderTarget rt,
bool  useMSAASurface,
const SkIRect contentBounds,
GrSurfaceOrigin  origin,
const LoadAndStoreInfo colorInfo,
const StencilLoadAndStoreInfo stencilInfo 
)

Definition at line 21 of file GrGLOpsRenderPass.cpp.

23 {
24 SkASSERT(fGpu);
26 SkASSERT(fGpu == rt->getContext()->priv().getGpu());
27
28 this->INHERITED::set(rt, origin);
29 fUseMultisampleFBO = useMSAASurface;
30 fContentBounds = contentBounds;
31 fColorLoadAndStoreInfo = colorInfo;
32 fStencilLoadAndStoreInfo = stencilInfo;
33}
GrDirectContextPriv priv()
const GrDirectContext * getContext() const
void set(GrRenderTarget *rt, GrSurfaceOrigin origin)

The documentation for this class was generated from the following files: