90 {
91
99 }
100
101
102
104 if (serialize) {
108 }};
110 std::optional<SkAlphaType>,
115 auto [
image, getImageResult] = codec->getImage();
118 }};
120 }
121
122
123 surface->getCanvas()->drawPicture(pic);
127 if (!
surface->readPixels(recordedBitmap, 0, 0)) {
129 }
130
131
135 }
139 if (!
surface->readPixels(referenceBitmap, 0, 0)) {
141 }
142
143
146 SkStringPrintf(
"Recorded and reference bitmap dimensions do not match: "
147 "expected byte size %lu, width %d and height %d; "
148 "got %lu, %d and %d",
156 }
157 if (0 != memcmp(recordedBitmap.
getPixels(),
161 SkStringPrintf(
"Recorded and reference bitmap pixels do not match.\n"
162 "Recorded image:\n%s\nReference image:\n%s",
166 }
167
169}
static std::string bitmap_to_base64_data_uri(const SkBitmap &bitmap)
#define SkASSERT_RELEASE(cond)
size_t computeByteSize() const
void allocPixelsFlags(const SkImageInfo &info, uint32_t flags)
virtual bool isTextureBacked() const =0
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
sk_sp< SkData > serialize(const SkSerialProcs *procs=nullptr) const
static sk_sp< SkPicture > MakeFromData(const SkData *data, const SkDeserialProcs *procs=nullptr)
virtual SkISize getISize()=0
SK_API std::unique_ptr< SkCodec > Decode(std::unique_ptr< SkStream >, SkCodec::Result *, SkCodecs::DecodeContext=nullptr)
sk_sp< const SkImage > image
SkDeserialImageFromDataProc fImageDataProc
constexpr int32_t height() const
constexpr int32_t width() const
constexpr int32_t width() const
constexpr int32_t height() const
SkSerialImageProc fImageProc
std::shared_ptr< const fml::Mapping > data