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

Unified Diff: src/gpu/gl/GrGLPathProcessor.cpp

Issue 1337513002: Late creation of GrPathProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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/batches/GrStencilAndCoverPathRenderer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLPathProcessor.cpp
diff --git a/src/gpu/gl/GrGLPathProcessor.cpp b/src/gpu/gl/GrGLPathProcessor.cpp
index b0ab10a4733ef4e3a50ae4467563ce552051d530..bbc3fe5d1d8c23ad6ee71dc58fb531ef8c9e213d 100644
--- a/src/gpu/gl/GrGLPathProcessor.cpp
+++ b/src/gpu/gl/GrGLPathProcessor.cpp
@@ -17,13 +17,13 @@ GrGLPathProcessor::GrGLPathProcessor(const GrPathProcessor&, const GrBatchTracke
void GrGLPathProcessor::emitCode(EmitArgs& args) {
GrGLGPBuilder* pb = args.fPB;
GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder();
- const PathBatchTracker& local = args.fBT.cast<PathBatchTracker>();
+ const GrPathProcessor& pathProc = args.fGP.cast<GrPathProcessor>();
// emit transforms
this->emitTransforms(args.fPB, args.fTransformsIn, args.fTransformsOut);
// Setup uniform color
- if (kUniform_GrGPInput == local.fInputColorType) {
+ if (pathProc.opts().readsColor()) {
const char* stagedLocalVarName;
fColorUniform = pb->addUniform(GrGLProgramBuilder::kFragment_Visibility,
kVec4f_GrSLType,
@@ -34,28 +34,28 @@ void GrGLPathProcessor::emitCode(EmitArgs& args) {
}
// setup constant solid coverage
- if (kAllOnes_GrGPInput == local.fInputCoverageType) {
+ if (pathProc.opts().readsCoverage()) {
fs->codeAppendf("%s = vec4(1);", args.fOutputCoverage);
}
}
-void GrGLPathProcessor::GenKey(const GrPathProcessor&,
+void GrGLPathProcessor::GenKey(const GrPathProcessor& pathProc,
const GrBatchTracker& bt,
const GrGLSLCaps&,
GrProcessorKeyBuilder* b) {
- const PathBatchTracker& local = bt.cast<PathBatchTracker>();
- b->add32(local.fInputColorType | local.fInputCoverageType << 16);
+ b->add32(SkToInt(pathProc.opts().readsColor()) |
+ SkToInt(pathProc.opts().readsCoverage()) << 16);
}
void GrGLPathProcessor::setData(const GrGLProgramDataManager& pdman,
const GrPrimitiveProcessor& primProc,
const GrBatchTracker& bt) {
- const PathBatchTracker& local = bt.cast<PathBatchTracker>();
- if (kUniform_GrGPInput == local.fInputColorType && local.fColor != fColor) {
+ const GrPathProcessor& pathProc = primProc.cast<GrPathProcessor>();
+ if (pathProc.opts().readsColor() && pathProc.color() != fColor) {
GrGLfloat c[4];
- GrColorToRGBAFloat(local.fColor, c);
+ GrColorToRGBAFloat(pathProc.color(), c);
pdman.set4fv(fColorUniform, 1, c);
- fColor = local.fColor;
+ fColor = pathProc.color();
}
}
« no previous file with comments | « src/gpu/batches/GrStencilAndCoverPathRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698