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

Unified Diff: src/gpu/GrDrawTarget.cpp

Issue 16952006: Replace fixed-size array of effect stages in GrDrawState with two appendable arrays, one for color,… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comments Created 7 years, 6 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/GrGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDrawTarget.cpp
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 02bc8d740b92849bc3f2e960ede9d62b33af7d63..1f3b630f01d83d4ac2872ad8448f056400787a08 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -387,14 +387,21 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
}
GrAssert(NULL != drawState.getRenderTarget());
- for (int s = 0; s < GrDrawState::kNumStages; ++s) {
- if (drawState.isStageEnabled(s)) {
- const GrEffectRef& effect = *drawState.getStage(s).getEffect();
- int numTextures = effect->numTextures();
- for (int t = 0; t < numTextures; ++t) {
- GrTexture* texture = effect->texture(t);
- GrAssert(texture->asRenderTarget() != drawState.getRenderTarget());
- }
+
+ for (int s = 0; s < drawState.numColorStages(); ++s) {
+ const GrEffectRef& effect = *drawState.getColorStage(s).getEffect();
+ int numTextures = effect->numTextures();
+ for (int t = 0; t < numTextures; ++t) {
+ GrTexture* texture = effect->texture(t);
+ GrAssert(texture->asRenderTarget() != drawState.getRenderTarget());
+ }
+ }
+ for (int s = 0; s < drawState.numCoverageStages(); ++s) {
+ const GrEffectRef& effect = *drawState.getCoverageStage(s).getEffect();
+ int numTextures = effect->numTextures();
+ for (int t = 0; t < numTextures; ++t) {
+ GrTexture* texture = effect->texture(t);
+ GrAssert(texture->asRenderTarget() != drawState.getRenderTarget());
}
}
@@ -912,7 +919,7 @@ bool GrDrawTarget::onCopySurface(GrSurface* dst,
matrix.setTranslate(SkIntToScalar(srcRect.fLeft - dstPoint.fX),
SkIntToScalar(srcRect.fTop - dstPoint.fY));
matrix.postIDiv(tex->width(), tex->height());
- this->drawState()->createTextureEffect(0, tex, matrix);
+ this->drawState()->addColorTextureEffect(tex, matrix);
SkIRect dstRect = SkIRect::MakeXYWH(dstPoint.fX,
dstPoint.fY,
srcRect.width(),
« no previous file with comments | « src/gpu/GrDrawTarget.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698