aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.cpp
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-11 14:56:33 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-11 14:56:33 +0000
commitf3ccda7d4f54a149487dfe96e2cc7c2d7f28502b (patch)
treeb4b514e29f2c7ce8778fb97d4102d2a6f3a03342 /src/gpu/GrDrawTarget.cpp
parentcb325ceda16fab97fd3281785e6ae10fcb8dcf83 (diff)
Fix assumption that enabled stage implies texture is present
Review URL: http://codereview.appspot.com/6353087/ git-svn-id: http://skia.googlecode.com/svn/trunk@4532 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrDrawTarget.cpp')
-rw-r--r--src/gpu/GrDrawTarget.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gpu/GrDrawTarget.cpp b/src/gpu/GrDrawTarget.cpp
index 60095abbe3..bd922fe9c2 100644
--- a/src/gpu/GrDrawTarget.cpp
+++ b/src/gpu/GrDrawTarget.cpp
@@ -716,8 +716,7 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
maxValidVertex = geoSrc.fVertexCount;
break;
case kBuffer_GeometrySrcType:
- maxValidVertex = geoSrc.fVertexBuffer->sizeInBytes() /
- VertexSize(geoSrc.fVertexLayout);
+ maxValidVertex = geoSrc.fVertexBuffer->sizeInBytes() / VertexSize(geoSrc.fVertexLayout);
break;
}
if (maxVertex > maxValidVertex) {
@@ -761,16 +760,14 @@ bool GrDrawTarget::checkDraw(GrPrimitiveType type, int startVertex,
}
}
for (int s = 0; s < GrDrawState::kNumStages; ++s) {
- // We don't support using unpremultiplied textures with filters (other
- // than nearest). Alpha-premulling is not distributive WRT to filtering.
- // We'd have to filter each texel before filtering. We could do this for
- // our custom filters but we would also have to disable bilerp and do
- // a custom bilerp in the shader. Until Skia itself supports unpremul
- // configs there is no pressure to implement this.
- if (this->isStageEnabled(s) &&
+ // We don't support using unpremultiplied textures with filters (other than nearest). Alpha-
+ // premulling is not distributive WRT to filtering. We'd have to filter each texel before
+ // filtering. We could do this for our custom filters but we would also have to disable
+ // bilerp and do a custom bilerp in the shader. Until Skia itself supports unpremul configs
+ // there is no pressure to implement this.
+ if (drawState.getTexture(s) &&
GrPixelConfigIsUnpremultiplied(drawState.getTexture(s)->config()) &&
- GrSamplerState::kNearest_Filter !=
- drawState.getSampler(s).getFilter()) {
+ GrSamplerState::kNearest_Filter != drawState.getSampler(s).getFilter()) {
return false;
}
}