summaryrefslogtreecommitdiff
path: root/libs/hwui/GlopBuilder.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-02-12 10:41:39 -0800
committer Chris Craik <ccraik@google.com> 2015-02-12 16:16:57 -0800
commit30036092b40badecbe64d9c2bff4850132147f78 (patch)
treeea5a86b5bd90dd3c2fd0c16ce7676cdf2fcd678a /libs/hwui/GlopBuilder.cpp
parent5b14d9893aced2b3ba46f1d90a0752c1a9a43f2f (diff)
Glop path texture support
Change-Id: I505eb05991ca4c9b2e01e49988b8f962fad51462
Diffstat (limited to 'libs/hwui/GlopBuilder.cpp')
-rw-r--r--libs/hwui/GlopBuilder.cpp26
1 files changed, 24 insertions, 2 deletions
diff --git a/libs/hwui/GlopBuilder.cpp b/libs/hwui/GlopBuilder.cpp
index e56988c8dc74..91e0f8916f6e 100644
--- a/libs/hwui/GlopBuilder.cpp
+++ b/libs/hwui/GlopBuilder.cpp
@@ -246,6 +246,7 @@ GlopBuilder& GlopBuilder::setFillTexturePaint(Texture& texture, bool isAlphaMask
mOutGlop->fill.texture = &texture;
mOutGlop->fill.textureFilter = PaintUtils::getFilter(paint);
+ mOutGlop->fill.textureClamp = GL_CLAMP_TO_EDGE;
if (paint) {
int color = paint->getColor();
@@ -289,7 +290,8 @@ GlopBuilder& GlopBuilder::setFillPaint(const SkPaint& paint, float alphaScale) {
REQUIRE_STAGES(kMeshStage);
mOutGlop->fill.texture = nullptr;
- mOutGlop->fill.textureFilter = GL_NEAREST;
+ mOutGlop->fill.textureFilter = GL_INVALID_ENUM;
+ mOutGlop->fill.textureClamp = GL_INVALID_ENUM;
setFill(paint.getColor(), alphaScale, PaintUtils::getXfermode(paint.getXfermode()),
paint.getShader(), paint.getColorFilter());
@@ -297,6 +299,27 @@ GlopBuilder& GlopBuilder::setFillPaint(const SkPaint& paint, float alphaScale) {
return *this;
}
+GlopBuilder& GlopBuilder::setFillPathTexturePaint(Texture& texture,
+ const SkPaint& paint, float alphaScale) {
+ TRIGGER_STAGE(kFillStage);
+ REQUIRE_STAGES(kMeshStage);
+
+ mOutGlop->fill.texture = &texture;
+
+ //specify invalid, since these are always static for path textures
+ mOutGlop->fill.textureFilter = GL_INVALID_ENUM;
+ mOutGlop->fill.textureClamp = GL_INVALID_ENUM;
+
+ setFill(paint.getColor(), alphaScale, PaintUtils::getXfermode(paint.getXfermode()),
+ paint.getShader(), paint.getColorFilter());
+
+ mDescription.modulate = mOutGlop->fill.color.a < 1.0f
+ || mOutGlop->fill.color.r > 0.0f
+ || mOutGlop->fill.color.g > 0.0f
+ || mOutGlop->fill.color.b > 0.0f;
+ return *this;
+}
+
////////////////////////////////////////////////////////////////////////////////
// Transform
////////////////////////////////////////////////////////////////////////////////
@@ -311,7 +334,6 @@ GlopBuilder& GlopBuilder::setTransformClip(const Matrix4& ortho,
return *this;
}
-
////////////////////////////////////////////////////////////////////////////////
// ModelView
////////////////////////////////////////////////////////////////////////////////