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

Unified Diff: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp

Issue 582963002: Solo gp (Closed) Base URL: https://skia.googlesource.com/skia.git@no_peb
Patch Set: rebase 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/gl/builders/GrGLFragmentShaderBuilder.h ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
diff --git a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
index 7279f1c393a41ae438882f38939b71a08543fbc0..4266d9fc43ee1e32a5109636f8deb8cdee25d67c 100644
--- a/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLFragmentShaderBuilder.cpp
@@ -80,9 +80,13 @@ GrGLFragmentShaderBuilder::GrGLFragmentShaderBuilder(GrGLProgramBuilder* program
const char* GrGLFragmentShaderBuilder::dstColor() {
if (fProgramBuilder->fCodeStage.inStageCode()) {
- const GrEffect* effect = fProgramBuilder->fCodeStage.effectStage()->getEffect();
- if (!effect->willReadDstColor()) {
- SkDEBUGFAIL("GrGLEffect asked for dst color but its generating GrEffect "
+ const GrProcessor* effect = fProgramBuilder->fCodeStage.effectStage()->getProcessor();
+ // TODO GPs can't read dst color, and full program builder only returns a pointer to the
+ // base fragment shader builder which does not have this function. Unfortunately,
+ // the code stage class only has a GrProcessor pointer so this is required for the time
+ // being
+ if (!static_cast<const GrFragmentProcessor*>(effect)->willReadDstColor()) {
+ SkDEBUGFAIL("GrGLProcessor asked for dst color but its generating GrProcessor "
"did not request access.");
return "";
}
@@ -119,7 +123,8 @@ bool GrGLFragmentShaderBuilder::enableFeature(GLSLFeature feature) {
}
}
-SkString GrGLFragmentShaderBuilder::ensureFSCoords2D(const TransformedCoordsArray& coords, int index) {
+SkString GrGLFragmentShaderBuilder::ensureFSCoords2D(
+ const GrGLProcessor::TransformedCoordsArray& coords, int index) {
if (kVec3f_GrSLType != coords[index].getType()) {
SkASSERT(kVec2f_GrSLType == coords[index].getType());
return coords[index].getName();
@@ -137,9 +142,9 @@ SkString GrGLFragmentShaderBuilder::ensureFSCoords2D(const TransformedCoordsArra
const char* GrGLFragmentShaderBuilder::fragmentPosition() {
GrGLProgramBuilder::CodeStage* cs = &fProgramBuilder->fCodeStage;
if (cs->inStageCode()) {
- const GrEffect* effect = cs->effectStage()->getEffect();
+ const GrProcessor* effect = cs->effectStage()->getProcessor();
if (!effect->willReadFragmentPosition()) {
- SkDEBUGFAIL("GrGLEffect asked for frag position but its generating GrEffect "
+ SkDEBUGFAIL("GrGLProcessor asked for frag position but its generating GrProcessor "
"did not request access.");
return "";
}
« no previous file with comments | « src/gpu/gl/builders/GrGLFragmentShaderBuilder.h ('k') | src/gpu/gl/builders/GrGLFullProgramBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698