Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkJpegMemorySourceMgr Class Reference
Inheritance diagram for SkJpegMemorySourceMgr:
SkJpegSourceMgr

Public Member Functions

 SkJpegMemorySourceMgr (SkStream *stream)
 
 ~SkJpegMemorySourceMgr () override
 
void initSource (const uint8_t *&nextInputByte, size_t &bytesInBuffer) override
 
bool fillInputBuffer (const uint8_t *&nextInputByte, size_t &bytesInBuffer) override
 
bool skipInputBytes (size_t bytesToSkip, const uint8_t *&nextInputByte, size_t &bytesInBuffer) override
 
- Public Member Functions inherited from SkJpegSourceMgr
virtual ~SkJpegSourceMgr ()
 
virtual void initSource (const uint8_t *&nextInputByte, size_t &bytesInBuffer)=0
 
virtual bool fillInputBuffer (const uint8_t *&nextInputByte, size_t &bytesInBuffer)=0
 
virtual bool skipInputBytes (size_t bytes, const uint8_t *&nextInputByte, size_t &bytesInBuffer)=0
 

Additional Inherited Members

- Static Public Member Functions inherited from SkJpegSourceMgr
static std::unique_ptr< SkJpegSourceMgrMake (SkStream *stream, size_t bufferSize=1024)
 
- Protected Member Functions inherited from SkJpegSourceMgr
 SkJpegSourceMgr (SkStream *stream)
 
- Protected Attributes inherited from SkJpegSourceMgr
SkStream *const fStream
 

Detailed Description

Definition at line 51 of file SkJpegSourceMgr.cpp.

Constructor & Destructor Documentation

◆ SkJpegMemorySourceMgr()

SkJpegMemorySourceMgr::SkJpegMemorySourceMgr ( SkStream stream)
inline

Definition at line 53 of file SkJpegSourceMgr.cpp.

◆ ~SkJpegMemorySourceMgr()

SkJpegMemorySourceMgr::~SkJpegMemorySourceMgr ( )
inlineoverride

Definition at line 54 of file SkJpegSourceMgr.cpp.

54{}

Member Function Documentation

◆ fillInputBuffer()

bool SkJpegMemorySourceMgr::fillInputBuffer ( const uint8_t *&  nextInputByte,
size_t &  bytesInBuffer 
)
inlineoverridevirtual

Implements SkJpegSourceMgr.

Definition at line 60 of file SkJpegSourceMgr.cpp.

60 {
61 // The whole JPEG data is expected to reside in the supplied memory buffer, so any request
62 // for more data beyond the given buffer size is treated as an error.
63 SkCodecPrintf("Asked to re-fill a memory-mapped stream.\n");
64 return false;
65 }
#define SkCodecPrintf(...)
Definition: SkCodecPriv.h:23

◆ initSource()

void SkJpegMemorySourceMgr::initSource ( const uint8_t *&  nextInputByte,
size_t &  bytesInBuffer 
)
inlineoverridevirtual

Implements SkJpegSourceMgr.

Definition at line 56 of file SkJpegSourceMgr.cpp.

56 {
57 nextInputByte = reinterpret_cast<const uint8_t*>(fStream->getMemoryBase());
58 bytesInBuffer = static_cast<size_t>(fStream->getLength());
59 }
SkStream *const fStream
virtual size_t getLength() const
Definition: SkStream.h:137
virtual const void * getMemoryBase()
Definition: SkStream.h:141

◆ skipInputBytes()

bool SkJpegMemorySourceMgr::skipInputBytes ( size_t  bytesToSkip,
const uint8_t *&  nextInputByte,
size_t &  bytesInBuffer 
)
inlineoverridevirtual

Implements SkJpegSourceMgr.

Definition at line 66 of file SkJpegSourceMgr.cpp.

68 {
69 if (bytesToSkip > bytesInBuffer) {
70 SkCodecPrintf("Asked to read past end of a memory-mapped stream.\n");
71 return false;
72 }
73 nextInputByte += bytesToSkip;
74 bytesInBuffer -= bytesToSkip;
75 return true;
76 }

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