aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2017-02-09 11:16:46 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-09 19:25:21 +0000
commit5d4cd9ea8818f65bb4878c050dbdb9dcd48505ad (patch)
tree1cbcb0c31ffd9c5d592f8c84cfe59b7da3c074ec /src/gpu/effects
parente659c7f36fef20a6b1605c6b29d1642b4f1f01b5 (diff)
Re-enable processor optimization test with some fixes.
Enables on GL (for now) Change-Id: I5f5a38632963dd705f8434e8627eb33446e8f027 Reviewed-on: https://skia-review.googlesource.com/7721 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects')
-rw-r--r--src/gpu/effects/GrConfigConversionEffect.cpp11
-rw-r--r--src/gpu/effects/GrXfermodeFragmentProcessor.cpp13
2 files changed, 14 insertions, 10 deletions
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index d9a6fefc1e..771eba80f7 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -98,7 +98,7 @@ GrConfigConversionEffect::GrConfigConversionEffect(GrTexture* texture,
const GrSwizzle& swizzle,
PMConversion pmConversion,
const SkMatrix& matrix)
- : INHERITED(texture, nullptr, matrix, ModulationFlags(texture->config()))
+ : INHERITED(texture, nullptr, matrix, kNone_OptimizationFlags)
, fSwizzle(swizzle)
, fPMConversion(pmConversion) {
this->initClassID<GrConfigConversionEffect>();
@@ -112,13 +112,14 @@ GrConfigConversionEffect::GrConfigConversionEffect(GrTexture* texture,
}
GrConfigConversionEffect::GrConfigConversionEffect(GrContext* context,
- sk_sp<GrTextureProxy> proxy,
+ sk_sp<GrTextureProxy>
+ proxy,
const GrSwizzle& swizzle,
PMConversion pmConversion,
const SkMatrix& matrix)
- : INHERITED(context, ModulationFlags(proxy->config()), proxy, nullptr, matrix)
- , fSwizzle(swizzle)
- , fPMConversion(pmConversion) {
+ : INHERITED(context, kNone_OptimizationFlags, proxy, nullptr, matrix)
+ , fSwizzle(swizzle)
+ , fPMConversion(pmConversion) {
this->initClassID<GrConfigConversionEffect>();
// We expect to get here with non-BGRA/RGBA only if we're doing not doing a premul/unpremul
// conversion.
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index 0ecb4bd3c0..935b29406b 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -39,9 +39,10 @@ private:
static OptimizationFlags OptFlags(const GrFragmentProcessor* src,
const GrFragmentProcessor* dst, SkBlendMode mode) {
// We only attempt the constant output optimization.
- // The CPU and GPU implementations differ significantly for the advanced modes.
- if (mode <= SkBlendMode::kLastSeparableMode && src->hasConstantOutputForConstantInput() &&
- dst->hasConstantOutputForConstantInput()) {
+ // The CPU and GPU implementations differ significantly for the advanced modes and
+ // softlight.
+ if (mode <= SkBlendMode::kLastSeparableMode && mode != SkBlendMode::kSoftLight &&
+ src->hasConstantOutputForConstantInput() && dst->hasConstantOutputForConstantInput()) {
return kConstantOutputForConstantInput_OptimizationFlag;
}
return kNone_OptimizationFlags;
@@ -197,8 +198,10 @@ public:
private:
OptimizationFlags OptFlags(const GrFragmentProcessor* child, SkBlendMode mode) {
// We only attempt the constant output optimization.
- // The CPU and GPU implementations differ significantly for the advanced modes.
- if (mode <= SkBlendMode::kLastSeparableMode && child->hasConstantOutputForConstantInput()) {
+ // The CPU and GPU implementations differ significantly for the advanced modes and
+ // softlight.
+ if (mode <= SkBlendMode::kLastSeparableMode && mode != SkBlendMode::kSoftLight &&
+ child->hasConstantOutputForConstantInput()) {
return kConstantOutputForConstantInput_OptimizationFlag;
}
return kNone_OptimizationFlags;