1 /* 2 * Copyright 2010 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 9 #include "GrTextContext.h" 10 11 GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint) : fPaint(paint) { 12 fContext = context; 13 14 const GrClipData* clipData = context->getClip(); 15 16 SkRect devConservativeBound; 17 clipData->fClipStack->getConservativeBounds( 18 -clipData->fOrigin.fX, 19 -clipData->fOrigin.fY, 20 context->getRenderTarget()->width(), 21 context->getRenderTarget()->height(), 22 &devConservativeBound); 23 24 devConservativeBound.roundOut(&fClipRect); 25 26 fDrawTarget = fContext->getTextTarget(); 27 } 28