Merge "Fix size calculation" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
123079969d
@@ -60,12 +60,11 @@ void SkiaRecordingCanvas::punchHole(const SkRRect& rect) {
|
|||||||
// Add the marker annotation to allow HWUI to determine where the current
|
// Add the marker annotation to allow HWUI to determine where the current
|
||||||
// clip/transformation should be applied
|
// clip/transformation should be applied
|
||||||
SkVector vector = rect.getSimpleRadii();
|
SkVector vector = rect.getSimpleRadii();
|
||||||
const int dataSize = 2;
|
float data[2];
|
||||||
float data[dataSize];
|
|
||||||
data[0] = vector.x();
|
data[0] = vector.x();
|
||||||
data[1] = vector.y();
|
data[1] = vector.y();
|
||||||
mRecorder.drawAnnotation(rect.rect(), HOLE_PUNCH_ANNOTATION.c_str(),
|
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
|
// Clear the current rect within the layer itself
|
||||||
SkPaint paint = SkPaint();
|
SkPaint paint = SkPaint();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ using namespace android::uirenderer::skiapipeline;
|
|||||||
|
|
||||||
void TransformCanvas::onDrawAnnotation(const SkRect& rect, const char* key, SkData* value) {
|
void TransformCanvas::onDrawAnnotation(const SkRect& rect, const char* key, SkData* value) {
|
||||||
if (HOLE_PUNCH_ANNOTATION == key) {
|
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 radiusX = rectParams[0];
|
||||||
float radiusY = rectParams[1];
|
float radiusY = rectParams[1];
|
||||||
SkRRect roundRect = SkRRect::MakeRectXY(rect, radiusX, radiusY);
|
SkRRect roundRect = SkRRect::MakeRectXY(rect, radiusX, radiusY);
|
||||||
|
|||||||
Reference in New Issue
Block a user