aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipMaskManager.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-09 16:32:28 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-07-09 16:32:28 +0000
commit5dfb67219a308edecafbe09eebb35c5e149db6e6 (patch)
treecf63f8899846e2c94c71af0df46f2b01dc6ab316 /src/gpu/GrClipMaskManager.cpp
parentd3ba5cc85e24896f980ed1ba6e3f4495973baeb3 (diff)
Left over cleanup from r4416 (fix for lingering AA clip mask bug)
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r--src/gpu/GrClipMaskManager.cpp39
1 files changed, 9 insertions, 30 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index cdc13f0ca7..c37affa939 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -360,40 +360,19 @@ bool draw_path_in_software(GrContext* context,
bool doAA,
const GrIRect& resultBounds) {
- GrAutoScratchTexture ast;
-
- if (!GrSWMaskHelper::DrawToTexture(context, path, resultBounds, fill,
- &ast, doAA, NULL)) {
+ SkAutoTUnref<GrTexture> texture(
+ GrSWMaskHelper::DrawPathMaskToTexture(context, path,
+ resultBounds, fill,
+ doAA, NULL));
+ if (NULL == texture) {
return false;
}
- // TODO: merge this with the similar code in the GrSoftwarePathRenderer.cpp
- SkAutoTUnref<GrTexture> texture(ast.detach());
- GrAssert(NULL != texture);
+ // The ClipMaskManager accumulates the clip mask in the UL corner
+ GrIRect rect = GrIRect::MakeWH(resultBounds.width(), resultBounds.height());
+
+ GrSWMaskHelper::DrawToTargetWithPathMask(texture, gpu, 0, rect);
- GrDrawState::StageMask stageMask = 0;
- GrDrawTarget::AutoDeviceCoordDraw adcd(gpu, stageMask);
- enum {
- // the SW path renderer shares this stage with glyph
- // rendering (kGlyphMaskStage in GrBatchedTextContext)
- kPathMaskStage = GrPaint::kTotalStages,
- };
- GrAssert(NULL == gpu->drawState()->getTexture(kPathMaskStage));
- gpu->drawState()->setTexture(kPathMaskStage, texture);
- gpu->drawState()->sampler(kPathMaskStage)->reset();
- GrScalar w = GrIntToScalar(resultBounds.width());
- GrScalar h = GrIntToScalar(resultBounds.height());
- GrRect maskRect = GrRect::MakeWH(w / texture->width(),
- h / texture->height());
-
- const GrRect* srcRects[GrDrawState::kNumStages] = {NULL};
- srcRects[kPathMaskStage] = &maskRect;
- stageMask |= 1 << kPathMaskStage;
- GrRect dstRect = GrRect::MakeWH(
- SK_Scalar1* resultBounds.width(),
- SK_Scalar1* resultBounds.height());
- gpu->drawRect(dstRect, NULL, stageMask, srcRects, NULL);
- gpu->drawState()->setTexture(kPathMaskStage, NULL);
GrAssert(!GrIsFillInverted(fill));
return true;
}