blob: 77e98d2fd5fa30263707f34cf749f4099ba163d7 [file] [log] [blame]
/*
* Copyright 2010 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "GrTextContext.h"
GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint,
const SkPaint& skPaint) : fPaint(paint), fSkPaint(skPaint) {
fContext = context;
const GrClipData* clipData = context->getClip();
SkRect devConservativeBound;
clipData->fClipStack->getConservativeBounds(
-clipData->fOrigin.fX,
-clipData->fOrigin.fY,
context->getRenderTarget()->width(),
context->getRenderTarget()->height(),
&devConservativeBound);
devConservativeBound.roundOut(&fClipRect);
fDrawTarget = fContext->getTextTarget();
}