aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/BitmapCopyTest.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-01-23 12:15:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-23 18:12:46 +0000
commit03dd6d5208a6e3d92190e7020300e4399178ae4b (patch)
tree8d062392a5072a50d10f032bbea8502aaa713581 /tests/BitmapCopyTest.cpp
parenta6725fcb14f63734d7668bb0550cd9c128e841b0 (diff)
Reland "Refactor trimming logic for read/writePixels()"
Original CL: https://skia-review.googlesource.com/c/7326/ (1) Move trimming logic into Bitmap/Pixmap level for raster. Everything goes through here, so we'll only do the work once. (2) This means it also goes to GPU level. (3) Always use SkReadPixelsRec rather than inlining the logic. (4) Create an SkWritePixelsRec to encapsulate write trimming. (5) Disabled kIndex8 as a dst - always. CQ_INCLUDE_TRYBOTS=skia.primary:Perf-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug BUG=skia:6021 Change-Id: I25a964e3c610c4e36d195a255e2150657baec649 Reviewed-on: https://skia-review.googlesource.com/7404 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Matt Sarett <msarett@google.com>
Diffstat (limited to 'tests/BitmapCopyTest.cpp')
-rw-r--r--tests/BitmapCopyTest.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index ab0ec30e16..d69f7df76e 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -184,7 +184,7 @@ static void writeCoordPixels(SkBitmap& bm, const Coordinates& coords) {
static const Pair gPairs[] = {
{ kUnknown_SkColorType, "000000" },
{ kAlpha_8_SkColorType, "010000" },
- { kIndex_8_SkColorType, "011111" },
+ { kIndex_8_SkColorType, "010111" },
{ kRGB_565_SkColorType, "010101" },
{ kARGB_4444_SkColorType, "010111" },
{ kN32_SkColorType, "010111" },
@@ -235,7 +235,8 @@ DEF_TEST(BitmapCopy_extractSubset, reporter) {
if (!success) {
// Skip checking that success matches fValid, which is redundant
// with the code below.
- REPORTER_ASSERT(reporter, gPairs[i].fColorType != gPairs[j].fColorType);
+ REPORTER_ASSERT(reporter, kIndex_8_SkColorType == gPairs[i].fColorType ||
+ gPairs[i].fColorType != gPairs[j].fColorType);
continue;
}