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

Unified Diff: src/effects/SkXfermodeImageFilter.cpp

Issue 18686007: Make GrPaint have a variable sized array of color and coverage stages rather than a fixed size. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rob's comments Created 7 years, 5 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/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/SkXfermodeImageFilter.cpp
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index a318ceb9088b0a2c6359043f1a062d448d8558f7..3df59a87d2bdc425aa2a39861cf49ec6d40edb28 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -119,23 +119,23 @@ bool SkXfermodeImageFilter::filterImageGPU(Proxy* proxy,
SkIntToScalar(backgroundOffset.fY-foregroundOffset.fY));
- GrPaint paint;
SkRect srcRect;
src.getBounds(&srcRect);
if (NULL != xferEffect) {
- paint.colorStage(0)->setEffect(
- GrSimpleTextureEffect::Create(foregroundTex, foregroundMatrix))->unref();
- paint.colorStage(1)->setEffect(xferEffect)->unref();
+ GrPaint paint;
+ paint.addColorTextureEffect(foregroundTex, foregroundMatrix);
+ paint.addColorEffect(xferEffect)->unref();
context->drawRect(paint, srcRect);
} else {
+ GrPaint backgroundPaint;
SkMatrix backgroundMatrix = GrEffect::MakeDivByTextureWHMatrix(backgroundTex);
- paint.colorStage(0)->setEffect(
- GrSimpleTextureEffect::Create(backgroundTex, backgroundMatrix))->unref();
- context->drawRect(paint, srcRect);
- paint.setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm));
- paint.colorStage(0)->setEffect(
- GrSimpleTextureEffect::Create(foregroundTex, foregroundMatrix))->unref();
- context->drawRect(paint, srcRect);
+ backgroundPaint.addColorTextureEffect(backgroundTex, backgroundMatrix);
+ context->drawRect(backgroundPaint, srcRect);
+
+ GrPaint foregroundPaint;
+ foregroundPaint.setBlendFunc(sk_blend_to_grblend(sm), sk_blend_to_grblend(dm));
+ foregroundPaint.addColorTextureEffect(foregroundTex, foregroundMatrix);
+ context->drawRect(foregroundPaint, srcRect);
}
offset->fX += backgroundOffset.fX;
offset->fY += backgroundOffset.fY;
« no previous file with comments | « src/effects/SkMorphologyImageFilter.cpp ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698