aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkConvertPixels.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@google.com>2017-05-20 17:27:19 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-20 17:27:26 +0000
commit580d81fb336701dc815d79b0df028a31446c4b06 (patch)
tree6dea16905f2bdfbf79a2b34bdcb75215759201fd /src/core/SkConvertPixels.cpp
parent766f9cd5553ab091b85d287a79f47cbb91ad7989 (diff)
Revert "dither copies when decreasing precision"
This reverts commit 766f9cd5553ab091b85d287a79f47cbb91ad7989. Reason for revert: unit test failures, I think on bots running portable code path Original change's description: > dither copies when decreasing precision > > Still seeing the same 4444 diffs on copyTo4444 and all_bitmap_configs, > and now also 565 in all_bitmap_configs. > > BUG=chromium:720105 > > Change-Id: I19406f57aa6d2b2f98d98c093da302b004c7cd8b > Reviewed-on: https://skia-review.googlesource.com/17419 > Commit-Queue: Mike Klein <mtklein@chromium.org> > Reviewed-by: Matt Sarett <msarett@google.com> > TBR=mtklein@chromium.org,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:720105 Change-Id: Ia9ece7dccef325233b870102ab38fbed2336b95d Reviewed-on: https://skia-review.googlesource.com/17442 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkConvertPixels.cpp')
-rw-r--r--src/core/SkConvertPixels.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/src/core/SkConvertPixels.cpp b/src/core/SkConvertPixels.cpp
index cfe5649c01..99564e7222 100644
--- a/src/core/SkConvertPixels.cpp
+++ b/src/core/SkConvertPixels.cpp
@@ -16,7 +16,6 @@
#include "SkRasterPipeline.h"
#include "SkUnPreMultiply.h"
#include "SkUnPreMultiplyPriv.h"
-#include "../jumper/SkJumper.h"
// Fast Path 1: The memcpy() case.
static inline bool can_memcpy(const SkImageInfo& dstInfo, const SkImageInfo& srcInfo) {
@@ -358,22 +357,6 @@ static void convert_with_pipeline(const SkImageInfo& dstInfo, void* dstRow, size
// opaque to another alpha type, there's no need to worry about multiplication.
SkASSERT(premulState == dat || kOpaque_SkAlphaType == srcInfo.alphaType());
- // We'll dither if we're decreasing precision.
- int y;
- SkJumper_DitherCtx dither = {&y, 0.0f};
- if (srcInfo.bytesPerPixel() > dstInfo.bytesPerPixel()) {
- switch (dstInfo.colorType()) {
- case kRGBA_8888_SkColorType:
- case kBGRA_8888_SkColorType: dither.rate = 1/255.0f; break;
- case kRGB_565_SkColorType: dither.rate = 1/ 63.0f; break;
- case kARGB_4444_SkColorType: dither.rate = 1/ 15.0f; break;
- default: dither.rate = 0.0f; break;
- }
- }
- if (dither.rate > 0) {
- pipeline.append(SkRasterPipeline::dither, &dither);
- }
-
switch (dstInfo.colorType()) {
case kRGBA_8888_SkColorType:
pipeline.append(SkRasterPipeline::store_8888, &dstRow);
@@ -396,8 +379,7 @@ static void convert_with_pipeline(const SkImageInfo& dstInfo, void* dstRow, size
break;
}
- // This y is declared above when handling dither (which needs to know y).
- for (y = 0; y < srcInfo.height(); ++y) {
+ for (int y = 0; y < srcInfo.height(); ++y) {
pipeline.run(0,srcInfo.width());
// The pipeline has pointers to srcRow and dstRow, so we just need to update them in the
// loop to move between rows of src/dst.