aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-06-19 10:21:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-19 14:59:38 +0000
commitd4a70ee36717493cc071f878b16b037463e6ce9a (patch)
tree91ee41cf719bb3e63cea243aecea2bc73a8a1c83 /src/gpu
parent0bdaf05fc17ebe5d4ad01d70c80df2425e83c737 (diff)
Disable dithering of const paints
... except for 565. Change-Id: I8ab633661c54583478234a46942ef804eb74a619 Reviewed-on: https://skia-review.googlesource.com/19880 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/SkGr.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index 8b54aaa780..9adcb1a9ec 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -28,6 +28,7 @@
#include "SkMessageBus.h"
#include "SkMipMap.h"
#include "SkPM4fPriv.h"
+#include "SkPaintPriv.h"
#include "SkPixelRef.h"
#include "SkResourceCache.h"
#include "SkShaderBase.h"
@@ -542,7 +543,11 @@ static inline bool skpaint_to_grpaint_impl(GrContext* context,
}
#ifndef SK_IGNORE_GPU_DITHER
- if (skPaint.isDither() && grPaint->numColorFragmentProcessors() > 0 && !rtc->isGammaCorrect()) {
+ // Conservative default, in case GrPixelConfigToColorType() fails.
+ SkColorType ct = SkColorType::kRGB_565_SkColorType;
+ GrPixelConfigToColorType(rtc->config(), &ct);
+ if (SkPaintPriv::ShouldDither(skPaint, ct) && grPaint->numColorFragmentProcessors() > 0
+ && !rtc->isGammaCorrect()) {
grPaint->addColorFragmentProcessor(GrDitherEffect::Make());
}
#endif