Added crop rect to LayerDrawable to not crop TextureView.
Verified manually with ExoPlayer that TextureView isn't cropping.
Test: Did the manual test and
atest TextureViewCameraTest
atest TextureViewSnapshotTest
atest TextureViewStressTest
atest TextureViewTest
atest PixelCopyTest
atest BitmapTest
atest HardwareBitmapTests
and with HwAccelerationTest
Added crop test at ag/15430851
BUG=152621633
Change-Id: If1f448a94908cbf51272bc0d1bbbe1e113fd15f3
diff --git a/libs/hwui/Layer.h b/libs/hwui/Layer.h
index e99e762..656a817 100644
--- a/libs/hwui/Layer.h
+++ b/libs/hwui/Layer.h
@@ -74,10 +74,18 @@
void setColorFilter(sk_sp<SkColorFilter> filter) { mColorFilter = filter; };
- inline SkMatrix& getTexTransform() { return texTransform; }
-
inline SkMatrix& getTransform() { return transform; }
+ inline SkRect getCropRect() { return mCropRect; }
+
+ inline void setCropRect(const SkRect cropRect) { mCropRect = cropRect; }
+
+ inline void setTextureTransform(uint32_t textureTransform) {
+ mTextureTransform = textureTransform;
+ }
+
+ inline uint32_t getTextureTransform() { return mTextureTransform; }
+
/**
* Posts a decStrong call to the appropriate thread.
* Thread-safe.
@@ -116,16 +124,21 @@
SkBlendMode mode;
/**
- * Optional texture coordinates transform.
- */
- SkMatrix texTransform;
-
- /**
* Optional transform.
*/
SkMatrix transform;
/**
+ * Optional crop
+ */
+ SkRect mCropRect;
+
+ /**
+ * Optional transform
+ */
+ uint32_t mTextureTransform;
+
+ /**
* An image backing the layer.
*/
sk_sp<SkImage> layerImage;