aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDraw.h
diff options
context:
space:
mode:
authorGravatar Herb Derby <herb@google.com>2018-07-23 16:20:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-26 18:16:46 +0000
commit1347144e3ef790c9431d18a8005dcf8914899b1d (patch)
tree212383343d996fcc2a9249760f93bff317ec4490 /src/core/SkDraw.h
parent97e858f359d165b35a304a840d43c2b6412fc241 (diff)
Centralize bitmap glyph positioning
Centralize all text drawing for bitmap devices into SkGlyphRunListDrawer. All drawing decisions are encapsulated in this class, and its behavior only depends on contant properties of the device. The method drawForBitmap will probably have to be converted to a template based in preliminary performance numbers. Change-Id: Id21567c1511eee9d2e9e20c7ae93544530cfdb81 Reviewed-on: https://skia-review.googlesource.com/143106 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
Diffstat (limited to 'src/core/SkDraw.h')
-rw-r--r--src/core/SkDraw.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core/SkDraw.h b/src/core/SkDraw.h
index a64abe74ff..a199215878 100644
--- a/src/core/SkDraw.h
+++ b/src/core/SkDraw.h
@@ -11,6 +11,7 @@
#define SkDraw_DEFINED
#include "SkCanvas.h"
+#include "SkGlyphRun.h"
#include "SkMask.h"
#include "SkPaint.h"
#include "SkPixmap.h"
@@ -66,16 +67,7 @@ public:
void drawPosText(const char text[], size_t byteLength,
const SkScalar pos[], int scalarsPerPosition,
const SkPoint& offset, const SkPaint&, const SkSurfaceProps*) const;
-
- void drawGlyphRunAsPaths(
- SkGlyphRun* glyphRun, SkPoint origin, const SkSurfaceProps* props) const;
-
- void drawGlyphRunAsSubpixelMask(
- SkGlyphCache* cache, SkGlyphRun* glyphRun, SkPoint origin) const;
-
- void drawGlyphRunAsFullpixelMask(
- SkGlyphCache* cache, SkGlyphRun* glyphRun, SkPoint origin) const;
- void drawGlyphRunList(SkGlyphRunList* glyphRunList, const SkSurfaceProps*) const;
+ void drawGlyphRunList(SkGlyphRunList* glyphRunList, SkGlyphRunListDrawer* glyphDraw) const;
void drawVertices(SkVertices::VertexMode mode, int vertexCount,
const SkPoint vertices[], const SkPoint textures[],
const SkColor colors[], const SkVertices::BoneIndices boneIndices[],
@@ -132,6 +124,9 @@ public:
const SkPaint&, const SkSurfaceProps*) const;
static SkScalar ComputeResScaleForStroking(const SkMatrix& );
private:
+ void blitARGB32Mask(const SkMask& mask, const SkPaint& paint) const;
+ SkGlyphRunListDrawer::PerMask drawOneMaskCreator(
+ const SkPaint& paint, SkArenaAlloc* alloc) const;
void drawBitmapAsMask(const SkBitmap&, const SkPaint&) const;
void drawPath(const SkPath&, const SkPaint&, const SkMatrix* preMatrix,
@@ -157,11 +152,11 @@ private:
public:
SkPixmap fDst;
- const SkMatrix* fMatrix; // required
- const SkRasterClip* fRC; // required
+ const SkMatrix* fMatrix{nullptr}; // required
+ const SkRasterClip* fRC{nullptr}; // required
// optional, will be same dimensions as fDst if present
- const SkPixmap* fCoverage = nullptr;
+ const SkPixmap* fCoverage{nullptr};
#ifdef SK_DEBUG
void validate() const;