aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/gpu
diff options
context:
space:
mode:
authorGravatar ethannicholas <ethannicholas@google.com>2016-01-22 09:45:47 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-22 09:45:47 -0800
commit5366a09ed07e886dd5fd1b94828241c53df3726d (patch)
tree357aa47df476047ac6f5c37608344de2aa783c19 /include/gpu
parent1c2729c8bbb19ec60a0148e143ae6516faf452d6 (diff)
Revert of added support for PLS path rendering (patchset #16 id:360001 of https://codereview.chromium.org/1541903002/ )
Reason for revert: ASAN failure at src/gpu/GrXferProcessor.cpp:224 Original issue's description: > added support for PLS path rendering > > BUG=skia:3555 > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1541903002 > > Committed: https://skia.googlesource.com/skia/+/7df3f5e127f8016d17b637cc48a6a4718f1a6822 TBR=bsalomon@google.com,egdaniel@google.com,joshualitt@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia:3555 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1626553002 Review URL: https://codereview.chromium.org/1626553002
Diffstat (limited to 'include/gpu')
-rw-r--r--include/gpu/GrCaps.h20
-rw-r--r--include/gpu/GrConfig.h8
-rw-r--r--include/gpu/GrShaderVar.h10
-rw-r--r--include/gpu/GrTypesPriv.h66
-rw-r--r--include/gpu/GrXferProcessor.h14
-rw-r--r--include/gpu/effects/GrCoverageSetOpXP.h6
-rw-r--r--include/gpu/effects/GrPorterDuffXferProcessor.h6
7 files changed, 29 insertions, 101 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h
index 05da8d7cad..e2e59c30a4 100644
--- a/include/gpu/GrCaps.h
+++ b/include/gpu/GrCaps.h
@@ -81,24 +81,6 @@ public:
*/
bool floatPrecisionVaries() const { return fShaderPrecisionVaries; }
- /**
- * PLS storage size in bytes (0 when not supported). The PLS spec defines a minimum size of 16
- * bytes whenever PLS is supported.
- */
- int pixelLocalStorageSize() const { return fPixelLocalStorageSize; }
-
- /**
- * True if this context supports the necessary extensions and features to enable the PLS path
- * renderer.
- */
- bool plsPathRenderingSupport() const {
-#if GR_ENABLE_PLS_PATH_RENDERING
- return fPLSPathRenderingSupport;
-#else
- return false;
-#endif
- }
-
protected:
/** Subclasses must call this after initialization in order to apply caps overrides requested by
the client. Note that overrides will only reduce the caps never expand them. */
@@ -112,8 +94,6 @@ protected:
bool fShaderPrecisionVaries;
PrecisionInfo fFloatPrecisions[kGrShaderTypeCount][kGrSLPrecisionCount];
- int fPixelLocalStorageSize;
- bool fPLSPathRenderingSupport;
private:
virtual void onApplyOptionsOverrides(const GrContextOptions&) {};
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h
index 202887ee5d..34666857e5 100644
--- a/include/gpu/GrConfig.h
+++ b/include/gpu/GrConfig.h
@@ -193,12 +193,4 @@ typedef unsigned __int64 uint64_t;
#if !defined(GR_BATCH_DEBUGGING_OUTPUT)
#define GR_BATCH_DEBUGGING_OUTPUT 0
#endif
-
-/**
- * Set to 1 to enable pixel local storage path rendering on supported devices.
- */
-#if !defined(GR_ENABLE_PLS_PATH_RENDERING)
- #define GR_ENABLE_PLS_PATH_RENDERING 0
-#endif
-
#endif
diff --git a/include/gpu/GrShaderVar.h b/include/gpu/GrShaderVar.h
index 3f56eaf70a..68ce34b8ef 100644
--- a/include/gpu/GrShaderVar.h
+++ b/include/gpu/GrShaderVar.h
@@ -51,7 +51,7 @@ public:
, fName(name)
, fCount(arrayCount)
, fPrecision(precision) {
- SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type));
+ SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsFloatType(type));
SkASSERT(kVoid_GrSLType != type);
}
@@ -62,7 +62,7 @@ public:
, fName(name)
, fCount(arrayCount)
, fPrecision(precision) {
- SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type));
+ SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsFloatType(type));
SkASSERT(kVoid_GrSLType != type);
}
@@ -73,7 +73,7 @@ public:
, fName(name)
, fCount(arrayCount)
, fPrecision(precision) {
- SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type));
+ SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsFloatType(type));
SkASSERT(kVoid_GrSLType != type);
}
@@ -91,7 +91,7 @@ public:
GrSLPrecision precision = kDefault_GrSLPrecision,
int count = kNonArray) {
SkASSERT(kVoid_GrSLType != type);
- SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type));
+ SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsFloatType(type));
fType = type;
fTypeModifier = typeModifier;
fName = name;
@@ -105,7 +105,7 @@ public:
GrSLPrecision precision = kDefault_GrSLPrecision,
int count = kNonArray) {
SkASSERT(kVoid_GrSLType != type);
- SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsNumeric(type));
+ SkASSERT(kDefault_GrSLPrecision == precision || GrSLTypeIsFloatType(type));
fType = type;
fTypeModifier = typeModifier;
fName = name;
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h
index bc107b5cf5..c46e25bd0d 100644
--- a/include/gpu/GrTypesPriv.h
+++ b/include/gpu/GrTypesPriv.h
@@ -27,10 +27,8 @@ enum GrSLType {
kSampler2D_GrSLType,
kSamplerExternal_GrSLType,
kSampler2DRect_GrSLType,
- kBool_GrSLType,
- kInt_GrSLType,
- kLast_GrSLType = kInt_GrSLType
+ kLast_GrSLType = kSampler2DRect_GrSLType
};
static const int kGrSLTypeCount = kLast_GrSLType + 1;
@@ -67,7 +65,7 @@ static const int kGrSLPrecisionCount = kLast_GrSLPrecision + 1;
*/
static inline int GrSLTypeVectorCount(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1 };
+ static const int kCounts[] = { -1, 1, 2, 3, 4, -1, -1, -1, -1, -1 };
return kCounts[type];
GR_STATIC_ASSERT(0 == kVoid_GrSLType);
@@ -80,8 +78,6 @@ static inline int GrSLTypeVectorCount(GrSLType type) {
GR_STATIC_ASSERT(7 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(10 == kBool_GrSLType);
- GR_STATIC_ASSERT(11 == kInt_GrSLType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrSLTypeCount);
}
@@ -97,10 +93,10 @@ static inline GrSLType GrSLFloatVectorType(int count) {
GR_STATIC_ASSERT(kVec4f_GrSLType == 4);
}
-/** Is the shading language type float (including vectors/matrices)? */
+/** Is the shading language type floating point (or vector/matrix of fp)? */
static inline bool GrSLTypeIsFloatType(GrSLType type) {
SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- return (type >= 1 && type <= 6);
+ return type >= 1 && type <= 6;
GR_STATIC_ASSERT(0 == kVoid_GrSLType);
GR_STATIC_ASSERT(1 == kFloat_GrSLType);
@@ -112,34 +108,7 @@ static inline bool GrSLTypeIsFloatType(GrSLType type) {
GR_STATIC_ASSERT(7 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(10 == kBool_GrSLType);
- GR_STATIC_ASSERT(11 == kInt_GrSLType);
- GR_STATIC_ASSERT(12 == kGrSLTypeCount);
-}
-
-/** Is the shading language type integral (including vectors/matrices)? */
-static inline bool GrSLTypeIsIntType(GrSLType type) {
- SkASSERT(type >= 0 && type < static_cast<GrSLType>(kGrSLTypeCount));
- return type == kInt_GrSLType;
-
- GR_STATIC_ASSERT(0 == kVoid_GrSLType);
- GR_STATIC_ASSERT(1 == kFloat_GrSLType);
- GR_STATIC_ASSERT(2 == kVec2f_GrSLType);
- GR_STATIC_ASSERT(3 == kVec3f_GrSLType);
- GR_STATIC_ASSERT(4 == kVec4f_GrSLType);
- GR_STATIC_ASSERT(5 == kMat33f_GrSLType);
- GR_STATIC_ASSERT(6 == kMat44f_GrSLType);
- GR_STATIC_ASSERT(7 == kSampler2D_GrSLType);
- GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType);
- GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(10 == kBool_GrSLType);
- GR_STATIC_ASSERT(11 == kInt_GrSLType);
- GR_STATIC_ASSERT(12 == kGrSLTypeCount);
-}
-
-/** Is the shading language type numeric (including vectors/matrices)? */
-static inline bool GrSLTypeIsNumeric(GrSLType type) {
- return GrSLTypeIsFloatType(type) || GrSLTypeIsIntType(type);
+ GR_STATIC_ASSERT(10 == kGrSLTypeCount);
}
/** Returns the size in bytes for floating point GrSLTypes. For non floating point type returns 0 */
@@ -154,10 +123,8 @@ static inline size_t GrSLTypeSize(GrSLType type) {
9 * sizeof(float), // kMat33f_GrSLType
16 * sizeof(float), // kMat44f_GrSLType
0, // kSampler2D_GrSLType
- 0, // kSamplerExternal_GrSLType
- 0, // kSampler2DRect_GrSLType
- 0, // kBool_GrSLType
- 0, // kInt_GrSLType
+ 0, // kSamplerExternal_GrSLType
+ 0 // kSampler2DRect_GrSLType
};
return kSizes[type];
@@ -171,9 +138,7 @@ static inline size_t GrSLTypeSize(GrSLType type) {
GR_STATIC_ASSERT(7 == kSampler2D_GrSLType);
GR_STATIC_ASSERT(8 == kSamplerExternal_GrSLType);
GR_STATIC_ASSERT(9 == kSampler2DRect_GrSLType);
- GR_STATIC_ASSERT(10 == kBool_GrSLType);
- GR_STATIC_ASSERT(11 == kInt_GrSLType);
- GR_STATIC_ASSERT(12 == kGrSLTypeCount);
+ GR_STATIC_ASSERT(10 == kGrSLTypeCount);
}
static inline bool GrSLTypeIsSamplerType(GrSLType type) {
@@ -200,10 +165,8 @@ enum GrVertexAttribType {
kVec4ub_GrVertexAttribType, // vector of 4 unsigned bytes, e.g. colors
kVec2s_GrVertexAttribType, // vector of 2 shorts, e.g. texture coordinates
-
- kInt_GrVertexAttribType,
- kLast_GrVertexAttribType = kInt_GrVertexAttribType
+ kLast_GrVertexAttribType = kVec2s_GrVertexAttribType
};
static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
@@ -211,7 +174,8 @@ static const int kGrVertexAttribTypeCount = kLast_GrVertexAttribType + 1;
* Returns the vector size of the type.
*/
static inline int GrVertexAttribTypeVectorCount(GrVertexAttribType type) {
- static const int kCounts[] = { 1, 2, 3, 4, 1, 4, 2, 1 };
+ SkASSERT(type >= 0 && type < kGrVertexAttribTypeCount);
+ static const int kCounts[] = { 1, 2, 3, 4, 1, 4, 2 };
return kCounts[type];
GR_STATIC_ASSERT(0 == kFloat_GrVertexAttribType);
@@ -221,7 +185,6 @@ static inline int GrVertexAttribTypeVectorCount(GrVertexAttribType type) {
GR_STATIC_ASSERT(4 == kUByte_GrVertexAttribType);
GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType);
GR_STATIC_ASSERT(6 == kVec2s_GrVertexAttribType);
- GR_STATIC_ASSERT(7 == kInt_GrVertexAttribType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kCounts) == kGrVertexAttribTypeCount);
}
@@ -229,6 +192,7 @@ static inline int GrVertexAttribTypeVectorCount(GrVertexAttribType type) {
* Returns the size of the attrib type in bytes.
*/
static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) {
+ SkASSERT(type >= 0 && type < kGrVertexAttribTypeCount);
static const size_t kSizes[] = {
sizeof(float), // kFloat_GrVertexAttribType
2*sizeof(float), // kVec2f_GrVertexAttribType
@@ -236,8 +200,7 @@ static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) {
4*sizeof(float), // kVec4f_GrVertexAttribType
1*sizeof(char), // kUByte_GrVertexAttribType
4*sizeof(char), // kVec4ub_GrVertexAttribType
- 2*sizeof(int16_t), // kVec2s_GrVertexAttribType
- sizeof(int32_t) // kInt_GrVertexAttribType
+ 2*sizeof(int16_t) // kVec2s_GrVertexAttribType
};
return kSizes[type];
@@ -248,7 +211,6 @@ static inline size_t GrVertexAttribTypeSize(GrVertexAttribType type) {
GR_STATIC_ASSERT(4 == kUByte_GrVertexAttribType);
GR_STATIC_ASSERT(5 == kVec4ub_GrVertexAttribType);
GR_STATIC_ASSERT(6 == kVec2s_GrVertexAttribType);
- GR_STATIC_ASSERT(7 == kInt_GrVertexAttribType);
GR_STATIC_ASSERT(SK_ARRAY_COUNT(kSizes) == kGrVertexAttribTypeCount);
}
@@ -271,8 +233,6 @@ static inline GrSLType GrVertexAttribTypeToSLType(GrVertexAttribType type) {
case kVec4ub_GrVertexAttribType:
case kVec4f_GrVertexAttribType:
return kVec4f_GrSLType;
- case kInt_GrVertexAttribType:
- return kInt_GrSLType;
}
}
diff --git a/include/gpu/GrXferProcessor.h b/include/gpu/GrXferProcessor.h
index 3a698143c3..ce26709d9a 100644
--- a/include/gpu/GrXferProcessor.h
+++ b/include/gpu/GrXferProcessor.h
@@ -355,19 +355,15 @@ private:
const GrPipelineOptimizations& optimizations,
bool hasMixedSamples,
const DstTexture*) const = 0;
-
- virtual bool onIsEqual(const GrXPFactory&) const = 0;
-
- bool willReadDstColor(const GrCaps& caps,
- const GrPipelineOptimizations& optimizations,
- bool hasMixedSamples) const;
/**
* Returns true if the XP generated by this factory will explicitly read dst in the fragment
* shader.
*/
- virtual bool onWillReadDstColor(const GrCaps& caps,
- const GrPipelineOptimizations& optimizations,
- bool hasMixedSamples) const = 0;
+ virtual bool willReadDstColor(const GrCaps& caps,
+ const GrPipelineOptimizations& optimizations,
+ bool hasMixedSamples) const = 0;
+
+ virtual bool onIsEqual(const GrXPFactory&) const = 0;
static uint32_t GenClassID() {
// fCurrXPFactoryID has been initialized to kIllegalXPFactoryID. The
diff --git a/include/gpu/effects/GrCoverageSetOpXP.h b/include/gpu/effects/GrCoverageSetOpXP.h
index 42ac6ac528..097a890d56 100644
--- a/include/gpu/effects/GrCoverageSetOpXP.h
+++ b/include/gpu/effects/GrCoverageSetOpXP.h
@@ -34,9 +34,9 @@ private:
bool hasMixedSamples,
const DstTexture*) const override;
- bool onWillReadDstColor(const GrCaps& /*caps*/,
- const GrPipelineOptimizations& /*optimizations*/,
- bool /*hasMixedSamples*/) const override {
+ bool willReadDstColor(const GrCaps& /*caps*/,
+ const GrPipelineOptimizations& /*optimizations*/,
+ bool /*hasMixedSamples*/) const override {
return false;
}
diff --git a/include/gpu/effects/GrPorterDuffXferProcessor.h b/include/gpu/effects/GrPorterDuffXferProcessor.h
index 865ef44253..457c6eabc8 100644
--- a/include/gpu/effects/GrPorterDuffXferProcessor.h
+++ b/include/gpu/effects/GrPorterDuffXferProcessor.h
@@ -60,9 +60,9 @@ private:
bool hasMixedSamples,
const DstTexture*) const override;
- bool onWillReadDstColor(const GrCaps& caps,
- const GrPipelineOptimizations& optimizations,
- bool hasMixedSamples) const override;
+ bool willReadDstColor(const GrCaps& caps,
+ const GrPipelineOptimizations& optimizations,
+ bool hasMixedSamples) const override;
bool onIsEqual(const GrXPFactory& xpfBase) const override {
const GrPorterDuffXPFactory& xpf = xpfBase.cast<GrPorterDuffXPFactory>();