aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrProgramDesc.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-02-02 10:43:58 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-02 18:34:02 +0000
commitcae3a4c8ab7082df009a1e340f10292350e0c763 (patch)
tree93b73dca6a37d1241a0ecc8819fdc3cf23f64cb0 /src/gpu/GrProgramDesc.cpp
parentebfbba9bbdacd754c8ad7429ee066f53f17bc66b (diff)
Revert "Replaced all calls to fragmentPosition() with sk_FragCoord"
This reverts commit de4d301881e7fd084f1f0b359ec6f9b2bf8bd4c5. Reason for revert: several Chrome rendering bugs on Mac BUG=skia: Change-Id: I492082b0b7e7c902ede4b598c5809f604d210ce1 Reviewed-on: https://skia-review.googlesource.com/7887 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'src/gpu/GrProgramDesc.cpp')
-rw-r--r--src/gpu/GrProgramDesc.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gpu/GrProgramDesc.cpp b/src/gpu/GrProgramDesc.cpp
index 080ba5ec2d..87a4a275d7 100644
--- a/src/gpu/GrProgramDesc.cpp
+++ b/src/gpu/GrProgramDesc.cpp
@@ -195,10 +195,15 @@ bool GrProgramDesc::Build(GrProgramDesc* desc,
// make sure any padding in the header is zeroed.
memset(header, 0, kHeaderSize);
- header->fSurfaceOriginKey = 0;
-
GrRenderTarget* rt = pipeline.getRenderTarget();
+ if (requiredFeatures & (GrProcessor::kFragmentPosition_RequiredFeature |
+ GrProcessor::kSampleLocations_RequiredFeature)) {
+ header->fSurfaceOriginKey = GrGLSLFragmentShaderBuilder::KeyForSurfaceOrigin(rt->origin());
+ } else {
+ header->fSurfaceOriginKey = 0;
+ }
+
if (requiredFeatures & GrProcessor::kSampleLocations_RequiredFeature) {
SkASSERT(pipeline.isHWAntialiasState());
header->fSamplePatternKey =