aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/effects/GrSimpleTextureEffect.h
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-01-27 15:34:34 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-01-27 15:34:43 +0000
commit052fd5158f7f85e478a9f87c45fecaacf7d0f5f3 (patch)
tree1dd49a45fbbaea5874cbc6d68fb8adf0994a1351 /src/gpu/effects/GrSimpleTextureEffect.h
parent85eb4226a4cd8c10a0e3f3ba2f3a60efbb2dd61b (diff)
Revert "Start of rewrite of GrFragmentProcessor optimizations."
This reverts commit 85eb4226a4cd8c10a0e3f3ba2f3a60efbb2dd61b. Reason for revert: test failures on Windows, e.g. https://chromium-swarm.appspot.com/task?id=33f9527484414110&refresh=10 Original change's description: > Start of rewrite of GrFragmentProcessor optimizations. > > This adds a replacement for computeInvariantOutput buts does not use it yet. The replacement allows for three types of optimizations: > > * known input color -> known output color for GrFP elimination > * tracking of whether all color processors modulate their input for the "tweak alpha" optimziation > * opaqueness tracking > > This loses some of the generality of computInvariantOutput. It does not track the known output status of individual color components (other than opaque alpha). It does not track whether GrFragmentProcessors read their input color. It doesn't allow a processor that will receive non-constant output to advertise that it produces a constant output. These could probably be added back in the unlikely case that they prove valuable. > > Unlike computeInvariantOutput the optimizations are decided at instantiation time and constant colors are expressed as GrColor4f rather than GrColor. > > Change-Id: I684d3f9050693dde2d28154fa695e049ed8cf61a > Reviewed-on: https://skia-review.googlesource.com/7481 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I2390df257456013fa74137cb5d7b5a93820c291e Reviewed-on: https://skia-review.googlesource.com/7652 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/effects/GrSimpleTextureEffect.h')
-rw-r--r--src/gpu/effects/GrSimpleTextureEffect.h54
1 files changed, 10 insertions, 44 deletions
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index c44ce44121..bf013e9c83 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -13,29 +13,6 @@
class GrInvariantOutput;
-// In a few places below we rely on braced initialization order being defined by the C++ spec (left
-// to right). We use operator-> on a sk_sp and then in a later argument std::move() the sk_sp. GCC
-// 4.9.0 and earlier has a bug where the left to right order evaluation isn't implemented correctly.
-#if defined(__GNUC__) && !defined(__clang__)
-# define GCC_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
-# if (GCC_VERSION > 40900)
-# define GCC_EVAL_ORDER_BUG 0
-# else
-# define GCC_EVAL_ORDER_BUG 1
-# endif
-# undef GCC_VERSION
-#else
-# define GCC_EVAL_ORDER_BUG 0
-#endif
-
-#if GCC_EVAL_ORDER_BUG
-# define PROXY_MOVE(X) (X)
-#else
-# define PROXY_MOVE(X) (std::move(X))
-#endif
-
-#undef GCC_EVAL_ORDER_BUG
-
/**
* The output color of this effect is a modulation of the input color and a sample from a texture.
* It allows explicit specification of the filtering and wrap modes (GrSamplerParams) and accepts
@@ -104,41 +81,32 @@ private:
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
GrSamplerParams::FilterMode filterMode)
- : INHERITED(texture, std::move(colorSpaceXform), matrix, filterMode,
- ModulationFlags(texture->config())) {
+ : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode) {
this->initClassID<GrSimpleTextureEffect>();
}
GrSimpleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
- sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
+ const SkMatrix& matrix,
GrSamplerParams::FilterMode filterMode)
- : INHERITED{ctx,
- ModulationFlags(proxy->config()),
- PROXY_MOVE(proxy),
- std::move(colorSpaceXform),
- matrix,
- filterMode} {
+ : GrSingleTextureEffect(ctx, std::move(proxy), std::move(colorSpaceXform),
+ matrix, filterMode) {
this->initClassID<GrSimpleTextureEffect>();
}
GrSimpleTextureEffect(GrTexture* texture,
- sk_sp<GrColorSpaceXform>colorSpaceXform,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
const GrSamplerParams& params)
- : INHERITED(texture, std::move(colorSpaceXform), matrix, params,
- ModulationFlags(texture->config())) {
+ : GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, params) {
this->initClassID<GrSimpleTextureEffect>();
}
GrSimpleTextureEffect(GrContext* ctx, sk_sp<GrTextureProxy> proxy,
- sk_sp<GrColorSpaceXform> colorSpaceXform, const SkMatrix& matrix,
+ sk_sp<GrColorSpaceXform> colorSpaceXform,
+ const SkMatrix& matrix,
const GrSamplerParams& params)
- : INHERITED{ctx,
- ModulationFlags(proxy->config()),
- PROXY_MOVE(proxy),
- std::move(colorSpaceXform),
- matrix,
- params} {
+ : GrSingleTextureEffect(ctx, std::move(proxy), std::move(colorSpaceXform), matrix, params) {
this->initClassID<GrSimpleTextureEffect>();
}
@@ -155,6 +123,4 @@ private:
typedef GrSingleTextureEffect INHERITED;
};
-#undef PROXY_MOVE
-
#endif