Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: src/gpu/GrStencilAndCoverTextContext.h

Issue 196133014: Implement text rendering with NVPR (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix VS "performance warning" converting int to bool Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrStencilAndCoverTextContext.h
diff --git a/src/gpu/GrStencilAndCoverTextContext.h b/src/gpu/GrStencilAndCoverTextContext.h
new file mode 100644
index 0000000000000000000000000000000000000000..2e79f5c9b7e43f59dcf5234bd780eb81de6e5616
--- /dev/null
+++ b/src/gpu/GrStencilAndCoverTextContext.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2014 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrStencilAndCoverTextContext_DEFINED
+#define GrStencilAndCoverTextContext_DEFINED
+
+#include "GrTextContext.h"
+#include "GrDrawState.h"
+#include "SkStrokeRec.h"
+
+class GrTextStrike;
+class GrPath;
+
+/*
+ * This class implements text rendering using stencil and cover path rendering
+ * (by the means of GrDrawTarget::drawPath).
+ * This class exposes the functionality through GrTextContext interface.
+ */
+class GrStencilAndCoverTextContext : public GrTextContext {
+public:
+ GrStencilAndCoverTextContext(GrContext*, const SkDeviceProperties&);
+ virtual ~GrStencilAndCoverTextContext();
+
+ virtual void drawText(const GrPaint&, const SkPaint&, const char text[],
+ size_t byteLength,
+ SkScalar x, SkScalar y) SK_OVERRIDE;
+ virtual void drawPosText(const GrPaint&, const SkPaint&,
+ const char text[], size_t byteLength,
+ const SkScalar pos[], SkScalar constY,
+ int scalarsPerPosition) SK_OVERRIDE;
+
+ virtual bool canDraw(const SkPaint& paint) SK_OVERRIDE;
+
+private:
+ void init(const GrPaint&, const SkPaint&, size_t textByteLength);
+ void appendGlyph(GrGlyph::PackedID, const SkPoint&,
+ GrTextStrike*, GrFontScaler*);
+ void finish();
+
+ GrDrawState::AutoRestoreEffects fStateRestore;
+ SkScalar fTextRatio;
+ SkStrokeRec fStroke;
+ SkTDArray<const GrPath*> fPaths;
+ SkTDArray<SkMatrix> fTransforms;
+ SkPath fTmpPath;
+ SkMatrix fGlyphTransform;
+ bool fNeedsDeviceSpaceGlyphs;
+};
+
+#endif
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrStencilAndCoverTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698