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

Public Member Functions

int drawTiles (SkCanvas *canvas) override
 
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
 
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< ClipTileRendererMakeFromJPEG (sk_sp< SkData > imageData)
 

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 895 of file compositor_quads.cpp.

Member Function Documentation

◆ drawBanner()

void YUVTextureSetRenderer::drawBanner ( SkCanvas canvas)
inlineoverridevirtual

Implements ClipTileRenderer.

Definition at line 943 of file compositor_quads.cpp.

943 {
944 draw_text(canvas, "Texture");
945 canvas->translate(0.f, 15.f);
946 draw_text(canvas, "YUV + alpha - GPU Only");
947 }
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
static void draw_text(SkCanvas *canvas, const char *text)

◆ drawTile()

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

Implements ClipTileRenderer.

Definition at line 917 of file compositor_quads.cpp.

918 {
919 SkASSERT(fImage);
920 // Now don't actually draw the tile, accumulate it in the growing entry set
921 bool hasClip = false;
922 if (clip) {
923 // Record the four points into fDstClips
924 fDstClips.push_back_n(4, clip);
925 hasClip = true;
926 }
927
928 // This acts like the whole image is rendered over the entire tile grid, so derive local
929 // coordinates from 'rect', based on the grid to image transform.
932 SkRect::MakeWH(fImage->width(),
933 fImage->height()));
934 SkRect localRect = gridToImage.mapRect(rect);
935
936 // drawTextureSet automatically derives appropriate local quad from localRect if clipPtr
937 // is not null. Also exercise per-entry alpha combined with YUVA images.
938 fSetEntries.push_back(
939 {fImage, localRect, rect, -1, .5f, this->maskToFlags(edgeAA), hasClip});
940 return 0;
941 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
SkCanvas::QuadAAFlags maskToFlags(const bool edgeAA[4]) const
int width() const
Definition: SkImage.h:285
int height() const
Definition: SkImage.h:291
static SkMatrix RectToRect(const SkRect &src, const SkRect &dst, ScaleToFit mode=kFill_ScaleToFit)
Definition: SkMatrix.h:157
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
Definition: SkMatrix.cpp:1141
T * push_back_n(int n)
Definition: SkTArray.h:267
static constexpr SkScalar kTileHeight
static constexpr SkScalar kTileWidth
static constexpr int kRowCount
static constexpr int kColCount
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
static constexpr SkRect MakeWH(float w, float h)
Definition: SkRect.h:609

◆ drawTiles()

int YUVTextureSetRenderer::drawTiles ( SkCanvas canvas)
inlineoverridevirtual

Reimplemented from ClipTileRenderer.

Definition at line 901 of file compositor_quads.cpp.

901 {
902 // Refresh the SkImage at the start, so that it's not attempted for every set entry
903 if (fYUVData) {
904 fImage = fYUVData->refImage(canvas->recordingContext(),
906 if (!fImage) {
907 return 0;
908 }
909 }
910
911 int draws = this->INHERITED::drawTiles(canvas);
912 // Push the last tile set
913 draws += this->drawAndReset(canvas);
914 return draws;
915 }
virtual int drawTiles(SkCanvas *canvas)
virtual GrRecordingContext * recordingContext() const
Definition: SkCanvas.cpp:1637

◆ MakeFromJPEG()

static sk_sp< ClipTileRenderer > YUVTextureSetRenderer::MakeFromJPEG ( sk_sp< SkData imageData)
inlinestatic

Definition at line 897 of file compositor_quads.cpp.


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