Index: src/gpu/effects/GrConfigConversionEffect.h |
diff --git a/src/gpu/effects/GrConfigConversionEffect.h b/src/gpu/effects/GrConfigConversionEffect.h |
index 56beef97b192fa820a6f06264fc312fc5ddc7cef..65c55e78b6e76ba234f5d6712a7dffd26eddfa1b 100644 |
--- a/src/gpu/effects/GrConfigConversionEffect.h |
+++ b/src/gpu/effects/GrConfigConversionEffect.h |
@@ -9,14 +9,14 @@ |
#define GrConfigConversionEffect_DEFINED |
#include "GrSingleTextureEffect.h" |
+#include "GrSwizzle.h" |
class GrInvariantOutput; |
/** |
* This class is used to perform config conversions. Clients may want to read/write data that is |
- * unpremultiplied. Also on some systems reading/writing BGRA or RGBA is faster. In those cases we |
- * read/write using the faster path and perform an R/B swap in the shader if the client data is in |
- * the slower config. |
+ * unpremultiplied. Additionally, the channels may also be swizzled for optimal readback/upload |
+ * performance. |
*/ |
class GrConfigConversionEffect : public GrSingleTextureEffect { |
public: |
@@ -33,12 +33,12 @@ public: |
kPMConversionCnt |
}; |
- static const GrFragmentProcessor* Create(GrTexture*, bool swapRedAndBlue, PMConversion, |
+ static const GrFragmentProcessor* Create(GrTexture*, const GrSwizzle&, PMConversion, |
const SkMatrix&); |
const char* name() const override { return "Config Conversion"; } |
- bool swapsRedAndBlue() const { return fSwapRedAndBlue; } |
+ const GrSwizzle& swizzle() const { return fSwizzle; } |
PMConversion pmConversion() const { return fPMConversion; } |
// This function determines whether it is possible to choose PM->UPM and UPM->PM conversions |
@@ -52,7 +52,7 @@ public: |
private: |
GrConfigConversionEffect(GrTexture*, |
- bool swapRedAndBlue, |
+ const GrSwizzle&, |
PMConversion pmConversion, |
const SkMatrix& matrix); |
@@ -64,7 +64,7 @@ private: |
void onComputeInvariantOutput(GrInvariantOutput* inout) const override; |
- bool fSwapRedAndBlue; |
+ GrSwizzle fSwizzle; |
PMConversion fPMConversion; |
GR_DECLARE_FRAGMENT_PROCESSOR_TEST; |