Fix Skia's impl for TextureView.getBitmap
Bug: 73392905
Test: New test added with I2d4ef440f943a50b9367976ba1444f4350071bfd
When providing a width and height, getBitmap should scale to the
destination. Add a parameter to LayerDrawable::DrawLayer for a
destination rectangle to scale to. Pass the size of the bitmap in
SkiaOpenGLPipeline::copyLayerInto down to DrawLayer. The only other
caller of DrawLayer is unaffected.
Change-Id: I7aa192181c2d15bc8fd4de2fb15c4d276b05d2ac
diff --git a/libs/hwui/pipeline/skia/LayerDrawable.h b/libs/hwui/pipeline/skia/LayerDrawable.h
index 3450387..18d1184 100644
--- a/libs/hwui/pipeline/skia/LayerDrawable.h
+++ b/libs/hwui/pipeline/skia/LayerDrawable.h
@@ -32,7 +32,8 @@
public:
explicit LayerDrawable(DeferredLayerUpdater* layerUpdater) : mLayerUpdater(layerUpdater) {}
- static bool DrawLayer(GrContext* context, SkCanvas* canvas, Layer* layer);
+ static bool DrawLayer(GrContext* context, SkCanvas* canvas, Layer* layer,
+ const SkRect* dstRect = nullptr);
protected:
virtual SkRect onGetBounds() override {