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

Unified Diff: src/gpu/GrClipMaskManager.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/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
===================================================================
--- src/gpu/GrClipMaskManager.cpp (revision 8241)
+++ src/gpu/GrClipMaskManager.cpp (working copy)
@@ -40,6 +40,9 @@
static const int kMaskStage = GrPaint::kTotalStages+1;
SkMatrix mat;
+ // We want to use device coords to compute the texture coordinates. We set our matrix to be
+ // equal to the view matrix followed by an offset to the devBound, and then a scaling matrix to
+ // normalized coords. We apply this matrix to the vertex positions rather than local coords.
mat.setIDiv(result->width(), result->height());
mat.preTranslate(SkIntToScalar(-devBound.fLeft),
SkIntToScalar(-devBound.fTop));
@@ -51,7 +54,9 @@
GrTextureDomainEffect::Create(result,
mat,
GrTextureDomainEffect::MakeTexelDomain(result, domainTexels),
- GrTextureDomainEffect::kDecal_WrapMode))->unref();
+ GrTextureDomainEffect::kDecal_WrapMode,
+ false,
+ GrEffect::kPosition_CoordsType))->unref();
}
bool path_needs_SW_renderer(GrContext* context,
@@ -354,7 +359,8 @@
GrTextureDomainEffect::Create(srcMask,
sampleM,
GrTextureDomainEffect::MakeTexelDomain(srcMask, srcBound),
- GrTextureDomainEffect::kDecal_WrapMode))->unref();
+ GrTextureDomainEffect::kDecal_WrapMode,
+ false))->unref();
fGpu->drawSimpleRect(SkRect::MakeFromIRect(dstBound), NULL);
drawState->disableStage(0);
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698