mirror of
https://gitee.com/openharmony/graphic_graphic_2d
synced 2024-11-23 07:02:25 +00:00
!17334 fix DrawingSurfaceBufferInfo dstRect size error
Merge pull request !17334 from zhuxiaoyu/fix_DrawingSurfaceBufferInfo_size_error
This commit is contained in:
commit
6d85ee794f
@ -46,8 +46,9 @@ struct DrawingSurfaceBufferInfo {
|
||||
DrawingSurfaceBufferInfo() = default;
|
||||
DrawingSurfaceBufferInfo(const sptr<SurfaceBuffer>& surfaceBuffer, int offSetX, int offSetY, int width, int height,
|
||||
pid_t pid = {}, uint64_t uid = {}, sptr<SyncFence> acquireFence = nullptr, Drawing::Rect srcRect = {})
|
||||
: surfaceBuffer_(surfaceBuffer), srcRect_(srcRect), dstRect_(Drawing::Rect { offSetX, offSetY, width, height }),
|
||||
pid_(pid), uid_(uid), acquireFence_(acquireFence)
|
||||
: surfaceBuffer_(surfaceBuffer), srcRect_(srcRect),
|
||||
dstRect_(Drawing::Rect { offSetX, offSetY, offSetX + width, offSetY + height }), pid_(pid), uid_(uid),
|
||||
acquireFence_(acquireFence)
|
||||
{}
|
||||
sptr<SurfaceBuffer> surfaceBuffer_ = nullptr;
|
||||
Drawing::Rect srcRect_;
|
||||
|
@ -813,7 +813,8 @@ void RSRenderThreadVisitor::ProcessSurfaceViewInRT(RSSurfaceRenderNode& node)
|
||||
ScalingMode scalingMode = surfaceBuffer->GetSurfaceBufferScalingMode();
|
||||
Drawing::Rect srcRect { 0, 0, surfaceBuffer->GetWidth(), surfaceBuffer->GetHeight() };
|
||||
Drawing::Rect dstRect { 0, 0, bounds.width_, bounds.height_ };
|
||||
Drawing::Rect boundsRect = { bounds.left_, bounds.top_, bounds.width_, bounds.height_ };
|
||||
Drawing::Rect boundsRect = { bounds.left_, bounds.top_, bounds.left_ + bounds.width_,
|
||||
bounds.top_ + bounds.height_ };
|
||||
if (scalingMode == ScalingMode::SCALING_MODE_SCALE_CROP) {
|
||||
RSRenderThreadUtil::SrcRectScaleDown(srcRect, boundsRect);
|
||||
} else if (scalingMode == ScalingMode::SCALING_MODE_SCALE_FIT) {
|
||||
|
Loading…
Reference in New Issue
Block a user