Fix TextureView texture filtering.
bug:11748993
TextureView should always be drawn with linear filtering if drawing a
buffer sized differently from the layer.
This fixes a bug where TextureViews that were sized differently from
their contents wouldn't be drawn with texture filtering, causing
visible scaling artifacts.
Change-Id: I8a5d27452fe7269ec53896992f37cff51e3ce15a
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index 8cc027a..f6538f2 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -127,6 +127,14 @@
return texture.blend;
}
+ inline void setForceFilter(bool forceFilter) {
+ this->forceFilter = forceFilter;
+ }
+
+ inline bool getForceFilter() const {
+ return forceFilter;
+ }
+
inline void setAlpha(int alpha) {
this->alpha = alpha;
}
@@ -343,9 +351,15 @@
SkColorFilter* colorFilter;
/**
+ * Indicates raster data backing the layer is scaled, requiring filtration.
+ */
+ bool forceFilter;
+
+ /**
* Opacity of the layer.
*/
int alpha;
+
/**
* Blending mode of the layer.
*/