diff options
author | Matt Sarett <msarett@google.com> | 2017-01-23 15:51:01 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-23 15:51:14 +0000 |
commit | 26ecfe0af8da1d17a079e17af85c5c576bfeca84 (patch) | |
tree | ffce62c50685254f0728a711f023b0d1a6792283 /src/core/SkImageInfoPriv.h | |
parent | bfe8dca7dfdd9cafbccba0a637f2fcd58c7a54fb (diff) |
Revert "Refactor trimming logic for read/writePixels()"
This reverts commit 977f64cbfad1ecd7fd4b1231c694c7e828fda1f0.
Reason for revert: Triggering nanobench asserts
Original change's description:
> Refactor trimming logic for read/writePixels()
>
> (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.
>
> BUG=skia:6021
>
> Change-Id: I748f50c3b726f7c6de5462e2b1ccb54bc387a510
> Reviewed-on: https://skia-review.googlesource.com/7326
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Matt Sarett <msarett@google.com>
>
TBR=msarett@google.com,brianosman@google.com,reed@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:6021
Change-Id: If9aacc6ce8b20e3dfe8a0f22ebca653f28356175
Reviewed-on: https://skia-review.googlesource.com/7379
Commit-Queue: Matt Sarett <msarett@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'src/core/SkImageInfoPriv.h')
-rw-r--r-- | src/core/SkImageInfoPriv.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkImageInfoPriv.h b/src/core/SkImageInfoPriv.h index f04acc5484..151de82632 100644 --- a/src/core/SkImageInfoPriv.h +++ b/src/core/SkImageInfoPriv.h @@ -39,7 +39,8 @@ 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. Do we overwrite the input color table? + * We will not convert to kIndex8 unless |src| is kIndex8. This is possible only + * in some cases and likley inefficient. * 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. @@ -56,7 +57,7 @@ static inline bool SkImageInfoValidConversion(const SkImageInfo& dst, const SkIm return false; } - if (kIndex_8_SkColorType == dst.colorType()) { + if (kIndex_8_SkColorType == dst.colorType() && kIndex_8_SkColorType != src.colorType()) { return false; } |