예제 #1
0
bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
    SkIRect devClipBounds;
    args.fPipelineBuilder->clip().getConservativeBounds(args.fPipelineBuilder->getRenderTarget(),
                                                        &devClipBounds);

    SkAutoTUnref<GrBatch> batch(create_hairline_batch(args.fColor, *args.fViewMatrix, *args.fPath,
                                                      *args.fStroke, devClipBounds));
    args.fTarget->drawBatch(*args.fPipelineBuilder, batch);

    return true;
}
bool GrAAHairLinePathRenderer::onDrawPath(GrDrawTarget* target,
                                          GrPipelineBuilder* pipelineBuilder,
                                          GrColor color,
                                          const SkMatrix& viewMatrix,
                                          const SkPath& path,
                                          const GrStrokeInfo& stroke,
                                          bool) {
    SkIRect devClipBounds;
    pipelineBuilder->clip().getConservativeBounds(pipelineBuilder->getRenderTarget(),
                                                  &devClipBounds);

    SkAutoTUnref<GrBatch> batch(create_hairline_batch(color, viewMatrix, path, stroke,
                                                      devClipBounds));
    target->drawBatch(pipelineBuilder, batch);

    return true;
}