blob: 9e9162878dff4e92a0054a3432d40d20fb697afe [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.orgf1d63aa2014-01-22 22:01:41 +000011GrTextContext::GrTextContext(GrContext* context, const GrPaint& paint) : fPaint(paint) {
tomhudson@google.com375ff852012-06-29 18:37:57 +000012 fContext = context;
tomhudson@google.com375ff852012-06-29 18:37:57 +000013
robertphillips@google.combeb1af72012-07-26 18:52:16 +000014 const GrClipData* clipData = context->getClip();
15
commit-bot@chromium.orgfd03d4a2013-07-17 21:39:42 +000016 SkRect devConservativeBound;
robertphillips@google.com641f8b12012-07-31 19:15:58 +000017 clipData->fClipStack->getConservativeBounds(
18 -clipData->fOrigin.fX,
19 -clipData->fOrigin.fY,
20 context->getRenderTarget()->width(),
21 context->getRenderTarget()->height(),
22 &devConservativeBound);
robertphillips@google.combeb1af72012-07-26 18:52:16 +000023
robertphillips@google.com641f8b12012-07-31 19:15:58 +000024 devConservativeBound.roundOut(&fClipRect);
robertphillips@google.combeb1af72012-07-26 18:52:16 +000025
bsalomon@google.com21c10c52013-06-13 17:44:07 +000026 fDrawTarget = fContext->getTextTarget();
reed@google.comac10a2d2010-12-22 21:39:39 +000027}