aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrSurface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrSurface.cpp')
-rw-r--r--src/gpu/GrSurface.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/gpu/GrSurface.cpp b/src/gpu/GrSurface.cpp
index 3bb666e427..f67bfd4eb5 100644
--- a/src/gpu/GrSurface.cpp
+++ b/src/gpu/GrSurface.cpp
@@ -165,11 +165,6 @@ bool GrSurface::readPixels(int left, int top, int width, int height,
rowBytes, pixelOpsFlags);
}
-static bool encode_image_to_file(const char* path, const SkBitmap& src) {
- SkFILEWStream file(path);
- return file.isValid() && SkEncodeImage(&file, src, SkEncodedImageFormat::kPNG, 100);
-}
-
// TODO: This should probably be a non-member helper function. It might only be needed in
// debug or developer builds.
bool GrSurface::savePixels(const char* filename) {
@@ -188,7 +183,7 @@ bool GrSurface::savePixels(const char* filename) {
// remove any previous version of this file
remove(filename);
- if (!encode_image_to_file(filename, bm)) {
+ if (!SkImageEncoder::EncodeFile(filename, bm, SkImageEncoder::kPNG_Type, 100)) {
SkDebugf("------ failed to encode %s\n", filename);
remove(filename); // remove any partial file
return false;