Home
last modified time | relevance | path

Searched refs:aspectRatio (Results 1 – 25 of 47) sorted by relevance

12

/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/
DLegacySizeSpecSource.kt65 override fun getMaxSize(aspectRatio: Float): Size { in getMaxSize()
75 return if (aspectRatio > 1f) { in getMaxSize()
76 val maxWidth = Math.max(getDefaultSize(aspectRatio).width, in getMaxSize()
78 val maxHeight = (maxWidth / aspectRatio).toInt() in getMaxSize()
81 val maxHeight = Math.max(getDefaultSize(aspectRatio).height, in getMaxSize()
83 val maxWidth = (maxHeight * aspectRatio).toInt() in getMaxSize()
88 override fun getDefaultSize(aspectRatio: Float): Size { in getDefaultSize()
90 return getMinSize(aspectRatio) in getDefaultSize()
98 if (aspectRatio <= mMinAspectRatioForMinSize || in getDefaultSize()
99 aspectRatio > mMaxAspectRatioForMinSize) { in getDefaultSize()
[all …]
DPhoneSizeSpecSource.kt136 override fun getMaxSize(aspectRatio: Float): Size { in getMaxSize()
150 if (aspectRatio >= mOptimizedAspectRatio && aspectRatio <= 1 / mOptimizedAspectRatio) { in getMaxSize()
153 shorterLength * (aspectRatio - mOptimizedAspectRatio) / (1 + aspectRatio)) in getMaxSize()
156 maxHeight = Math.round(maxWidth / aspectRatio) in getMaxSize()
158 if (aspectRatio > 1f) { in getMaxSize()
160 maxHeight = Math.round(maxWidth / aspectRatio) in getMaxSize()
163 maxWidth = Math.round(maxHeight * aspectRatio) in getMaxSize()
175 override fun getDefaultSize(aspectRatio: Float): Size { in getDefaultSize()
176 val minSize = getMinSize(aspectRatio) in getDefaultSize()
180 val maxSize = getMaxSize(aspectRatio) in getDefaultSize()
[all …]
DSizeSpecSource.kt24 fun getMaxSize(aspectRatio: Float): Size in getMaxSize()
27 fun getDefaultSize(aspectRatio: Float): Size in getMaxSize()
30 fun getMinSize(aspectRatio: Float): Size in getMaxSize()
33 fun getSizeForAspectRatio(size: Size, aspectRatio: Float): Size in getMaxSize()
DPipBoundsAlgorithm.java255 public boolean isValidPictureInPictureAspectRatio(float aspectRatio) { in isValidPictureInPictureAspectRatio() argument
256 return Float.compare(mMinAspectRatio, aspectRatio) <= 0 in isValidPictureInPictureAspectRatio()
257 && Float.compare(aspectRatio, mMaxAspectRatio) <= 0; in isValidPictureInPictureAspectRatio()
260 private Rect transformBoundsToAspectRatioIfValid(Rect bounds, float aspectRatio, in transformBoundsToAspectRatioIfValid() argument
263 if (isValidPictureInPictureAspectRatio(aspectRatio)) { in transformBoundsToAspectRatioIfValid()
264 transformBoundsToAspectRatio(destinationBounds, aspectRatio, in transformBoundsToAspectRatioIfValid()
274 public void transformBoundsToAspectRatio(Rect stackBounds, float aspectRatio, in transformBoundsToAspectRatio() argument
284 new Size(stackBounds.width(), stackBounds.height()), aspectRatio); in transformBoundsToAspectRatio()
286 size = mSizeSpecSource.getDefaultSize(aspectRatio); in transformBoundsToAspectRatio()
DPipUtils.kt148 fun getEnterPipWithOverlaySrcRectHint(appBounds: Rect, aspectRatio: Float): Rect { in getEnterPipWithOverlaySrcRectHint()
154 if (appBoundsAspRatio < aspectRatio) { in getEnterPipWithOverlaySrcRectHint()
156 height = Math.round(width / aspectRatio) in getEnterPipWithOverlaySrcRectHint()
160 width = Math.round(height * aspectRatio) in getEnterPipWithOverlaySrcRectHint()
DPipBoundsState.java233 public void updateMinMaxSize(float aspectRatio) { in updateMinMaxSize() argument
234 final Size minSize = mSizeSpecSource.getMinSize(aspectRatio); in updateMinMaxSize()
236 final Size maxSize = mSizeSpecSource.getMaxSize(aspectRatio); in updateMinMaxSize()
300 public void setAspectRatio(float aspectRatio) { in setAspectRatio() argument
301 if (Float.compare(mAspectRatio, aspectRatio) != 0) { in setAspectRatio()
302 mAspectRatio = aspectRatio; in setAspectRatio()
/frameworks/base/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/phone/
DPhoneSizeSpecSourceTest.java139 float aspectRatio = expectedSizesEntry.getKey(); in forEveryTestCaseCheck() local
142 Assert.assertEquals(expectedSize, callback.apply(aspectRatio)); in forEveryTestCaseCheck()
198 (aspectRatio) -> mSizeSpecSource.getMaxSize(aspectRatio)); in testGetMaxSize_nonSquareDisplay()
205 (aspectRatio) -> mSizeSpecSource.getDefaultSize(aspectRatio)); in testGetDefaultSize_nonSquareDisplay()
212 (aspectRatio) -> mSizeSpecSource.getMinSize(aspectRatio)); in testGetMinSize_nonSquareDisplay()
219 (aspectRatio) -> mSizeSpecSource.getMaxSize(aspectRatio)); in testGetMaxSize_squareDisplay()
226 (aspectRatio) -> mSizeSpecSource.getDefaultSize(aspectRatio)); in testGetDefaultSize_squareDisplay()
233 (aspectRatio) -> mSizeSpecSource.getMinSize(aspectRatio)); in testGetMinSize_squareDisplay()
DPipTouchHandlerTest.java169 float aspectRatio = (float) mPipBounds.width() / mPipBounds.height(); in updateMovementBounds_minMaxBounds() local
170 Size expectedMinSize = mSizeSpecSource.getMinSize(aspectRatio); in updateMovementBounds_minMaxBounds()
171 Size expectedMaxSize = mSizeSpecSource.getMaxSize(aspectRatio); in updateMovementBounds_minMaxBounds()
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/pip/
DPipParamsChangedForwarder.java45 public void notifyAspectRatioChanged(float aspectRatio) { in notifyAspectRatioChanged() argument
47 listener.onAspectRatioChanged(aspectRatio); in notifyAspectRatioChanged()
54 public void notifyExpandedAspectRatioChanged(float aspectRatio) { in notifyExpandedAspectRatioChanged() argument
56 listener.onExpandedAspectRatioChanged(aspectRatio); in notifyExpandedAspectRatioChanged()
98 default void onAspectRatioChanged(float aspectRatio) { in onAspectRatioChanged() argument
104 default void onExpandedAspectRatioChanged(float aspectRatio) { in onExpandedAspectRatioChanged() argument
/frameworks/base/libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/pip/
DPipBoundsAlgorithmTest.java267 for (float aspectRatio : aspectRatios) { in getEntryDestinationBounds_returnBoundsMatchesAspectRatio()
268 mPipBoundsState.setAspectRatio(aspectRatio); in getEntryDestinationBounds_returnBoundsMatchesAspectRatio()
272 aspectRatio, actualAspectRatio, ASPECT_RATIO_ERROR_MARGIN); in getEntryDestinationBounds_returnBoundsMatchesAspectRatio()
282 for (float aspectRatio : invalidAspectRatios) { in getEntryDestinationBounds_invalidAspectRatio_returnsDefaultAspectRatio()
283 mPipBoundsState.setAspectRatio(aspectRatio); in getEntryDestinationBounds_invalidAspectRatio_returnsDefaultAspectRatio()
295 final float aspectRatio = (DEFAULT_ASPECT_RATIO + MAX_ASPECT_RATIO) / 2; in getAdjustedDestinationBounds_returnBoundsMatchesAspectRatio() local
297 currentBounds.right = (int) (currentBounds.height() * aspectRatio) + currentBounds.left; in getAdjustedDestinationBounds_returnBoundsMatchesAspectRatio()
299 mPipBoundsState.setAspectRatio(aspectRatio); in getAdjustedDestinationBounds_returnBoundsMatchesAspectRatio()
301 currentBounds, aspectRatio); in getAdjustedDestinationBounds_returnBoundsMatchesAspectRatio()
306 aspectRatio, actualAspectRatio, ASPECT_RATIO_ERROR_MARGIN); in getAdjustedDestinationBounds_returnBoundsMatchesAspectRatio()
[all …]
DPipTaskOrganizerTest.java142 final Rational aspectRatio = new Rational(2, 1); in startSwipePipToHome_updatesAspectRatio() local
144 mPipTaskOrganizer.startSwipePipToHome(mComponent1, null, createPipParams(aspectRatio)); in startSwipePipToHome_updatesAspectRatio()
146 assertEquals(aspectRatio.floatValue(), mPipBoundsState.getAspectRatio(), 0.01f); in startSwipePipToHome_updatesAspectRatio()
168 final Rational aspectRatio = new Rational(2, 1); in onTaskAppeared_updatesAspectRatio() local
171 createPipParams(aspectRatio)), mock(SurfaceControl.class)); in onTaskAppeared_updatesAspectRatio()
173 assertEquals(aspectRatio.floatValue(), mPipBoundsState.getAspectRatio(), 0.01f); in onTaskAppeared_updatesAspectRatio()
319 private static PictureInPictureParams createPipParams(Rational aspectRatio) { in createPipParams() argument
321 .setAspectRatio(aspectRatio) in createPipParams()
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/view/
DIllustration.java52 private float aspectRatio = 0.0f; field in Illustration
76 aspectRatio = a.getFloat(R.styleable.SuwIllustration_suwAspectRatio, 0.0f); in init()
122 public void setAspectRatio(float aspectRatio) { in setAspectRatio() argument
123 this.aspectRatio = aspectRatio; in setAspectRatio()
136 if (aspectRatio != 0.0f) { in onMeasure()
138 int illustrationHeight = (int) (parentWidth / aspectRatio); in onMeasure()
158 if (aspectRatio != 0f) { in onLayout()
DIllustrationVideoView.java306 float aspectRatio = 0.0f; in onPrepared() local
308 aspectRatio = (float) mp.getVideoHeight() / mp.getVideoWidth(); in onPrepared()
312 if (Float.compare(mAspectRatio, aspectRatio) != 0) { in onPrepared()
313 mAspectRatio = aspectRatio; in onPrepared()
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/desktopmode/
DDesktopModeUtils.kt111 aspectRatio: Float in maximumSizeMaintainingAspectRatio()
118 val tempWidth = (targetHeight / aspectRatio).toInt() in maximumSizeMaintainingAspectRatio()
124 finalHeight = (finalWidth * aspectRatio).toInt() in maximumSizeMaintainingAspectRatio()
127 val tempWidth = (targetHeight * aspectRatio).toInt() in maximumSizeMaintainingAspectRatio()
133 finalHeight = (finalWidth / aspectRatio).toInt() in maximumSizeMaintainingAspectRatio()
/frameworks/base/services/core/java/com/android/server/wm/
DPinnedTaskController.java156 public boolean isValidPictureInPictureAspectRatio(float aspectRatio) { in isValidPictureInPictureAspectRatio() argument
157 return Float.compare(mMinAspectRatio, aspectRatio) <= 0 in isValidPictureInPictureAspectRatio()
158 && Float.compare(aspectRatio, mMaxAspectRatio) <= 0; in isValidPictureInPictureAspectRatio()
164 public boolean isValidExpandedPictureInPictureAspectRatio(float aspectRatio) { in isValidExpandedPictureInPictureAspectRatio() argument
165 return Float.compare(mMinAspectRatio, aspectRatio) > 0 in isValidExpandedPictureInPictureAspectRatio()
166 || Float.compare(aspectRatio, mMaxAspectRatio) > 0; in isValidExpandedPictureInPictureAspectRatio()
DLaunchParamsUtil.java105 final float aspectRatio = (float) Math.max(width, height) / (float) Math.min(width, height); in getDefaultFreeformSize() local
114 if (minAspectRatio >= 1 && aspectRatio < minAspectRatio) { in getDefaultFreeformSize()
123 } else if (maxAspectRatio >= 1 && aspectRatio > maxAspectRatio) { in getDefaultFreeformSize()
/frameworks/native/services/surfaceflinger/DisplayHardware/
DFramebufferSurface.cpp176 const float aspectRatio = static_cast<float>(size.width) / size.height; in limitSizeInternal() local
177 limitedSize.height = maxSize.width / aspectRatio; in limitSizeInternal()
182 const float aspectRatio = static_cast<float>(size.width) / size.height; in limitSizeInternal() local
184 limitedSize.width = maxSize.height * aspectRatio; in limitSizeInternal()
/frameworks/opt/setupwizard/library/test/robotest/src/com/android/setupwizardlib/view/
DIllustrationVideoViewTest.java134 final float aspectRatio = (float) view.getMeasuredHeight() / view.getMeasuredWidth(); in prepareVideo_shouldSetAspectRatio() local
135 assertThat(aspectRatio).isWithin(0.001f).of(1280f / 720f); in prepareVideo_shouldSetAspectRatio()
148 final float aspectRatio = (float) view.getHeight() / view.getWidth(); in prepareVideo_zeroHeight_shouldSetAspectRatioToZero() local
149 assertThat(aspectRatio).isEqualTo(0.0f); in prepareVideo_zeroHeight_shouldSetAspectRatioToZero()
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/
DPipTouchHandler.java410 float aspectRatio = (float) normalBounds.width() / normalBounds.height(); in onMovementBoundsChanged() local
411 Size expandedSize = mSizeSpecSource.getDefaultSize(aspectRatio); in onMovementBoundsChanged()
419 updatePipSizeConstraints(normalBounds, aspectRatio); in onMovementBoundsChanged()
454 public void updateMinMaxSize(float aspectRatio) { in updateMinMaxSize() argument
456 aspectRatio); in updateMinMaxSize() local
460 float aspectRatio) { in updatePipSizeConstraints() argument
462 updatePinchResizeSizeConstraints(aspectRatio); in updatePipSizeConstraints()
470 private void updatePinchResizeSizeConstraints(float aspectRatio) { in updatePinchResizeSizeConstraints() argument
471 mPipBoundsState.updateMinMaxSize(aspectRatio); in updatePinchResizeSizeConstraints()
/frameworks/base/libs/WindowManager/Shell/src/com/android/wm/shell/pip2/phone/
DPipTouchHandler.java419 float aspectRatio = (float) normalBounds.width() / normalBounds.height(); in onMovementBoundsChanged() local
420 Size expandedSize = mSizeSpecSource.getDefaultSize(aspectRatio); in onMovementBoundsChanged()
428 updatePipSizeConstraints(normalBounds, aspectRatio); in onMovementBoundsChanged()
460 public void updateMinMaxSize(float aspectRatio) { in updateMinMaxSize() argument
462 aspectRatio); in updateMinMaxSize() local
466 float aspectRatio) { in updatePipSizeConstraints() argument
468 updatePinchResizeSizeConstraints(aspectRatio); in updatePipSizeConstraints()
476 private void updatePinchResizeSizeConstraints(float aspectRatio) { in updatePinchResizeSizeConstraints() argument
477 mPipBoundsState.updateMinMaxSize(aspectRatio); in updatePinchResizeSizeConstraints()
/frameworks/base/packages/SystemUI/src/com/android/systemui/touchpad/tutorial/ui/view/
DTutorialSelectionScreen.kt23 import androidx.compose.foundation.layout.aspectRatio
112 modifier = modifier.aspectRatio(0.66f) in TutorialButton()
/frameworks/base/core/java/android/app/
DPictureInPictureParams.java96 public Builder setAspectRatio(Rational aspectRatio) { in setAspectRatio() argument
97 mAspectRatio = aspectRatio; in setAspectRatio()
379 PictureInPictureParams(Rational aspectRatio, Rational expandedAspectRatio, in PictureInPictureParams() argument
383 mAspectRatio = aspectRatio; in PictureInPictureParams()
/frameworks/base/core/java/android/gesture/
DGestureUtils.java108 float aspectRatio = gestureWidth / gestureHeight; in spatialSampling()
109 if (aspectRatio > 1) { in spatialSampling()
110 aspectRatio = 1 / aspectRatio; in spatialSampling()
112 if (aspectRatio < SCALING_THRESHOLD) { in spatialSampling()
/frameworks/av/services/camera/libcameraservice/tests/
DRotateAndCropMapperTest.cpp156 float aspectRatio = static_cast<float>(full_crop[2]) / full_crop[3]; in TEST() local
157 int32_t rw = full_crop[3] / aspectRatio; in TEST()
248 float aspectRatio = static_cast<float>(full_crop[2]) / full_crop[3]; in TEST() local
249 int32_t rw = full_crop[3] / aspectRatio; in TEST()
/frameworks/base/services/core/java/com/android/server/pm/pkg/mutate/
DPackageUserStateWrite.java76 PackageUserStateWrite setMinAspectRatio(@PackageManager.UserMinAspectRatio int aspectRatio); in setMinAspectRatio() argument

12