2011-07-28 14:26:00 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2010-12-22 21:39:39 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef GrTextContext_DEFINED
|
|
|
|
#define GrTextContext_DEFINED
|
|
|
|
|
2012-10-15 14:25:50 +00:00
|
|
|
#include "GrContext.h"
|
2010-12-22 21:39:39 +00:00
|
|
|
#include "GrGlyph.h"
|
2012-06-29 18:37:57 +00:00
|
|
|
#include "GrPaint.h"
|
2010-12-22 21:39:39 +00:00
|
|
|
|
|
|
|
class GrContext;
|
2012-06-29 18:37:57 +00:00
|
|
|
class GrDrawTarget;
|
2013-10-16 18:15:34 +00:00
|
|
|
class GrFontScaler;
|
2010-12-22 21:39:39 +00:00
|
|
|
|
2013-10-16 18:15:34 +00:00
|
|
|
/*
|
|
|
|
* This class wraps the state for a single text render
|
|
|
|
*/
|
2012-06-29 18:37:57 +00:00
|
|
|
class GrTextContext {
|
|
|
|
public:
|
2013-10-16 18:15:34 +00:00
|
|
|
virtual void drawPackedGlyph(GrGlyph::PackedID, GrFixed left, GrFixed top,
|
|
|
|
GrFontScaler*) = 0;
|
|
|
|
|
|
|
|
protected:
|
2012-10-08 20:44:25 +00:00
|
|
|
GrTextContext(GrContext*, const GrPaint&);
|
2013-10-16 18:15:34 +00:00
|
|
|
virtual ~GrTextContext() {}
|
2010-12-22 21:39:39 +00:00
|
|
|
|
2013-10-16 18:15:34 +00:00
|
|
|
GrPaint fPaint;
|
|
|
|
GrContext* fContext;
|
|
|
|
GrDrawTarget* fDrawTarget;
|
2012-06-29 18:37:57 +00:00
|
|
|
|
2013-10-16 18:15:34 +00:00
|
|
|
SkIRect fClipRect;
|
2012-06-29 18:37:57 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
};
|
2010-12-22 21:39:39 +00:00
|
|
|
|
2012-03-16 14:02:46 +00:00
|
|
|
#endif
|