Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
src
core
SkStreamPriv.h
Go to the documentation of this file.
1
/*
2
* Copyright 2013 Google Inc.
3
*
4
* Use of this source code is governed by a BSD-style license that can be
5
* found in the LICENSE file.
6
*/
7
8
#ifndef SkStreamPriv_DEFINED
9
#define SkStreamPriv_DEFINED
10
11
#include "
include/core/SkRefCnt.h
"
12
#include "
include/core/SkStream.h
"
13
14
class
SkData
;
15
16
/**
17
* Copy the provided stream to an SkData variable.
18
*
19
* Note: Assumes the stream is at the beginning. If it has a length,
20
* but is not at the beginning, this call will fail (return NULL).
21
*
22
* @param stream SkStream to be copied into data.
23
* @return The resulting SkData after the copy, nullptr on failure.
24
*/
25
sk_sp<SkData>
SkCopyStreamToData
(
SkStream
* stream);
26
27
/**
28
* Copies the input stream from the current position to the end.
29
* Does not rewind the input stream.
30
*/
31
bool
SkStreamCopy
(
SkWStream
* out,
SkStream
* input);
32
33
/** A SkWStream that writes all output to SkDebugf, for debugging purposes. */
34
class
SkDebugfStream
final :
public
SkWStream
{
35
public
:
36
bool
write
(
const
void
*
buffer
,
size_t
size)
override
;
37
size_t
bytesWritten
()
const override
;
38
39
private
:
40
size_t
fBytesWritten = 0;
41
};
42
43
// If the stream supports identifying the current position and total length, this returns
44
// true if there are not enough bytes in the stream to fulfill a read of the given length.
45
// Otherwise, it returns false.
46
// False does *not* mean a read will succeed of the given length, but true means we are
47
// certain it will fail.
48
bool
StreamRemainingLengthIsBelow
(
SkStream
* stream,
size_t
len);
49
50
#endif
// SkStreamPriv_DEFINED
SkRefCnt.h
StreamRemainingLengthIsBelow
bool StreamRemainingLengthIsBelow(SkStream *stream, size_t len)
Definition
SkStream.cpp:976
SkStreamCopy
bool SkStreamCopy(SkWStream *out, SkStream *input)
Definition
SkStream.cpp:954
SkCopyStreamToData
sk_sp< SkData > SkCopyStreamToData(SkStream *stream)
Definition
SkStream.cpp:937
SkStream.h
SkData
Definition
SkData.h:25
SkDebugfStream
Definition
SkStreamPriv.h:34
SkDebugfStream::bytesWritten
size_t bytesWritten() const override
Definition
SkStream.cpp:904
SkDebugfStream::write
bool write(const void *buffer, size_t size) override
Definition
SkStream.cpp:898
SkStream
Definition
SkStream.h:29
SkWStream
Definition
SkStream.h:218
sk_sp
Definition
SkRefCnt.h:220
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
Generated on Fri Apr 26 2024 06:16:49 for Flutter Engine by
1.9.8