Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::testing::SkJobRenderer Struct Reference
Inheritance diagram for flutter::testing::SkJobRenderer:
flutter::testing::MatrixClipJobRenderer flutter::testing::JobRenderer

Public Member Functions

 SkJobRenderer (const SkSetup &sk_setup, const SkRenderer &sk_render, const SkRenderer &sk_restore, const sk_sp< SkImage > &sk_image)
 
void Render (SkCanvas *canvas, const RenderJobInfo &info) override
 
sk_sp< SkPictureMakePicture (const RenderJobInfo &info)
 
const SkPaintsetup_paint () const
 
- Public Member Functions inherited from flutter::testing::MatrixClipJobRenderer
const SkMatrixsetup_matrix () const
 
const SkIRectsetup_clip_bounds () const
 
- Public Member Functions inherited from flutter::testing::JobRenderer
virtual void Render (SkCanvas *canvas, const RenderJobInfo &info)=0
 
virtual bool targets_impeller () const
 

Additional Inherited Members

- Protected Attributes inherited from flutter::testing::MatrixClipJobRenderer
bool is_setup_ = false
 
SkMatrix setup_matrix_
 
SkIRect setup_clip_bounds_
 

Detailed Description

Definition at line 467 of file dl_rendering_unittests.cc.

Constructor & Destructor Documentation

◆ SkJobRenderer()

flutter::testing::SkJobRenderer::SkJobRenderer ( const SkSetup sk_setup,
const SkRenderer sk_render,
const SkRenderer sk_restore,
const sk_sp< SkImage > &  sk_image 
)
inlineexplicit

Definition at line 468 of file dl_rendering_unittests.cc.

472 : sk_setup_(sk_setup),
473 sk_render_(sk_render),
474 sk_restore_(sk_restore),
475 sk_image_(sk_image) {}

Member Function Documentation

◆ MakePicture()

sk_sp< SkPicture > flutter::testing::SkJobRenderer::MakePicture ( const RenderJobInfo info)
inline

Definition at line 489 of file dl_rendering_unittests.cc.

489 {
490 SkPictureRecorder recorder;
491 SkRTreeFactory rtree_factory;
492 SkCanvas* cv = recorder.beginRecording(kTestBounds2, &rtree_factory);
493 Render(cv, info);
494 return recorder.finishRecordingAsPicture();
495 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
constexpr SkRect kTestBounds2
void Render(SkCanvas *canvas, const RenderJobInfo &info) override

◆ Render()

void flutter::testing::SkJobRenderer::Render ( SkCanvas canvas,
const RenderJobInfo info 
)
inlineoverridevirtual

Implements flutter::testing::JobRenderer.

Definition at line 477 of file dl_rendering_unittests.cc.

477 {
478 FML_DCHECK(info.opacity == SK_Scalar1);
480 sk_setup_({canvas, paint, sk_image_});
481 setup_paint_ = paint;
482 setup_matrix_ = canvas->getTotalMatrix();
484 is_setup_ = true;
485 sk_render_({canvas, paint, sk_image_});
486 sk_restore_({canvas, paint, sk_image_});
487 }
#define SK_Scalar1
Definition: SkScalar.h:18
SkMatrix getTotalMatrix() const
Definition: SkCanvas.cpp:1629
SkIRect getDeviceClipBounds() const
Definition: SkCanvas.cpp:1607
const Paint & paint
Definition: color_source.cc:38
#define FML_DCHECK(condition)
Definition: logging.h:103

◆ setup_paint()

const SkPaint & flutter::testing::SkJobRenderer::setup_paint ( ) const
inline

Definition at line 497 of file dl_rendering_unittests.cc.

497 {
499 return setup_paint_;
500 }
#define FML_CHECK(condition)
Definition: logging.h:85

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