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

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

Issue 13314002: Add support for reading the dst pixel value in an effect. Use in a new effect for the kDarken xfer … (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Revert whitespace/comment changes accidentally made in GrGLProgramDesc.cpp Created 7 years, 9 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/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGLShaderBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLProgramDesc.cpp
===================================================================
--- src/gpu/gl/GrGLProgramDesc.cpp (revision 8448)
+++ src/gpu/gl/GrGLProgramDesc.cpp (working copy)
@@ -9,6 +9,7 @@
#include "GrBackendEffectFactory.h"
#include "GrDrawEffect.h"
#include "GrEffect.h"
+#include "GrGLShaderBuilder.h"
#include "GrGpuGL.h"
void GrGLProgramDesc::Build(const GrDrawState& drawState,
@@ -17,6 +18,7 @@
GrBlendCoeff srcCoeff,
GrBlendCoeff dstCoeff,
const GrGpuGL* gpu,
+ const GrDeviceCoordTexture* dstCopy,
GrGLProgramDesc* desc) {
// This should already have been caught
@@ -80,6 +82,7 @@
desc->fCoverageInput = kAttribute_ColorInput;
}
+ bool readsDst = false;
int lastEnabledStage = -1;
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
@@ -93,11 +96,22 @@
GrDrawState::kLocalCoords_AttribBindingsBit);
GrDrawEffect drawEffect(drawState.getStage(s), explicitLocalCoords);
desc->fEffectKeys[s] = factory.glEffectKey(drawEffect, gpu->glCaps());
+ if (effect->willReadDst()) {
+ readsDst = true;
+ }
} else {
desc->fEffectKeys[s] = 0;
}
}
+ if (readsDst) {
+ GrAssert(NULL != dstCopy);
+ desc->fDstRead = GrGLShaderBuilder::KeyForDstRead(dstCopy->texture(), gpu->glCaps());
+ GrAssert(0 != desc->fDstRead);
+ } else {
+ desc->fDstRead = 0;
+ }
+
desc->fDualSrcOutput = kNone_DualSrcOutput;
// Currently the experimental GS will only work with triangle prims (and it doesn't do anything
« no previous file with comments | « src/gpu/gl/GrGLProgramDesc.h ('k') | src/gpu/gl/GrGLShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698