Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
SurfaceDrawContext.h
Go to the documentation of this file.
1/*
2 * Copyright 2015 Google Inc.
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#ifndef SurfaceDrawContext_v1_DEFINED
9#define SurfaceDrawContext_v1_DEFINED
10
18#include "src/core/SkDevice.h"
26
28class GrClip;
30class GrDrawOp;
31class GrDstProxyView;
32class GrHardClip;
33class GrOp;
34struct GrQuadSetEntry;
35class GrRenderTarget;
36class GrStyledShape;
37class GrStyle;
38class GrTextureProxy;
41struct SkDrawShadowRec;
42struct SkIPoint;
43struct SkIRect;
44class SkLatticeIter;
45class SkMatrix;
46class SkPaint;
47class SkPath;
48struct SkPoint;
49struct SkRect;
50class SkRegion;
51class SkRRect;
52struct SkRSXform;
53class SkTextBlob;
54class SkVertices;
55
56namespace sktext {
57class GlyphRunList;
58}
59
60namespace skgpu::ganesh {
61
62/**
63 * A helper object to orchestrate commands (draws, etc...) for GrSurfaces that are GrRenderTargets.
64 */
66public:
67 static std::unique_ptr<SurfaceDrawContext> Make(GrRecordingContext*,
72 const SkSurfaceProps&);
73
74 /* Uses the default texture format for the color type */
75 static std::unique_ptr<SurfaceDrawContext> Make(GrRecordingContext*,
80 const SkSurfaceProps&,
81 std::string_view label,
82 int sampleCnt = 1,
83 skgpu::Mipmapped = skgpu::Mipmapped::kNo,
84 skgpu::Protected = skgpu::Protected::kNo,
87
88 /**
89 * Takes custom swizzles rather than determining swizzles from color type and format.
90 * It will have color type kUnknown.
91 */
92 static std::unique_ptr<SurfaceDrawContext> Make(GrRecordingContext*,
96 const GrBackendFormat&,
97 int sampleCnt,
101 skgpu::Swizzle writeSwizzle,
104 const SkSurfaceProps&,
105 std::string_view label);
106
107 // Same as previous factory but will try to use fallback GrColorTypes if the one passed in
108 // fails. The fallback GrColorType will have at least the number of channels and precision per
109 // channel as the passed in GrColorType. It may also swizzle the changes (e.g., BGRA -> RGBA).
110 // SRGB-ness will be preserved.
111 static std::unique_ptr<SurfaceDrawContext> MakeWithFallback(
117 const SkSurfaceProps&,
118 int sampleCnt,
123
124 // Creates a SurfaceDrawContext that wraps the passed in GrBackendTexture.
125 static std::unique_ptr<SurfaceDrawContext> MakeFromBackendTexture(
129 const GrBackendTexture&,
130 int sampleCnt,
132 const SkSurfaceProps&,
133 sk_sp<skgpu::RefCntedCallback> releaseHelper);
134
136 GrSurfaceProxyView readView,
137 GrSurfaceProxyView writeView,
140 const SkSurfaceProps&);
141
142 ~SurfaceDrawContext() override;
143
144 /**
145 * Draw everywhere (respecting the clip) with the paint.
146 */
147 void drawPaint(const GrClip*, GrPaint&&, const SkMatrix& viewMatrix);
148
149 /**
150 * Draw the rect using a paint.
151 * @param paint describes how to color pixels.
152 * @param GrAA Controls whether rect is antialiased
153 * @param viewMatrix transformation matrix
154 * @param style The style to apply. Null means fill. Currently path effects are not
155 * allowed.
156 * The rects coords are used to access the paint (through texture matrix)
157 */
158 void drawRect(const GrClip*,
159 GrPaint&& paint,
160 GrAA,
161 const SkMatrix& viewMatrix,
162 const SkRect&,
163 const GrStyle* style = nullptr);
164
165 /**
166 * Maps a rectangle of shader coordinates to a rectangle and fills that rectangle.
167 *
168 * @param GrPaint describes how to color pixels.
169 * @param GrAA Controls whether rect is antialiased
170 * @param SkMatrix transformation matrix which applies to rectToDraw
171 * @param rectToDraw the rectangle to draw
172 * @param localRect the rectangle of shader coordinates applied to rectToDraw
173 */
174 void fillRectToRect(const GrClip*,
175 GrPaint&&,
176 GrAA,
177 const SkMatrix&,
178 const SkRect& rectToDraw,
179 const SkRect& localRect);
180
181 /**
182 * Fills a block of pixels with a paint and a localMatrix, respecting the clip.
183 */
185 GrPaint&& paint,
186 const SkIRect& bounds,
187 const SkMatrix& localMatrix) {
188 SkRect rect = SkRect::Make(bounds);
190 GrQuad::MakeFromRect(rect, localMatrix), GrQuadAAFlags::kNone};
191 this->drawFilledQuad(clip, std::move(paint), &quad);
192 }
193
194 /**
195 * Creates an op that draws a fill rect with per-edge control over anti-aliasing.
196 *
197 * This is a specialized version of fillQuadWithEdgeAA, but is kept separate since knowing
198 * the geometry is a rectangle affords more optimizations.
199 */
201 const SkMatrix& viewMatrix, const SkRect& rect,
202 const SkRect* optionalLocalRect = nullptr) {
203 if (edgeAA == GrQuadAAFlags::kAll) {
204 this->fillRectToRect(clip, std::move(paint), GrAA::kYes, viewMatrix, rect,
205 (optionalLocalRect) ? *optionalLocalRect : rect);
206 return;
207 }
208 const SkRect& localRect = optionalLocalRect ? *optionalLocalRect : rect;
209 DrawQuad quad{GrQuad::MakeFromRect(rect, viewMatrix), GrQuad(localRect), edgeAA};
210 this->drawFilledQuad(clip, std::move(paint), &quad);
211 }
212
213 /**
214 * Similar to fillRectWithEdgeAA but draws an arbitrary 2D convex quadrilateral transformed
215 * by 'viewMatrix', with per-edge control over anti-aliasing. The quad should follow the
216 * ordering used by SkRect::toQuad(), which determines how the edge AA is applied:
217 * - "top" = points [0] and [1]
218 * - "right" = points[1] and [2]
219 * - "bottom" = points[2] and [3]
220 * - "left" = points[3] and [0]
221 *
222 * The last argument, 'optionalLocalQuad', can be null if no separate local coordinates are
223 * necessary.
224 */
226 const SkMatrix& viewMatrix, const SkPoint points[4],
227 const SkPoint optionalLocalPoints[4]) {
228 const SkPoint* localPoints = optionalLocalPoints ? optionalLocalPoints : points;
229 DrawQuad quad{GrQuad::MakeFromSkQuad(points, viewMatrix),
230 GrQuad::MakeFromSkQuad(localPoints, SkMatrix::I()), edgeAA};
231 this->drawFilledQuad(clip, std::move(paint), &quad);
232 }
233
234 // TODO(michaelludwig) - remove if the bulk API is not useful for SkiaRenderer
235 void drawQuadSet(const GrClip* clip, GrPaint&& paint, const SkMatrix& viewMatrix,
236 const GrQuadSetEntry[], int cnt);
237
238 /**
239 * Creates an op that draws a subrectangle of a texture. The passed color is modulated by the
240 * texture's color. 'srcRect' specifies the rectangle of the texture to draw. 'dstRect'
241 * specifies the rectangle to draw in local coords which will be transformed by 'viewMatrix' to
242 * device space.
243 */
244 void drawTexture(const GrClip*,
250 const SkPMColor4f&,
251 const SkRect& srcRect,
252 const SkRect& dstRect,
255 const SkMatrix&,
257
258 /**
259 * Variant of drawTexture that instead draws the texture applied to 'dstQuad' transformed by
260 * 'viewMatrix', using the 'srcQuad' texture coordinates clamped to the optional 'subset'. If
261 * 'subset' is null, it's equivalent to using the fast src rect constraint. If 'subset' is
262 * provided, the strict src rect constraint is applied using 'subset'.
263 */
266 GrColorType srcColorType,
267 SkAlphaType srcAlphaType,
270 SkBlendMode mode,
271 const SkPMColor4f& color,
272 const SkPoint srcQuad[4],
273 const SkPoint dstQuad[4],
274 GrQuadAAFlags edgeAA,
275 const SkRect* subset,
276 const SkMatrix& viewMatrix,
277 sk_sp<GrColorSpaceXform> texXform) {
278 DrawQuad quad{GrQuad::MakeFromSkQuad(dstQuad, viewMatrix),
279 GrQuad::MakeFromSkQuad(srcQuad, SkMatrix::I()), edgeAA};
280 this->drawTexturedQuad(clip, std::move(view), srcAlphaType, std::move(texXform), filter, mm,
281 color, mode, &quad, subset);
282 }
283
284 /**
285 * Draws a set of textures with a shared filter, color, view matrix, color xform, and
286 * texture color xform. The textures must all have the same GrTextureType and GrConfig.
287 *
288 * If any entries provide a non-null fDstClip array, it will be read from immediately based on
289 * fDstClipCount, so the pointer can become invalid after this returns.
290 *
291 * 'proxRunCnt' is the number of proxy changes encountered in the entry array. Technically this
292 * can be inferred from the array within this function, but the information is already known
293 * by SkGpuDevice, so no need to incur another iteration over the array.
294 */
295 void drawTextureSet(const GrClip*,
297 int cnt,
298 int proxyRunCnt,
301 SkBlendMode mode,
303 const SkMatrix& viewMatrix,
304 sk_sp<GrColorSpaceXform> texXform);
305
306 /**
307 * Draw a roundrect using a paint.
308 *
309 * @param paint describes how to color pixels.
310 * @param GrAA Controls whether rrect is antialiased.
311 * @param viewMatrix transformation matrix
312 * @param rrect the roundrect to draw
313 * @param style style to apply to the rrect. Currently path effects are not allowed.
314 */
315 void drawRRect(const GrClip*,
316 GrPaint&&,
317 GrAA,
318 const SkMatrix& viewMatrix,
319 const SkRRect& rrect,
320 const GrStyle& style);
321
322 /**
323 * Use a fast method to render the ambient and spot shadows for a path.
324 * Will return false if not possible for the given path.
325 *
326 * @param viewMatrix transformation matrix
327 * @param path the path to shadow
328 * @param rec parameters for shadow rendering
329 */
330 bool drawFastShadow(const GrClip*,
331 const SkMatrix& viewMatrix,
332 const SkPath& path,
333 const SkDrawShadowRec& rec);
334
335 /**
336 * Draws a path.
337 *
338 * @param paint describes how to color pixels.
339 * @param GrAA Controls whether the path is antialiased.
340 * @param viewMatrix transformation matrix
341 * @param path the path to draw
342 * @param style style to apply to the path.
343 */
344 void drawPath(const GrClip*,
345 GrPaint&&,
346 GrAA,
347 const SkMatrix& viewMatrix,
348 const SkPath&,
349 const GrStyle&);
350
351 /**
352 * Draws a shape.
353 *
354 * @param paint describes how to color pixels.
355 * @param GrAA Controls whether the path is antialiased.
356 * @param viewMatrix transformation matrix
357 * @param shape the shape to draw
358 */
359 void drawShape(const GrClip*,
360 GrPaint&&,
361 GrAA,
362 const SkMatrix& viewMatrix,
363 GrStyledShape&&);
364
365 /**
366 * Draws vertices with a paint.
367 *
368 * @param paint describes how to color pixels.
369 * @param viewMatrix transformation matrix
370 * @param vertices specifies the mesh to draw.
371 * @param overridePrimType primitive type to draw. If NULL, derive prim type from vertices.
372 * @param skipColorXform if true, do not apply a color space transfer function
373 */
374 void drawVertices(const GrClip*,
375 GrPaint&& paint,
376 const SkMatrix& viewMatrix,
377 sk_sp<SkVertices> vertices,
378 GrPrimitiveType* overridePrimType = nullptr,
379 bool skipColorXform = false);
380
381 /**
382 * Draws a custom mesh with a paint.
383 *
384 * @param paint describes how to color pixels.
385 * @param viewMatrix transformation matrix
386 * @param mesh the mesh to draw.
387 * @param children child effects referenced by SkMesh shaders
388 */
389 void drawMesh(const GrClip*,
390 GrPaint&& paint,
391 const SkMatrix& viewMatrix,
392 const SkMesh& mesh,
393 skia_private::TArray<std::unique_ptr<GrFragmentProcessor>> children);
394
395 /**
396 * Draws textured sprites from an atlas with a paint. This currently does not support AA for the
397 * sprite rectangle edges.
398 *
399 * @param paint describes how to color pixels.
400 * @param viewMatrix transformation matrix
401 * @param spriteCount number of sprites.
402 * @param xform array of compressed transformation data, required.
403 * @param texRect array of texture rectangles used to access the paint.
404 * @param colors optional array of per-sprite colors, supercedes
405 * the paint's color field.
406 */
407 void drawAtlas(const GrClip*,
408 GrPaint&& paint,
409 const SkMatrix& viewMatrix,
410 int spriteCount,
411 const SkRSXform xform[],
412 const SkRect texRect[],
413 const SkColor colors[]);
414
415 /**
416 * Draws a region.
417 *
418 * @param paint describes how to color pixels
419 * @param viewMatrix transformation matrix
420 * @param aa should the rects of the region be antialiased.
421 * @param region the region to be drawn
422 * @param style style to apply to the region
423 */
424 void drawRegion(const GrClip*,
425 GrPaint&& paint,
426 GrAA aa,
427 const SkMatrix& viewMatrix,
428 const SkRegion& region,
429 const GrStyle& style,
430 const GrUserStencilSettings* ss = nullptr);
431
432 /**
433 * Draws an oval.
434 *
435 * @param paint describes how to color pixels.
436 * @param GrAA Controls whether the oval is antialiased.
437 * @param viewMatrix transformation matrix
438 * @param oval the bounding rect of the oval.
439 * @param style style to apply to the oval. Currently path effects are not allowed.
440 */
441 void drawOval(const GrClip*,
442 GrPaint&& paint,
443 GrAA,
444 const SkMatrix& viewMatrix,
445 const SkRect& oval,
446 const GrStyle& style);
447
448 /**
449 * Draws a partial arc of an oval.
450 *
451 * @param paint describes how to color pixels.
452 * @param GrGrAA Controls whether the arc is antialiased.
453 * @param viewMatrix transformation matrix.
454 * @param oval the bounding rect of the oval.
455 * @param startAngle starting angle in degrees.
456 * @param sweepAngle angle to sweep in degrees. Must be in (-360, 360)
457 * @param useCenter true means that the implied path begins at the oval center, connects as
458 * a line to the point indicated by the start contains the arc indicated by
459 * the sweep angle. If false the line beginning at the center point is
460 * omitted.
461 * @param style style to apply to the oval.
462 */
463 void drawArc(const GrClip*,
464 GrPaint&& paint,
465 GrAA,
466 const SkMatrix& viewMatrix,
467 const SkRect& oval,
468 SkScalar startAngle,
469 SkScalar sweepAngle,
470 bool useCenter,
471 const GrStyle& style);
472
473 /**
474 * Draw the image as a set of rects, specified by |iter|.
475 */
476 void drawImageLattice(const GrClip*,
477 GrPaint&&,
478 const SkMatrix& viewMatrix,
480 SkAlphaType alphaType,
483 std::unique_ptr<SkLatticeIter>,
484 const SkRect& dst);
485
486 /**
487 * Draw the text specified by the GlyphRunList.
488 *
489 * @param viewMatrix transformation matrix
490 * @param glyphRunList text, text positions, and paint.
491 */
493 const GrClip*,
494 const SkMatrix& viewMatrix,
495 const sktext::GlyphRunList& glyphRunList,
496 SkStrikeDeviceInfo strikeDeviceInfo,
497 const SkPaint& paint);
498
499 /**
500 * Adds the necessary signal and wait semaphores and adds the passed in SkDrawable to the
501 * command stream.
502 */
503 void drawDrawable(std::unique_ptr<SkDrawable::GpuDrawHandler>, const SkRect& bounds);
504
505 // called to note the last clip drawn to the stencil buffer.
506 // TODO: remove after clipping overhaul.
507 void setLastClip(uint32_t clipStackGenID,
508 const SkIRect& devClipBounds,
509 int numClipAnalyticElements);
510
511 // called to determine if we have to render the clip into SB.
512 // TODO: remove after clipping overhaul.
513 bool mustRenderClip(uint32_t clipStackGenID,
514 const SkIRect& devClipBounds,
515 int numClipAnalyticElements);
516
517 void clearStencilClip(const SkIRect& scissor, bool insideStencilMask) {
518 this->internalStencilClear(&scissor, insideStencilMask);
519 }
520
521 // While this can take a general clip, since ClipStack relies on this function, it must take
522 // care to only provide hard clips or we could get stuck in a loop. The general clip is needed
523 // so that path renderers can use this function.
525 const GrUserStencilSettings* ss,
526 GrPaint&& paint,
527 GrAA doStencilMSAA,
528 const SkMatrix& viewMatrix,
529 const SkRect& rect,
530 const SkMatrix* localMatrix = nullptr) {
531 // Since this provides stencil settings to drawFilledQuad, it performs a different AA type
532 // resolution compared to regular rect draws, which is the main reason it remains separate.
533 DrawQuad quad{GrQuad::MakeFromRect(rect, viewMatrix),
534 localMatrix ? GrQuad::MakeFromRect(rect, *localMatrix) : GrQuad(rect),
536 this->drawFilledQuad(clip, std::move(paint), &quad, ss);
537 }
538
539 // Fills the user stencil bits with a non-zero value at every sample inside the path. This will
540 // likely be implemented with a Redbook algorithm, but it is not guaranteed. The samples being
541 // rendered to must be zero initially.
542 bool stencilPath(const GrHardClip*,
543 GrAA doStencilMSAA,
544 const SkMatrix& viewMatrix,
545 const SkPath&);
546
547 /**
548 * Draws a path, either AA or not, and touches the stencil buffer with the user stencil settings
549 * for each color sample written.
550 */
551 bool drawAndStencilPath(const GrHardClip*,
553 SkRegion::Op op,
554 bool invert,
555 GrAA doStencilMSAA,
556 const SkMatrix& viewMatrix,
557 const SkPath&);
558
560
561 int maxWindowRectangles() const;
562
563 /*
564 * This unique ID will not change for a given SurfaceDrawContext. However, it is _NOT_
565 * guaranteed to match the uniqueID of the underlying GrRenderTarget - beware!
566 */
568
569 // Allows caller of addDrawOp to know which op list an op will be added to.
570 using WillAddOpFn = void(GrOp*, uint32_t opsTaskID);
571 // These perform processing specific to GrDrawOp-derived ops before recording them into an
572 // op list. Before adding the op to an op list the WillAddOpFn is called. Note that it
573 // will not be called in the event that the op is discarded. Moreover, the op may merge into
574 // another op after the function is called (either before addDrawOp returns or some time later).
575 //
576 // If the clip pointer is null, no clipping will be performed.
577 void addDrawOp(const GrClip*,
579 const std::function<WillAddOpFn>& = std::function<WillAddOpFn>());
580 void addDrawOp(GrOp::Owner op) { this->addDrawOp(nullptr, std::move(op)); }
581
583
584 /**
585 * The next time this SurfaceDrawContext is flushed, the gpu will wait on the passed in
586 * semaphores before executing any commands.
587 */
588 bool waitOnSemaphores(int numSemaphores, const GrBackendSemaphore waitSemaphores[],
589 bool deleteSemaphoresAfterWait);
590
591 int numSamples() const { return this->asRenderTargetProxy()->numSamples(); }
592 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
593 bool canUseDynamicMSAA() const { return fCanUseDynamicMSAA; }
595
596 bool alwaysAntialias() const {
597 return fSurfaceProps.flags() & SkSurfaceProps::kDynamicMSAA_Flag;
598 }
599
601 return GrAA(paint.isAntiAlias() || this->alwaysAntialias());
602 }
603
605 if (this->numSamples() > 1 || fCanUseDynamicMSAA) {
606 // Always trigger DMSAA when it's available. The coverage ops that know how to handle
607 // both single and multisample targets without popping will do so without calling
608 // chooseAAType.
609 return GrAAType::kMSAA;
610 }
612 }
613
614 // This entry point should only be called if the backing GPU object is known to be
615 // instantiated.
617
618#if defined(GR_TEST_UTILS)
619 void testingOnly_SetPreserveOpsOnFullClear() { fPreserveOpsOnFullClear_TestingOnly = true; }
620#endif
621
622 void drawStrokedLine(const GrClip*, GrPaint&&, GrAA, const SkMatrix&, const SkPoint[2],
623 const SkStrokeRec&);
624
625private:
626 enum class QuadOptimization;
627
628 void willReplaceOpsTask(OpsTask* prevTask, OpsTask* nextTask) override;
629
631 void setNeedsStencil();
632
633 void internalStencilClear(const SkIRect* scissor, bool insideStencilMask);
634
635 // 'stencilSettings' are provided merely for decision making purposes; When non-null,
636 // optimization strategies that submit special ops are avoided.
637 //
638 // 'quad' should be the original draw request on input, and will be updated as
639 // appropriate depending on the returned optimization level.
640 //
641 // If kSubmitted is returned, the provided paint was consumed. Otherwise it is left unchanged.
642 QuadOptimization attemptQuadOptimization(const GrClip* clip,
643 const GrUserStencilSettings* stencilSettings,
644 DrawQuad* quad,
645 GrPaint* paint);
646
647 // The overall AA policy is determined by the quad's edge flags: kNone is no AA, and anything
648 // else uses some form of anti-aliasing. If 'ss' is non-null, that will be MSAA; otherwise it's
649 // MSAA or analytic coverage per chooseAAType(). This will always attempt to apply
650 // quad optimizations, so all quad/rect public APIs should rely on this function for consistent
651 // clipping behavior. 'quad' will be modified in place to reflect final rendered geometry.
652 void drawFilledQuad(const GrClip* clip,
653 GrPaint&& paint,
654 DrawQuad* quad,
655 const GrUserStencilSettings* ss = nullptr);
656
657 // Like drawFilledQuad but does not require using a GrPaint or FP for texturing.
658 // 'quad' may be modified in place to reflect final geometry.
659 void drawTexturedQuad(const GrClip* clip,
660 GrSurfaceProxyView proxyView,
661 SkAlphaType alphaType,
662 sk_sp<GrColorSpaceXform> textureXform,
665 const SkPMColor4f& color,
666 SkBlendMode blendMode,
667 DrawQuad* quad,
668 const SkRect* subset = nullptr);
669
670 // Tries to detect if the given shape is a simple, and draws it without path rendering if
671 // we know how.
672 bool drawSimpleShape(const GrClip*, GrPaint*, GrAA, const SkMatrix&, const GrStyledShape&);
673
674 // If 'attemptDrawSimple' is true, of if the original shape is marked as having been simplfied,
675 // this will attempt to re-route through drawSimpleShape() to see if we can avoid path rendering
676 // one more time.
677 void drawShapeUsingPathRenderer(const GrClip*, GrPaint&&, GrAA, const SkMatrix&,
678 GrStyledShape&&, bool attemptDrawSimple = false);
679
680 // Makes a copy of the proxy if it is necessary for the draw and places the texture that should
681 // be used by GrXferProcessor to access the destination color in 'result'. If the return
682 // value is false then a texture copy could not be made.
683 //
684 // The op should have already had setClippedBounds called on it.
685 [[nodiscard]] bool setupDstProxyView(const SkRect& opBounds,
686 bool opRequiresMSAA,
688
689 OpsTask* replaceOpsTaskIfModifiesColor();
690
691 const SkSurfaceProps fSurfaceProps;
692 const bool fCanUseDynamicMSAA;
693
694 bool fNeedsStencil = false;
695
696#if defined(GR_TEST_UTILS)
697 bool fPreserveOpsOnFullClear_TestingOnly = false;
698#endif
699};
700
701} // namespace skgpu::ganesh
702
703#endif // SurfaceDrawContext_v1_DEFINED
GrQuadAAFlags
GrPrimitiveType
Definition GrTypesPriv.h:42
GrAAType
GrAA
GrColorType
GrSurfaceOrigin
Definition GrTypes.h:147
@ kBottomLeft_GrSurfaceOrigin
Definition GrTypes.h:149
static const int points[]
SkColor4f color
SkAlphaType
Definition SkAlphaType.h:26
SkBackingFit
SkBlendMode
Definition SkBlendMode.h:38
uint32_t SkColor
Definition SkColor.h:37
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
SkFilterMode
SkMipmapMode
Definition GrOp.h:70
std::unique_ptr< GrOp > Owner
Definition GrOp.h:72
static GrQuad MakeFromRect(const SkRect &, const SkMatrix &)
Definition GrQuad.cpp:107
static GrQuad MakeFromSkQuad(const SkPoint pts[4], const SkMatrix &)
Definition GrQuad.cpp:122
bool wrapsVkSecondaryCB() const
UniqueID uniqueID() const
GrRenderTarget * peekRenderTarget() const
SrcRectConstraint
Definition SkCanvas.h:1541
static const SkMatrix & I()
uint32_t flags() const
GrSurfaceProxy * asSurfaceProxy()
GrRenderTargetProxy * asRenderTargetProxy()
skgpu::Swizzle readSwizzle() const
void willReplaceOpsTask(OpsTask *prevTask, OpsTask *nextTask) override
bool stencilPath(const GrHardClip *, GrAA doStencilMSAA, const SkMatrix &viewMatrix, const SkPath &)
void clearStencilClip(const SkIRect &scissor, bool insideStencilMask)
bool drawFastShadow(const GrClip *, const SkMatrix &viewMatrix, const SkPath &path, const SkDrawShadowRec &rec)
void drawOval(const GrClip *, GrPaint &&paint, GrAA, const SkMatrix &viewMatrix, const SkRect &oval, const GrStyle &style)
void fillQuadWithEdgeAA(const GrClip *clip, GrPaint &&paint, GrQuadAAFlags edgeAA, const SkMatrix &viewMatrix, const SkPoint points[4], const SkPoint optionalLocalPoints[4])
void(GrOp *, uint32_t opsTaskID) WillAddOpFn
void fillPixelsWithLocalMatrix(const GrClip *clip, GrPaint &&paint, const SkIRect &bounds, const SkMatrix &localMatrix)
void drawShape(const GrClip *, GrPaint &&, GrAA, const SkMatrix &viewMatrix, GrStyledShape &&)
void fillRectWithEdgeAA(const GrClip *clip, GrPaint &&paint, GrQuadAAFlags edgeAA, const SkMatrix &viewMatrix, const SkRect &rect, const SkRect *optionalLocalRect=nullptr)
void drawDrawable(std::unique_ptr< SkDrawable::GpuDrawHandler >, const SkRect &bounds)
void drawAtlas(const GrClip *, GrPaint &&paint, const SkMatrix &viewMatrix, int spriteCount, const SkRSXform xform[], const SkRect texRect[], const SkColor colors[])
GrSurfaceProxy::UniqueID uniqueID() const
void drawTextureSet(const GrClip *, GrTextureSetEntry[], int cnt, int proxyRunCnt, GrSamplerState::Filter, GrSamplerState::MipmapMode, SkBlendMode mode, SkCanvas::SrcRectConstraint, const SkMatrix &viewMatrix, sk_sp< GrColorSpaceXform > texXform)
void setLastClip(uint32_t clipStackGenID, const SkIRect &devClipBounds, int numClipAnalyticElements)
void drawMesh(const GrClip *, GrPaint &&paint, const SkMatrix &viewMatrix, const SkMesh &mesh, skia_private::TArray< std::unique_ptr< GrFragmentProcessor > > children)
void drawArc(const GrClip *, GrPaint &&paint, GrAA, const SkMatrix &viewMatrix, const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const GrStyle &style)
void addDrawOp(const GrClip *, GrOp::Owner, const std::function< WillAddOpFn > &=std::function< WillAddOpFn >())
bool waitOnSemaphores(int numSemaphores, const GrBackendSemaphore waitSemaphores[], bool deleteSemaphoresAfterWait)
void drawQuadSet(const GrClip *clip, GrPaint &&paint, const SkMatrix &viewMatrix, const GrQuadSetEntry[], int cnt)
void drawImageLattice(const GrClip *, GrPaint &&, const SkMatrix &viewMatrix, GrSurfaceProxyView, SkAlphaType alphaType, sk_sp< GrColorSpaceXform >, GrSamplerState::Filter, std::unique_ptr< SkLatticeIter >, const SkRect &dst)
void drawPath(const GrClip *, GrPaint &&, GrAA, const SkMatrix &viewMatrix, const SkPath &, const GrStyle &)
bool drawAndStencilPath(const GrHardClip *, const GrUserStencilSettings *, SkRegion::Op op, bool invert, GrAA doStencilMSAA, const SkMatrix &viewMatrix, const SkPath &)
bool mustRenderClip(uint32_t clipStackGenID, const SkIRect &devClipBounds, int numClipAnalyticElements)
void drawTextureQuad(const GrClip *clip, GrSurfaceProxyView view, GrColorType srcColorType, SkAlphaType srcAlphaType, GrSamplerState::Filter filter, GrSamplerState::MipmapMode mm, SkBlendMode mode, const SkPMColor4f &color, const SkPoint srcQuad[4], const SkPoint dstQuad[4], GrQuadAAFlags edgeAA, const SkRect *subset, const SkMatrix &viewMatrix, sk_sp< GrColorSpaceXform > texXform)
void drawRRect(const GrClip *, GrPaint &&, GrAA, const SkMatrix &viewMatrix, const SkRRect &rrect, const GrStyle &style)
void drawPaint(const GrClip *, GrPaint &&, const SkMatrix &viewMatrix)
void drawRegion(const GrClip *, GrPaint &&paint, GrAA aa, const SkMatrix &viewMatrix, const SkRegion &region, const GrStyle &style, const GrUserStencilSettings *ss=nullptr)
static std::unique_ptr< SurfaceDrawContext > MakeFromBackendTexture(GrRecordingContext *, GrColorType, sk_sp< SkColorSpace >, const GrBackendTexture &, int sampleCnt, GrSurfaceOrigin, const SkSurfaceProps &, sk_sp< skgpu::RefCntedCallback > releaseHelper)
GrAA chooseAA(const SkPaint &paint)
void stencilRect(const GrClip *clip, const GrUserStencilSettings *ss, GrPaint &&paint, GrAA doStencilMSAA, const SkMatrix &viewMatrix, const SkRect &rect, const SkMatrix *localMatrix=nullptr)
const SkSurfaceProps & surfaceProps() const
OpsTask::CanDiscardPreviousOps canDiscardPreviousOpsOnFullClear() const override
static std::unique_ptr< SurfaceDrawContext > Make(GrRecordingContext *, GrColorType, sk_sp< GrSurfaceProxy >, sk_sp< SkColorSpace >, GrSurfaceOrigin, const SkSurfaceProps &)
void drawRect(const GrClip *, GrPaint &&paint, GrAA, const SkMatrix &viewMatrix, const SkRect &, const GrStyle *style=nullptr)
static std::unique_ptr< SurfaceDrawContext > MakeWithFallback(GrRecordingContext *, GrColorType, sk_sp< SkColorSpace >, SkBackingFit, SkISize dimensions, const SkSurfaceProps &, int sampleCnt, skgpu::Mipmapped, skgpu::Protected, GrSurfaceOrigin=kBottomLeft_GrSurfaceOrigin, skgpu::Budgeted=skgpu::Budgeted::kYes)
void drawGlyphRunList(SkCanvas *, const GrClip *, const SkMatrix &viewMatrix, const sktext::GlyphRunList &glyphRunList, SkStrikeDeviceInfo strikeDeviceInfo, const SkPaint &paint)
void fillRectToRect(const GrClip *, GrPaint &&, GrAA, const SkMatrix &, const SkRect &rectToDraw, const SkRect &localRect)
void drawVertices(const GrClip *, GrPaint &&paint, const SkMatrix &viewMatrix, sk_sp< SkVertices > vertices, GrPrimitiveType *overridePrimType=nullptr, bool skipColorXform=false)
void drawTexture(const GrClip *, GrSurfaceProxyView, SkAlphaType, GrSamplerState::Filter, GrSamplerState::MipmapMode, SkBlendMode, const SkPMColor4f &, const SkRect &srcRect, const SkRect &dstRect, GrQuadAAFlags, SkCanvas::SrcRectConstraint, const SkMatrix &, sk_sp< GrColorSpaceXform >)
void drawStrokedLine(const GrClip *, GrPaint &&, GrAA, const SkMatrix &, const SkPoint[2], const SkStrokeRec &)
const Paint & paint
float SkScalar
Definition extension.cpp:12
gboolean invert
GAsyncResult * result
Budgeted
Definition GpuTypes.h:35
Mipmapped
Definition GpuTypes.h:53
Protected
Definition GpuTypes.h:61
static SkRect Make(const SkISize &size)
Definition SkRect.h:669