Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
flutter::testing::SkRenderResult Class Referencefinal
Inheritance diagram for flutter::testing::SkRenderResult:
flutter::testing::RenderResult

Public Member Functions

 SkRenderResult (const sk_sp< SkSurface > &surface, bool take_snapshot=false)
 
 ~SkRenderResult () override
 
sk_sp< SkImageimage () const override
 
int width () const override
 
int height () const override
 
const uint32_t * addr32 (int x, int y) const override
 
void write (const std::string &path) const
 
- Public Member Functions inherited from flutter::testing::RenderResult
virtual ~RenderResult ()=default
 
virtual sk_sp< SkImageimage () const =0
 
virtual int width () const =0
 
virtual int height () const =0
 
virtual const uint32_t * addr32 (int x, int y) const =0
 
virtual void write (const std::string &path) const =0
 

Detailed Description

Definition at line 379 of file dl_rendering_unittests.cc.

Constructor & Destructor Documentation

◆ SkRenderResult()

flutter::testing::SkRenderResult::SkRenderResult ( const sk_sp< SkSurface > &  surface,
bool  take_snapshot = false 
)
inlineexplicit

Definition at line 381 of file dl_rendering_unittests.cc.

382 {
383 SkImageInfo info = surface->imageInfo();
384 info = SkImageInfo::MakeN32Premul(info.dimensions());
385 addr_ = malloc(info.computeMinByteSize() * info.height());
386 pixmap_.reset(info, addr_, info.minRowBytes());
387 surface->readPixels(pixmap_, 0, 0);
388 if (take_snapshot) {
389 image_ = surface->makeImageSnapshot();
390 }
391 }
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
void reset()
Definition: SkPixmap.cpp:32
VkSurfaceKHR surface
Definition: main.cc:49
void * malloc(size_t size)
Definition: allocation.cc:19
static SkImageInfo MakeN32Premul(int width, int height)

◆ ~SkRenderResult()

flutter::testing::SkRenderResult::~SkRenderResult ( )
inlineoverride

Definition at line 392 of file dl_rendering_unittests.cc.

392{ free(addr_); }

Member Function Documentation

◆ addr32()

const uint32_t * flutter::testing::SkRenderResult::addr32 ( int  x,
int  y 
) const
inlineoverridevirtual

Implements flutter::testing::RenderResult.

Definition at line 397 of file dl_rendering_unittests.cc.

397 {
398 return pixmap_.addr32(x, y);
399 }
const uint32_t * addr32() const
Definition: SkPixmap.h:352
double y
double x

◆ height()

int flutter::testing::SkRenderResult::height ( ) const
inlineoverridevirtual

Implements flutter::testing::RenderResult.

Definition at line 396 of file dl_rendering_unittests.cc.

396{ return pixmap_.height(); }
int height() const
Definition: SkPixmap.h:166

◆ image()

sk_sp< SkImage > flutter::testing::SkRenderResult::image ( ) const
inlineoverridevirtual

Implements flutter::testing::RenderResult.

Definition at line 394 of file dl_rendering_unittests.cc.

394{ return image_; }

◆ width()

int flutter::testing::SkRenderResult::width ( ) const
inlineoverridevirtual

Implements flutter::testing::RenderResult.

Definition at line 395 of file dl_rendering_unittests.cc.

395{ return pixmap_.width(); }
int width() const
Definition: SkPixmap.h:160

◆ write()

void flutter::testing::SkRenderResult::write ( const std::string &  path) const
inlinevirtual

Implements flutter::testing::RenderResult.

Definition at line 400 of file dl_rendering_unittests.cc.

400 {
401 auto stream = SkFILEWStream(path.c_str());
404 stream.flush();
405 }
const char * options
SK_API bool Encode(SkWStream *dst, const SkPixmap &src, const Options &options)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

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