From d7e16661bb36924b2c8f717c527b876dabb595f3 Mon Sep 17 00:00:00 2001 From: Hal Canary Date: Thu, 1 Dec 2016 11:19:26 -0500 Subject: [PATCH] SkImageEncoder::* going away Approval from https://review.skia.org/5006 TBR=reed@google.com Change-Id: I43d1a24fa3e924b3c24b224f2451ab990b440dc8 Reviewed-on: https://skia-review.googlesource.com/5413 Reviewed-by: Hal Canary Commit-Queue: Hal Canary --- gn/android_framework_defines.gni | 1 - include/core/SkImage.h | 5 ----- include/core/SkImageEncoder.h | 32 -------------------------------- include/images/SkForceLinking.h | 7 ------- public.bzl | 1 - 5 files changed, 46 deletions(-) delete mode 100644 include/images/SkForceLinking.h diff --git a/gn/android_framework_defines.gni b/gn/android_framework_defines.gni index a80e38d09e..90fea2fb25 100644 --- a/gn/android_framework_defines.gni +++ b/gn/android_framework_defines.gni @@ -14,6 +14,5 @@ android_framework_defines = [ "SK_IGNORE_GPU_DITHER", "SK_SUPPORT_LEGACY_CANVAS_IS_REFCNT", "SK_SUPPORT_LEGACY_CLIP_REGIONOPS", - "SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS", "SK_SUPPORT_LEGACY_SHADER_ISABITMAP", ] diff --git a/include/core/SkImage.h b/include/core/SkImage.h index 625d0a0b63..8c73eebb15 100644 --- a/include/core/SkImage.h +++ b/include/core/SkImage.h @@ -276,11 +276,6 @@ public: * even if the image returns a data from refEncoded(). That data will be ignored. */ SkData* encode(SkEncodedImageFormat, int quality) const; -#ifdef SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS - SkData* encode(SkImageEncoder::Type t, int quality) const { - return this->encode((SkEncodedImageFormat)t, quality); - } -#endif /** * Encode the image and return the result as a caller-managed SkData. This will diff --git a/include/core/SkImageEncoder.h b/include/core/SkImageEncoder.h index 17d0603531..e4f746ab96 100644 --- a/include/core/SkImageEncoder.h +++ b/include/core/SkImageEncoder.h @@ -39,36 +39,4 @@ inline bool SkEncodeImage(SkWStream* dst, const SkBitmap& src, SkEncodedImageFor return src.peekPixels(&pixmap) && SkEncodeImage(dst, pixmap, f, q); } -//TODO(halcanary): remove this code once all changes land. -#ifdef SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS -class SkImageEncoder { -public: - enum Type { -#ifdef GOOGLE3 - kUnknown_Type = (int)SkEncodedImageFormat::kUnknown, -#endif - kBMP_Type = (int)SkEncodedImageFormat::kBMP, - kGIF_Type = (int)SkEncodedImageFormat::kGIF, - kICO_Type = (int)SkEncodedImageFormat::kICO, - kJPEG_Type = (int)SkEncodedImageFormat::kJPEG, - kPNG_Type = (int)SkEncodedImageFormat::kPNG, - kWBMP_Type = (int)SkEncodedImageFormat::kWBMP, - kWEBP_Type = (int)SkEncodedImageFormat::kWEBP, - kKTX_Type = (int)SkEncodedImageFormat::kKTX, - }; - static SkData* EncodeData(const SkBitmap& src, Type t, int quality) { - SkDynamicMemoryWStream buf; - return SkEncodeImage(&buf, src, (SkEncodedImageFormat)t, quality) - ? buf.detachAsData().release() : nullptr; - } - static bool EncodeFile(const char path[], const SkBitmap& src, Type t, int quality) { - SkFILEWStream file(path); - return SkEncodeImage(&file, src, (SkEncodedImageFormat)t, quality); - } - static bool EncodeStream(SkWStream* dst, const SkBitmap& bm, Type t, int quality) { - return SkEncodeImage(dst, bm, (SkEncodedImageFormat)t, quality); - } -}; -#endif // SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS - #endif // SkImageEncoder_DEFINED diff --git a/include/images/SkForceLinking.h b/include/images/SkForceLinking.h deleted file mode 100644 index ca52eeb5e5..0000000000 --- a/include/images/SkForceLinking.h +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Copyright 2013 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ -// TODO(halcanary): delete this file. diff --git a/public.bzl b/public.bzl index d12adf5583..acec1ffea7 100644 --- a/public.bzl +++ b/public.bzl @@ -591,7 +591,6 @@ DEFINES_ALL = [ "GOOGLE3", # Staging flags for API changes "SK_SUPPORT_LEGACY_CLIP_REGIONOPS", - "SK_SUPPORT_LEGACY_IMAGE_ENCODER_CLASS", # Temporarily Disable analytic AA for Google3 "SK_NO_ANALYTIC_AA", ] -- 2.34.1