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

Unified Diff: src/gpu/GrContext.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/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 39d0db33b444792a8216cd00ce74d4eded79769a..0f155b25e64aa73dbd70a38e8e8fda6dd91d0f4a 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1764,20 +1764,16 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture,
return NULL;
}
- GrPaint paint;
- paint.reset();
-
for (int i = 1; i < scaleFactorX || i < scaleFactorY; i *= 2) {
+ GrPaint paint;
SkMatrix matrix;
matrix.setIDiv(srcTexture->width(), srcTexture->height());
this->setRenderTarget(dstTexture->asRenderTarget());
SkRect dstRect(srcRect);
scale_rect(&dstRect, i < scaleFactorX ? 0.5f : 1.0f,
i < scaleFactorY ? 0.5f : 1.0f);
-
- paint.colorStage(0)->setEffect(GrSimpleTextureEffect::Create(srcTexture,
- matrix,
- true))->unref();
+ GrTextureParams params(SkShader::kClamp_TileMode, true);
+ paint.addColorTextureEffect(srcTexture, matrix, params);
this->drawRectToRect(paint, dstRect, srcRect);
srcRect = dstRect;
srcTexture = dstTexture;
@@ -1795,7 +1791,7 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture,
radiusX, srcIRect.height());
this->clear(&clearRect, 0x0);
}
-
+ GrPaint paint;
this->setRenderTarget(dstTexture->asRenderTarget());
AutoRestoreEffects are;
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are);
@@ -1815,6 +1811,7 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture,
}
this->setRenderTarget(dstTexture->asRenderTarget());
+ GrPaint paint;
AutoRestoreEffects are;
GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are);
convolve_gaussian(target, srcTexture, srcRect, sigmaY, radiusY,
@@ -1833,12 +1830,14 @@ GrTexture* GrContext::gaussianBlur(GrTexture* srcTexture,
1, srcIRect.height());
this->clear(&clearRect, 0x0);
SkMatrix matrix;
- // FIXME: This should be mitchell, not bilinear.
matrix.setIDiv(srcTexture->width(), srcTexture->height());
this->setRenderTarget(dstTexture->asRenderTarget());
- paint.colorStage(0)->setEffect(GrSimpleTextureEffect::Create(srcTexture,
- matrix,
- true))->unref();
+
+ GrPaint paint;
+ // FIXME: This should be mitchell, not bilinear.
+ GrTextureParams params(SkShader::kClamp_TileMode, true);
+ paint.addColorTextureEffect(srcTexture, matrix, params);
+
SkRect dstRect(srcRect);
scale_rect(&dstRect, (float) scaleFactorX, (float) scaleFactorY);
this->drawRectToRect(paint, dstRect, srcRect);
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrDrawState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698