Loading libs/renderengine/skia/SkiaGLRenderEngine.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -902,7 +902,16 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display, if (layer->shadow.length > 0) { // This would require a new parameter/flag to SkShadowUtils::DrawShadow LOG_ALWAYS_FATAL_IF(layer->disableBlending, "Cannot disableBlending with a shadow"); drawShadow(canvas, bounds, layer->shadow); // Technically, if bounds is a rect and roundRectClip is not empty, // it means that the bounds and roundedCornersCrop were different // enough that we should intersect them to find the proper shadow. // In practice, this often happens when the two rectangles appear to // not match due to rounding errors. Draw the rounded version, which // looks more like the intent. const auto& rrect = bounds.isRect() && !roundRectClip.isEmpty() ? roundRectClip : bounds; drawShadow(canvas, rrect, layer->shadow); continue; } Loading services/surfaceflinger/Layer.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -628,23 +628,6 @@ std::optional<compositionengine::LayerFE::LayerSettings> Layer::prepareShadowCli return {}; } float casterCornerRadius = shadowLayer.geometry.roundedCornersRadius; const FloatRect& cornerRadiusCropRect = shadowLayer.geometry.roundedCornersCrop; const FloatRect& casterRect = shadowLayer.geometry.boundaries; // crop used to set the corner radius may be larger than the content rect. Adjust the corner // radius accordingly. if (casterCornerRadius > 0.f) { float cropRectOffset = std::max(std::abs(cornerRadiusCropRect.top - casterRect.top), std::abs(cornerRadiusCropRect.left - casterRect.left)); if (cropRectOffset > casterCornerRadius) { casterCornerRadius = 0; } else { casterCornerRadius -= cropRectOffset; } shadowLayer.geometry.roundedCornersRadius = casterCornerRadius; } return shadowLayer; } Loading Loading
libs/renderengine/skia/SkiaGLRenderEngine.cpp +10 −1 Original line number Diff line number Diff line Loading @@ -902,7 +902,16 @@ status_t SkiaGLRenderEngine::drawLayers(const DisplaySettings& display, if (layer->shadow.length > 0) { // This would require a new parameter/flag to SkShadowUtils::DrawShadow LOG_ALWAYS_FATAL_IF(layer->disableBlending, "Cannot disableBlending with a shadow"); drawShadow(canvas, bounds, layer->shadow); // Technically, if bounds is a rect and roundRectClip is not empty, // it means that the bounds and roundedCornersCrop were different // enough that we should intersect them to find the proper shadow. // In practice, this often happens when the two rectangles appear to // not match due to rounding errors. Draw the rounded version, which // looks more like the intent. const auto& rrect = bounds.isRect() && !roundRectClip.isEmpty() ? roundRectClip : bounds; drawShadow(canvas, rrect, layer->shadow); continue; } Loading
services/surfaceflinger/Layer.cpp +0 −17 Original line number Diff line number Diff line Loading @@ -628,23 +628,6 @@ std::optional<compositionengine::LayerFE::LayerSettings> Layer::prepareShadowCli return {}; } float casterCornerRadius = shadowLayer.geometry.roundedCornersRadius; const FloatRect& cornerRadiusCropRect = shadowLayer.geometry.roundedCornersCrop; const FloatRect& casterRect = shadowLayer.geometry.boundaries; // crop used to set the corner radius may be larger than the content rect. Adjust the corner // radius accordingly. if (casterCornerRadius > 0.f) { float cropRectOffset = std::max(std::abs(cornerRadiusCropRect.top - casterRect.top), std::abs(cornerRadiusCropRect.left - casterRect.left)); if (cropRectOffset > casterCornerRadius) { casterCornerRadius = 0; } else { casterCornerRadius -= cropRectOffset; } shadowLayer.geometry.roundedCornersRadius = casterCornerRadius; } return shadowLayer; } Loading