Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Unified Diff: src/gpu/effects/GrConfigConversionEffect.h

Issue 1617433002: Make swizzling in read/write pixel copy code more generic (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix loop in config conversion test create Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrSwizzle.h ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/GrSwizzle.h ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698