Definition at line 244 of file SkRawCodec.cpp.
◆ SkRawBufferedStream()
SkRawBufferedStream::SkRawBufferedStream |
( |
std::unique_ptr< SkStream > |
stream | ) |
|
|
inlineexplicit |
Definition at line 246 of file SkRawCodec.cpp.
247 : fStream(std::move(
stream))
248 , fWholeStreamRead(false)
249 {
250
251 SkASSERT(!is_asset_stream(*fStream));
252 }
◆ ~SkRawBufferedStream()
SkRawBufferedStream::~SkRawBufferedStream |
( |
| ) |
|
|
inlineoverride |
◆ getLength()
uint64 SkRawBufferedStream::getLength |
( |
| ) |
|
|
inlineoverridevirtual |
Implements SkRawStream.
Definition at line 256 of file SkRawCodec.cpp.
256 {
257 if (!this->bufferMoreData(kReadToEnd)) {
258 ThrowReadFile();
259 }
261 }
size_t bytesWritten() const override
◆ read()
bool SkRawBufferedStream::read |
( |
void * |
data, |
|
|
size_t |
offset, |
|
|
size_t |
length |
|
) |
| |
|
inlineoverridevirtual |
Implements SkRawStream.
Definition at line 263 of file SkRawCodec.cpp.
263 {
265 return true;
266 }
267
268 size_t sum;
270 return false;
271 }
272
274 }
bool read(void *buffer, size_t offset, size_t size)
std::shared_ptr< const fml::Mapping > data
◆ transferBuffer()
std::unique_ptr< SkMemoryStream > SkRawBufferedStream::transferBuffer |
( |
size_t |
offset, |
|
|
size_t |
size |
|
) |
| |
|
inlineoverridevirtual |
Implements SkRawStream.
Definition at line 276 of file SkRawCodec.cpp.
276 {
279
281 if (fStream->skip(skipLength) != skipLength) {
282 return nullptr;
283 }
284 const size_t bytesRead = fStream->read(
data->writable_data(),
size);
285 if (bytesRead <
size) {
287 }
288 } else {
290 if (alreadyBuffered > 0 &&
291 !fStreamBuffer.
read(
data->writable_data(),
offset, alreadyBuffered)) {
292 return nullptr;
293 }
294
295 const size_t remaining =
size - alreadyBuffered;
296 if (remaining) {
297 auto*
dst =
static_cast<uint8_t*
>(
data->writable_data()) + alreadyBuffered;
298 const size_t bytesRead = fStream->read(
dst, remaining);
299 size_t newSize;
300 if (bytesRead < remaining) {
301 if (!safe_add_to_size_t(alreadyBuffered, bytesRead, &newSize)) {
302 return nullptr;
303 }
305 }
306 }
307 }
309 }
static sk_sp< SkData > MakeUninitialized(size_t length)
static sk_sp< SkData > MakeSubset(const SkData *src, size_t offset, size_t length)
static std::unique_ptr< SkMemoryStream > Make(sk_sp< SkData > data)
static float min(float r, float g, float b)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
The documentation for this class was generated from the following file: