blob: b367cf228d57fd5c0103cbb77332bc7b7a0dd4ae [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
reed@google.comac10a2d2010-12-22 21:39:39 +00008#ifndef GrTextContext_DEFINED
9#define GrTextContext_DEFINED
10
bsalomon@google.com858804d2012-10-15 14:25:50 +000011#include "GrContext.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000012#include "GrGlyph.h"
tomhudson@google.com375ff852012-06-29 18:37:57 +000013#include "GrPaint.h"
reed@google.comac10a2d2010-12-22 21:39:39 +000014
15class GrContext;
tomhudson@google.com375ff852012-06-29 18:37:57 +000016class GrDrawTarget;
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000017class GrFontScaler;
reed@google.comac10a2d2010-12-22 21:39:39 +000018
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000019/*
20 * This class wraps the state for a single text render
21 */
tomhudson@google.com375ff852012-06-29 18:37:57 +000022class GrTextContext {
bsalomon@google.comf4a9c822012-03-16 14:02:46 +000023public:
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000024 virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top,
25 GrFontScaler*) = 0;
26
27protected:
bsalomon@google.com0e354aa2012-10-08 20:44:25 +000028 GrTextContext(GrContext*, const GrPaint&);
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000029 virtual ~GrTextContext() {}
reed@google.comfa35e3d2012-06-26 20:16:17 +000030
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000031 GrPaint fPaint;
32 GrContext* fContext;
33 GrDrawTarget* fDrawTarget;
reed@google.comac10a2d2010-12-22 21:39:39 +000034
jvanverth@google.comc7a40fa2013-10-16 18:15:34 +000035 SkIRect fClipRect;
bsalomon@google.comf4a9c822012-03-16 14:02:46 +000036
37private:
reed@google.comac10a2d2010-12-22 21:39:39 +000038};
39
40#endif