Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
DebugTileRenderer Class Reference
Inheritance diagram for DebugTileRenderer:
ClipTileRenderer SkRefCntBase

Public Member Functions

int drawTile (SkCanvas *canvas, const SkRect &rect, const SkPoint clip[4], const bool edgeAA[4], int tileID, int quadID) override
 
void drawBanner (SkCanvas *canvas) override
 
- Public Member Functions inherited from ClipTileRenderer
virtual int drawTile (SkCanvas *canvas, const SkRect &rect, const SkPoint clip[4], const bool edgeAA[4], int tileID, int quadID)=0
 
virtual void drawBanner (SkCanvas *canvas)=0
 
virtual int drawTiles (SkCanvas *canvas)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< ClipTileRendererMake ()
 
static sk_sp< ClipTileRendererMakeAA ()
 
static sk_sp< ClipTileRendererMakeNonAA ()
 

Additional Inherited Members

- Protected Member Functions inherited from ClipTileRenderer
SkCanvas::QuadAAFlags maskToFlags (const bool edgeAA[4]) const
 
int clipTile (SkCanvas *canvas, int tileID, const SkRect &baseRect, const SkPoint quad[4], const bool edgeAA[4], const SkPoint lines[], int lineCount, int *quadCount)
 

Detailed Description

Definition at line 554 of file compositor_quads.cpp.

Member Function Documentation

◆ drawBanner()

void DebugTileRenderer::drawBanner ( SkCanvas canvas)
inlineoverridevirtual

Implements ClipTileRenderer.

Definition at line 589 of file compositor_quads.cpp.

589 {
590 draw_text(canvas, "Edge AA");
591 canvas->translate(0.f, 15.f);
592
593 SkString config;
594 constexpr char kFormat[] = "Ext(%s) - Int(%s)";
595 if (fEnableAAOverride) {
596 SkASSERT(fAAOverride == SkCanvas::kAll_QuadAAFlags ||
597 fAAOverride == SkCanvas::kNone_QuadAAFlags);
598 if (fAAOverride == SkCanvas::kAll_QuadAAFlags) {
599 config.appendf(kFormat, "yes", "yes");
600 } else {
601 config.appendf(kFormat, "no", "no");
602 }
603 } else {
604 config.appendf(kFormat, "yes", "no");
605 }
606 draw_text(canvas, config.c_str());
607 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
@ kNone_QuadAAFlags
Definition: SkCanvas.h:1664
@ kAll_QuadAAFlags
Definition: SkCanvas.h:1665
const char * c_str() const
Definition: SkString.h:133
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:550
static void draw_text(SkCanvas *canvas, const char *text)

◆ drawTile()

int DebugTileRenderer::drawTile ( SkCanvas canvas,
const SkRect rect,
const SkPoint  clip[4],
const bool  edgeAA[4],
int  tileID,
int  quadID 
)
inlineoverridevirtual

Implements ClipTileRenderer.

Definition at line 570 of file compositor_quads.cpp.

571 {
572 // Colorize the tile based on its grid position and quad ID
573 int i = tileID / kColCount;
574 int j = tileID % kColCount;
575
576 SkColor4f c = {(i + 1.f) / kRowCount, (j + 1.f) / kColCount, .4f, 1.f};
577 float alpha = quadID / 10.f;
578 c.fR = c.fR * (1 - alpha) + alpha;
579 c.fG = c.fG * (1 - alpha) + alpha;
580 c.fB = c.fB * (1 - alpha) + alpha;
581 c.fA = c.fA * (1 - alpha) + alpha;
582
583 SkCanvas::QuadAAFlags aaFlags = fEnableAAOverride ? fAAOverride : this->maskToFlags(edgeAA);
585 rect, clip, aaFlags, c.toSkColor(), SkBlendMode::kSrcOver);
586 return 1;
587 }
@ kSrcOver
r = s + (1-sa)*d
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
SkCanvas::QuadAAFlags maskToFlags(const bool edgeAA[4]) const
void experimental_DrawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
Definition: SkCanvas.cpp:1845
static constexpr int kRowCount
static constexpr int kColCount
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ Make()

static sk_sp< ClipTileRenderer > DebugTileRenderer::Make ( )
inlinestatic

Definition at line 557 of file compositor_quads.cpp.

557 {
558 // Since aa override is disabled, the quad flags arg doesn't matter.
560 }

◆ MakeAA()

static sk_sp< ClipTileRenderer > DebugTileRenderer::MakeAA ( )
inlinestatic

Definition at line 562 of file compositor_quads.cpp.

◆ MakeNonAA()

static sk_sp< ClipTileRenderer > DebugTileRenderer::MakeNonAA ( )
inlinestatic

Definition at line 566 of file compositor_quads.cpp.


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