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

Unified Diff: src/gpu/GrRODrawState.cpp

Issue 509153002: Initial change to create GeometryProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: last warning Created 6 years, 3 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/GrRODrawState.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrRODrawState.cpp
diff --git a/src/gpu/GrRODrawState.cpp b/src/gpu/GrRODrawState.cpp
index 9118d0dc8dc037af8d5fe1fe3ca7e92cb6c68569..f6a235517a1f79e26024d92f0f7f1c2cc1778132 100644
--- a/src/gpu/GrRODrawState.cpp
+++ b/src/gpu/GrRODrawState.cpp
@@ -38,6 +38,18 @@ bool GrRODrawState::isEqual(const GrRODrawState& that) const {
}
bool explicitLocalCoords = this->hasLocalCoordAttribute();
+ if (this->hasGeometryProcessor()) {
+ if (!that.hasGeometryProcessor()) {
+ return kIncompatible_CombinedState;
+ } else if (!GrEffectStage::AreCompatible(*this->getGeometryProcessor(),
+ *that.getGeometryProcessor(),
+ explicitLocalCoords)) {
+ return kIncompatible_CombinedState;
+ }
+ } else if (that.hasGeometryProcessor()) {
+ return kIncompatible_CombinedState;
+ }
+
for (int i = 0; i < this->numColorStages(); i++) {
if (!GrEffectStage::AreCompatible(this->getColorStage(i), that.getColorStage(i),
explicitLocalCoords)) {
@@ -66,11 +78,9 @@ bool GrRODrawState::validateVertexAttribs() const {
for (int i = 0; i < kMaxVertexAttribCnt; ++i) {
slTypes[i] = static_cast<GrSLType>(-1);
}
- int totalStages = this->numTotalStages();
- for (int s = 0; s < totalStages; ++s) {
- int covIdx = s - this->numColorStages();
- const GrEffectStage& stage = covIdx < 0 ? this->getColorStage(s) :
- this->getCoverageStage(covIdx);
+
+ if (this->hasGeometryProcessor()) {
+ const GrEffectStage& stage = *this->getGeometryProcessor();
const GrEffect* effect = stage.getEffect();
SkASSERT(NULL != effect);
// make sure that any attribute indices have the correct binding type, that the attrib
@@ -118,6 +128,10 @@ bool GrRODrawState::hasSolidCoverage() const {
}
// Run through the coverage stages and see if the coverage will be all ones at the end.
+ if (this->hasGeometryProcessor()) {
+ const GrEffect* effect = fGeometryProcessor->getEffect();
+ effect->getConstantColorComponents(&coverage, &validComponentFlags);
+ }
for (int s = 0; s < this->numCoverageStages(); ++s) {
const GrEffect* effect = this->getCoverageStage(s).getEffect();
effect->getConstantColorComponents(&coverage, &validComponentFlags);
@@ -140,6 +154,11 @@ bool GrRODrawState::willEffectReadDstColor() const {
return true;
}
}
+ if (this->hasGeometryProcessor()) {
+ if (fGeometryProcessor->getEffect()->willReadDstColor()) {
+ return true;
+ }
+ }
return false;
}
« no previous file with comments | « src/gpu/GrRODrawState.h ('k') | src/gpu/effects/GrDashingEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698