Use glops for text rendering
Change-Id: I5e155c8baf3149f0ff231ec3c89dbff6bb8eae92
diff --git a/libs/hwui/PathCache.cpp b/libs/hwui/PathCache.cpp
index 5b2e5e2..2703072 100644
--- a/libs/hwui/PathCache.cpp
+++ b/libs/hwui/PathCache.cpp
@@ -40,25 +40,25 @@
// Cache entries
///////////////////////////////////////////////////////////////////////////////
-PathDescription::PathDescription():
- type(kShapeNone),
- join(SkPaint::kDefault_Join),
- cap(SkPaint::kDefault_Cap),
- style(SkPaint::kFill_Style),
- miter(4.0f),
- strokeWidth(1.0f),
- pathEffect(nullptr) {
+PathDescription::PathDescription()
+ : type(kShapeNone)
+ , join(SkPaint::kDefault_Join)
+ , cap(SkPaint::kDefault_Cap)
+ , style(SkPaint::kFill_Style)
+ , miter(4.0f)
+ , strokeWidth(1.0f)
+ , pathEffect(nullptr) {
memset(&shape, 0, sizeof(Shape));
}
-PathDescription::PathDescription(ShapeType type, const SkPaint* paint):
- type(type),
- join(paint->getStrokeJoin()),
- cap(paint->getStrokeCap()),
- style(paint->getStyle()),
- miter(paint->getStrokeMiter()),
- strokeWidth(paint->getStrokeWidth()),
- pathEffect(paint->getPathEffect()) {
+PathDescription::PathDescription(ShapeType type, const SkPaint* paint)
+ : type(type)
+ , join(paint->getStrokeJoin())
+ , cap(paint->getStrokeCap())
+ , style(paint->getStyle())
+ , miter(paint->getStrokeMiter())
+ , strokeWidth(paint->getStrokeWidth())
+ , pathEffect(paint->getPathEffect()) {
memset(&shape, 0, sizeof(Shape));
}
@@ -132,18 +132,6 @@
canvas.drawPath(*path, pathPaint);
}
-static PathTexture* createTexture(float left, float top, float offset,
- uint32_t width, uint32_t height, uint32_t id) {
- PathTexture* texture = new PathTexture(Caches::getInstance());
- texture->left = left;
- texture->top = top;
- texture->offset = offset;
- texture->width = width;
- texture->height = height;
- texture->generation = id;
- return texture;
-}
-
///////////////////////////////////////////////////////////////////////////////
// Cache constructor/destructor
///////////////////////////////////////////////////////////////////////////////
@@ -267,7 +255,8 @@
SkBitmap bitmap;
drawPath(path, paint, bitmap, left, top, offset, width, height);
- PathTexture* texture = createTexture(left, top, offset, width, height,
+ PathTexture* texture = new PathTexture(Caches::getInstance(),
+ left, top, offset, width, height,
path->getGenerationID());
generateTexture(entry, &bitmap, texture);
@@ -441,7 +430,7 @@
if (generate) {
// It is important to specify the generation ID so we do not
// attempt to precache the same path several times
- texture = createTexture(0.0f, 0.0f, 0.0f, 0, 0, path->getGenerationID());
+ texture = new PathTexture(Caches::getInstance(), path->getGenerationID());
sp<PathTask> task = new PathTask(path, paint, texture);
texture->setTask(task);