aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkImageInfoPriv.h
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 /src/core/SkImageInfoPriv.h
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 'src/core/SkImageInfoPriv.h')
-rw-r--r--src/core/SkImageInfoPriv.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/SkImageInfoPriv.h b/src/core/SkImageInfoPriv.h
index 151de82632..f04acc5484 100644
--- a/src/core/SkImageInfoPriv.h
+++ b/src/core/SkImageInfoPriv.h
@@ -39,8 +39,7 @@ static inline bool SkImageInfoIsValid(const SkImageInfo& info) {
/**
* Returns true if Skia has defined a pixel conversion from the |src| to the |dst|.
* Returns false otherwise. Some discussion of false cases:
- * We will not convert to kIndex8 unless |src| is kIndex8. This is possible only
- * in some cases and likley inefficient.
+ * We will not convert to kIndex8. Do we overwrite the input color table?
* We do not convert to kGray8 when the |src| is not kGray8. We may add this
* feature - it just requires some work to convert to luminance while handling color
* spaces correctly. Currently no one is asking for this.
@@ -57,7 +56,7 @@ static inline bool SkImageInfoValidConversion(const SkImageInfo& dst, const SkIm
return false;
}
- if (kIndex_8_SkColorType == dst.colorType() && kIndex_8_SkColorType != src.colorType()) {
+ if (kIndex_8_SkColorType == dst.colorType()) {
return false;
}