Flutter Engine
The Flutter Engine
|
#include "tools/skdiff/skdiff.h"
Go to the source code of this file.
Functions | |
bool | are_buffers_equal (SkData *skdata1, SkData *skdata2) |
sk_sp< SkData > | read_file (const char *file_path) |
bool | get_bitmap (sk_sp< SkData > fileBits, DiffResource &resource, bool sizeOnly, bool ignoreColorSpace) |
bool | write_bitmap (const SkString &path, const SkBitmap &bitmap) |
SkString | filename_to_diff_filename (const SkString &filename) |
SkString | filename_to_white_filename (const SkString &filename) |
void | create_and_write_diff_image (DiffRecord *drp, DiffMetricProc dmp, const int colorThreshold, const SkString &outputDir, const SkString &filename) |
Returns true if the two buffers passed in are both non-nullptr, have the same length, and contain exactly the same byte values.
Definition at line 19 of file skdiff_utils.cpp.
void create_and_write_diff_image | ( | DiffRecord * | drp, |
DiffMetricProc | dmp, | ||
const int | colorThreshold, | ||
const SkString & | outputDir, | ||
const SkString & | filename | ||
) |
Calls compute_diff and handles the difference and white diff resources. If !outputDir.isEmpty(), writes out difference and white images.
Definition at line 157 of file skdiff_utils.cpp.
Given an image filename, returns the name of the file containing the associated difference image.
Definition at line 149 of file skdiff_utils.cpp.
Given an image filename, returns the name of the file containing the "white" difference image.
Definition at line 153 of file skdiff_utils.cpp.
bool get_bitmap | ( | sk_sp< SkData > | fileBits, |
DiffResource & | resource, | ||
bool | sizeOnly, | ||
bool | ignoreColorSpace | ||
) |
Decodes the fileBits into the resource.fBitmap. Returns false on failure.
Definition at line 37 of file skdiff_utils.cpp.
Reads the file at the given path and returns its complete contents as an SkData object (or returns nullptr on error).
Definition at line 29 of file skdiff_utils.cpp.
Writes the bitmap as a PNG to the path specified.
Definition at line 97 of file skdiff_utils.cpp.