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