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

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: adding some tests to ignore Created 6 years, 4 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
Index: src/gpu/GrRODrawState.cpp
diff --git a/src/gpu/GrRODrawState.cpp b/src/gpu/GrRODrawState.cpp
index 9118d0dc8dc037af8d5fe1fe3ca7e92cb6c68569..2e057a640267fece67bed58088caa85613e983a9 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->getGeometryProcessor() && that.getGeometryProcessor()) {
bsalomon 2014/08/29 15:07:25 the empty if() block feels a little weird... but h
joshua.litt 2014/09/02 16:06:21 Acknowledged.
+ if (!GrEffectStage::AreCompatible(*this->getGeometryProcessor(),
+ *that.getGeometryProcessor(),
+ explicitLocalCoords)) {
+ return kIncompatible_CombinedState;
+ }
+ } else if (!this->getGeometryProcessor() && !that.getGeometryProcessor()) {
+ // compatible
+ } else {
+ 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->getGeometryProcessor()) {
+ 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->getGeometryProcessor()) {
+ 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->getGeometryProcessor()) {
bsalomon 2014/08/29 15:07:25 Hopefully we can remove this feature from GP's onc
joshua.litt 2014/09/02 16:06:21 Acknowledged.
+ if (fGeometryProcessor->getEffect()->willReadDstColor()) {
+ return true;
+ }
+ }
return false;
}

Powered by Google App Engine
This is Rietveld 408576698