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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 12531015: Adds local coords to GrEffect system. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: 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/GrDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
===================================================================
--- src/gpu/GrDrawTarget.cpp (revision 8241)
+++ src/gpu/GrDrawTarget.cpp (working copy)
@@ -529,11 +529,9 @@
void GrDrawTarget::drawRect(const GrRect& rect,
const SkMatrix* matrix,
- const GrRect* srcRect,
- const SkMatrix* srcMatrix,
- int stage) {
+ const GrRect* localRect,
+ const SkMatrix* localMatrix) {
GrAttribBindings bindings = 0;
- uint32_t explicitCoordMask = 0;
// position + (optional) texture coord
static const GrVertexAttrib kAttribs[] = {
{kVec2f_GrVertexAttribType, 0},
@@ -541,16 +539,15 @@
};
int attribCount = 1;
- if (NULL != srcRect) {
- bindings |= GrDrawState::ExplicitTexCoordAttribBindingsBit(stage);
+ if (NULL != localRect) {
+ bindings |= GrDrawState::kLocalCoords_AttribBindingsBit;
attribCount = 2;
- this->drawState()->setAttribIndex(GrDrawState::kTexCoord_AttribIndex, 1);
- explicitCoordMask = (1 << stage);
+ this->drawState()->setAttribIndex(GrDrawState::kLocalCoords_AttribIndex, 1);
}
GrDrawState::AutoViewMatrixRestore avmr;
if (NULL != matrix) {
- avmr.set(this->drawState(), *matrix, explicitCoordMask);
+ avmr.set(this->drawState(), *matrix);
}
this->drawState()->setVertexAttribs(kAttribs, attribCount);
@@ -564,15 +561,15 @@
size_t vsize = this->drawState()->getVertexSize();
geo.positions()->setRectFan(rect.fLeft, rect.fTop, rect.fRight, rect.fBottom, vsize);
- if (NULL != srcRect) {
+ if (NULL != localRect) {
GrAssert(attribCount == 2);
GrPoint* coords = GrTCast<GrPoint*>(GrTCast<intptr_t>(geo.vertices()) +
kAttribs[1].fOffset);
- coords->setRectFan(srcRect->fLeft, srcRect->fTop,
- srcRect->fRight, srcRect->fBottom,
- vsize);
- if (NULL != srcMatrix) {
- srcMatrix->mapPointsWithStride(coords, vsize, 4);
+ coords->setRectFan(localRect->fLeft, localRect->fTop,
+ localRect->fRight, localRect->fBottom,
+ vsize);
+ if (NULL != localMatrix) {
+ localMatrix->mapPointsWithStride(coords, vsize, 4);
}
}
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrInOrderDrawBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698