From 68b8e3d50d0954eb5eeb7f625f06026c7fbd38c1 Mon Sep 17 00:00:00 2001 From: Matt Sarett Date: Fri, 28 Apr 2017 11:15:22 -0400 Subject: Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag"" This reverts commit 0122af08f6af0dee490e1a4f35b552377d0d4753. Reason for revert: Fixed Android callsite Original change's description: > Revert "Delete copyTo(Allocator), hide copyTo() behind flag" > > This reverts commit d4a338f4d0a0cdc08d7d3668931c60997f0fa971. > > Reason for revert: Looks like I missed something I was supposed to delete in Android. > > Original change's description: > > Delete copyTo(Allocator), hide copyTo() behind flag > > > > Replace uses of copyTo() in Skia. > > > > Bug: skia:6464 > > Change-Id: I921dc53a1c29a5176d18f05741f7c0b5a008e548 > > Reviewed-on: https://skia-review.googlesource.com/14502 > > Commit-Queue: Matt Sarett > > Reviewed-by: Mike Reed > > > > TBR=msarett@google.com,reed@google.com > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > > Change-Id: I4d252940cc6a2462b030007055ea6c229471fc6e > Reviewed-on: https://skia-review.googlesource.com/14602 > Reviewed-by: Matt Sarett > Commit-Queue: Matt Sarett > TBR=msarett@google.com,reviews@skia.org,reed@google.com Change-Id: I81659a820f79f1958fda23cb62513065b57db99d Reviewed-on: https://skia-review.googlesource.com/14640 Commit-Queue: Matt Sarett Reviewed-by: Matt Sarett --- tests/BitmapCopyTest.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) (limited to 'tests/BitmapCopyTest.cpp') diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp index aadf192285..dd5bf1afde 100644 --- a/tests/BitmapCopyTest.cpp +++ b/tests/BitmapCopyTest.cpp @@ -9,6 +9,7 @@ #include "SkRect.h" #include "SkTemplates.h" #include "Test.h" +#include "sk_tool_utils.h" static void init_src(const SkBitmap& bitmap) { if (bitmap.getPixels()) { @@ -112,7 +113,7 @@ DEF_TEST(BitmapCopy_extractSubset, reporter) { // Test copying an extracted subset. for (size_t j = 0; j < SK_ARRAY_COUNT(gPairs); j++) { SkBitmap copy; - bool success = subset.copyTo(©, gPairs[j].fColorType); + bool success = sk_tool_utils::copy_to(©, gPairs[j].fColorType, subset); if (!success) { // Skip checking that success matches fValid, which is redundant // with the code below. @@ -236,20 +237,3 @@ DEF_TEST(BitmapReadPixels, reporter) { } } } - -DEF_TEST(BitmapCopy_ColorSpaceMatch, r) { - // We should support matching color spaces, even if they are parametric. - 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 = 1.8f; - sk_sp cs = SkColorSpace::MakeRGB(fn, SkColorSpace::kRec2020_Gamut); - - SkImageInfo info = SkImageInfo::MakeN32Premul(1, 1, cs); - SkBitmap bitmap; - bitmap.allocPixels(info); - bitmap.eraseColor(0); - - SkBitmap copy; - bool success = bitmap.copyTo(©, kN32_SkColorType); - REPORTER_ASSERT(r, success); - REPORTER_ASSERT(r, cs.get() == copy.colorSpace()); -} -- cgit v1.2.3