Fix size calculation
size is in bytes Fixes: 185429940 Test: builds Change-Id: Ib80eecd9ee8830877cfd9861d7126201d88d3f32
This commit is contained in:
@@ -60,12 +60,11 @@ void SkiaRecordingCanvas::punchHole(const SkRRect& rect) {
|
||||
// Add the marker annotation to allow HWUI to determine where the current
|
||||
// clip/transformation should be applied
|
||||
SkVector vector = rect.getSimpleRadii();
|
||||
const int dataSize = 2;
|
||||
float data[dataSize];
|
||||
float data[2];
|
||||
data[0] = vector.x();
|
||||
data[1] = vector.y();
|
||||
mRecorder.drawAnnotation(rect.rect(), HOLE_PUNCH_ANNOTATION.c_str(),
|
||||
SkData::MakeWithCopy(data, dataSize));
|
||||
SkData::MakeWithCopy(data, 2 * sizeof(float)));
|
||||
|
||||
// Clear the current rect within the layer itself
|
||||
SkPaint paint = SkPaint();
|
||||
|
||||
@@ -22,7 +22,7 @@ using namespace android::uirenderer::skiapipeline;
|
||||
|
||||
void TransformCanvas::onDrawAnnotation(const SkRect& rect, const char* key, SkData* value) {
|
||||
if (HOLE_PUNCH_ANNOTATION == key) {
|
||||
auto* rectParams = static_cast<const float*>(value->data());
|
||||
auto* rectParams = reinterpret_cast<const float*>(value->data());
|
||||
float radiusX = rectParams[0];
|
||||
float radiusY = rectParams[1];
|
||||
SkRRect roundRect = SkRRect::MakeRectXY(rect, radiusX, radiusY);
|
||||
|
||||
Reference in New Issue
Block a user