skip paint->drawstate sampler copies when there is no texture

Review URL: http://codereview.appspot.com/5484053/




git-svn-id: http://skia.googlecode.com/svn/trunk@2859 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
bsalomon@google.com 2011-12-12 21:57:03 +00:00
parent 089130c24e
commit f864ec467d

View File

@ -1913,7 +1913,9 @@ void GrContext::setPaint(const GrPaint& paint, GrDrawTarget* target) {
int s = i + GrPaint::kFirstTextureStage;
drawState->setTexture(s, paint.getTexture(i));
ASSERT_OWNED_RESOURCE(paint.getTexture(i));
*drawState->sampler(s) = paint.getTextureSampler(i);
if (paint.getTexture(i)) {
*drawState->sampler(s) = paint.getTextureSampler(i);
}
}
drawState->setFirstCoverageStage(GrPaint::kFirstMaskStage);
@ -1922,7 +1924,9 @@ void GrContext::setPaint(const GrPaint& paint, GrDrawTarget* target) {
int s = i + GrPaint::kFirstMaskStage;
drawState->setTexture(s, paint.getMask(i));
ASSERT_OWNED_RESOURCE(paint.getMask(i));
*drawState->sampler(s) = paint.getMaskSampler(i);
if (paint.getMask(i)) {
*drawState->sampler(s) = paint.getMaskSampler(i);
}
}
drawState->setColor(paint.fColor);