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/GrDrawTarget.h

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/core/SkXfermode.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.h
===================================================================
--- src/gpu/GrDrawTarget.h (revision 8448)
+++ src/gpu/GrDrawTarget.h (working copy)
@@ -655,24 +655,35 @@
}
const SkRect* getDevBounds() const { return fDevBounds; }
+ // NULL if no copy of the dst is needed for the draw.
+ const GrDeviceCoordTexture* getDstCopy() const {
+ if (NULL != fDstCopy.texture()) {
+ return &fDstCopy;
+ } else {
+ return NULL;
+ }
+ }
+
private:
DrawInfo() { fDevBounds = NULL; }
friend class GrDrawTarget;
- GrPrimitiveType fPrimitiveType;
+ GrPrimitiveType fPrimitiveType;
- int fStartVertex;
- int fStartIndex;
- int fVertexCount;
- int fIndexCount;
+ int fStartVertex;
+ int fStartIndex;
+ int fVertexCount;
+ int fIndexCount;
- int fInstanceCount;
- int fVerticesPerInstance;
- int fIndicesPerInstance;
+ int fInstanceCount;
+ int fVerticesPerInstance;
+ int fIndicesPerInstance;
- SkRect fDevBoundsStorage;
- SkRect* fDevBounds;
+ SkRect fDevBoundsStorage;
+ SkRect* fDevBounds;
+
+ GrDeviceCoordTexture fDstCopy;
};
private:
@@ -714,6 +725,10 @@
void releasePreviousVertexSource();
void releasePreviousIndexSource();
+ // Makes a copy of the dst if it is necessary for the draw. Returns false if a copy is required
+ // but couldn't be made. Otherwise, returns true.
+ bool setupDstReadIfNecessary(DrawInfo* info);
+
enum {
kPreallocGeoSrcStateStackCnt = 4,
};
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | src/gpu/GrDrawTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698