From 62501c12c83e3cc01d4268edb094c86a656eab73 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 30 Jul 2018 11:04:41 -0400 Subject: Remove unused 'create_flutter_test_images' tool Change-Id: I9be9e8d72168c90b681015be0b5f599a6243abd2 Reviewed-on: https://skia-review.googlesource.com/144341 Auto-Submit: Brian Osman Commit-Queue: Mike Klein Reviewed-by: Mike Klein --- BUILD.gn | 10 ------ tools/create_flutter_test_images.cpp | 69 ------------------------------------ 2 files changed, 79 deletions(-) delete mode 100644 tools/create_flutter_test_images.cpp diff --git a/BUILD.gn b/BUILD.gn index 517b76a545..14173a08c8 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -1661,16 +1661,6 @@ if (skia_enable_tools) { ] } - test_app("create_flutter_test_images") { - sources = [ - "tools/create_flutter_test_images.cpp", - ] - deps = [ - ":skia", - ":tool_utils", - ] - } - test_app("create_test_font") { sources = [ "tools/fonts/create_test_font.cpp", diff --git a/tools/create_flutter_test_images.cpp b/tools/create_flutter_test_images.cpp deleted file mode 100644 index a3c0ada68c..0000000000 --- a/tools/create_flutter_test_images.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2017 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ - -#include "SkColorSpacePriv.h" -#include "SkImage.h" -#include "SkPngEncoder.h" - -#include "Resources.h" - -/** - * Create a color space that swaps the red, green, and blue channels. - */ -static sk_sp gbr_color_space() { - return SkColorSpace::MakeSRGB()->makeColorSpin(); -} - -/** - * Create a color space with a steep transfer function. - */ -static sk_sp tf_color_space() { - SkColorSpaceTransferFn fn; - fn.fA = 1.f; fn.fB = 0.f; fn.fC = 0.f; fn.fD = 0.f; fn.fE = 0.f; fn.fF = 0.f; fn.fG = 50.f; - return SkColorSpace::MakeRGB(fn, SkColorSpace::kSRGB_Gamut); -} - -/** - * Create a wide gamut color space. - */ -static sk_sp wide_gamut_color_space() { - return SkColorSpace::MakeRGB(SkColorSpace::kSRGB_RenderTargetGamma, - SkColorSpace::kRec2020_Gamut); -} - -int main(int argc, char** argv) { - sk_sp image = GetResourceAsImage("images/flutter_logo.jpg"); - if (!image) { - SkDebugf("Cannot find flutter_logo.jpg in resources.\n"); - return 1; - } - - // Encode an image with a gbr color space. - SkImageInfo info = SkImageInfo::MakeN32(image->width(), image->height(), kOpaque_SkAlphaType, - gbr_color_space()); - size_t rowBytes = info.minRowBytes(); - SkAutoTMalloc storage(rowBytes * image->height()); - SkPixmap src(info, storage.get(), rowBytes); - image->readPixels(src, 0, 0, SkImage::kDisallow_CachingHint); - SkFILEWStream dst0("gbr.png"); - SkPngEncoder::Options opts; - SkAssertResult(SkPngEncoder::Encode(&dst0, src, opts)); - - // Encode an image with steep transfer function. - src.setColorSpace(tf_color_space()); - image->readPixels(src, 0, 0, SkImage::kDisallow_CachingHint); - SkFILEWStream dst1("tf.png"); - SkAssertResult(SkPngEncoder::Encode(&dst1, src, opts)); - - // Encode a wide gamut image. - src.setColorSpace(wide_gamut_color_space()); - image->readPixels(src, 0, 0, SkImage::kDisallow_CachingHint); - SkFILEWStream dst2("wide-gamut.png"); - SkAssertResult(SkPngEncoder::Encode(&dst2, src, opts)); - - return 0; -} -- cgit v1.2.3