blob: 77e98d2fd5fa30263707f34cf749f4099ba163d7 [file] [log] [blame]
reed@google.comac10a2d2010-12-22 21:39:39 +00001/*
epoger@google.comec3ed6a2011-07-28 14:26:00 +00002 * 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.
reed@google.comac10a2d2010-12-22 21:39:39 +00006 */
7
8
tomhudson@google.com375ff852012-06-29 18:37:57 +00009#include "GrTextContext.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000010
commit-bot@chromium.orgcc40f062014-01-24 14:38:27 +000011GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint,
12 const SkPaint& skPaint) : fPaint(paint), fSkPaint(skPaint) {
tomhudson@google.com375ff852012-06-29 18:37:57 +000013 fContext = context;
tomhudson@google.com375ff852012-06-29 18:37:57 +000014
robertphillips@google.combeb1af72012-07-26 18:52:16 +000015 const GrClipData* clipData = context->getClip();
16
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000017 SkRect devConservativeBound;
robertphillips@google.com641f8b12012-07-31 19:15:58 +000018 clipData->fClipStack->getConservativeBounds(
19 -clipData->fOrigin.fX,
20 -clipData->fOrigin.fY,
21 context->getRenderTarget()->width(),
22 context->getRenderTarget()->height(),
23 &devConservativeBound);
robertphillips@google.combeb1af72012-07-26 18:52:16 +000024
robertphillips@google.com641f8b12012-07-31 19:15:58 +000025 devConservativeBound.roundOut(&fClipRect);
robertphillips@google.combeb1af72012-07-26 18:52:16 +000026
bsalomon@google.com21c10c52013-06-13 17:44:07 +000027 fDrawTarget = fContext->getTextTarget();
reed@google.comac10a2d2010-12-22 21:39:39 +000028}