Transformer GL: Update TODOs.

Document some suboptimal things, and remove TODOs that were
fixed already or no longer relevant. Comment-only change.

PiperOrigin-RevId: 428749344
This commit is contained in:
huangdarwin 2022-02-15 12:54:20 +00:00 committed by Ian Baker
parent 8b01d07512
commit 78b461f94c
3 changed files with 9 additions and 10 deletions

View File

@ -248,8 +248,9 @@ public final class TransformerActivity extends AppCompatActivity {
float translateX = bundle.getFloat(ConfigurationActivity.TRANSLATE_X, /* defaultValue= */ 0); float translateX = bundle.getFloat(ConfigurationActivity.TRANSLATE_X, /* defaultValue= */ 0);
float translateY = bundle.getFloat(ConfigurationActivity.TRANSLATE_Y, /* defaultValue= */ 0); float translateY = bundle.getFloat(ConfigurationActivity.TRANSLATE_Y, /* defaultValue= */ 0);
// TODO(b/213198690): Get resolution for aspect ratio and scale all translations' translateX // TODO(b/201293185): Implement an AdvancedFrameEditor to handle translation, as the current
// by this aspect ratio. // transformationMatrix is automatically adjusted to focus on the original pixels and
// effectively undo translations.
transformationMatrix.postTranslate(translateX, translateY); transformationMatrix.postTranslate(translateX, translateY);
float scaleX = bundle.getFloat(ConfigurationActivity.SCALE_X, /* defaultValue= */ 1); float scaleX = bundle.getFloat(ConfigurationActivity.SCALE_X, /* defaultValue= */ 1);

View File

@ -76,14 +76,9 @@ public final class TransformationRequest {
* @return This builder. * @return This builder.
*/ */
public Builder setTransformationMatrix(Matrix transformationMatrix) { public Builder setTransformationMatrix(Matrix transformationMatrix) {
// TODO(b/201293185): After {@link #setResolution} supports arbitrary resolutions, // TODO(b/201293185): Implement an AdvancedFrameEditor to handle translation, as the current
// allow transformations to change the resolution, by scaling to the appropriate min/max // transformationMatrix is automatically adjusted to focus on the original pixels and
// values. This will also be required to create the VertexTransformation class, in order to // effectively undo translations.
// have aspect ratio helper methods (which require resolution to change).
// TODO(b/213198690): Consider changing how transformationMatrix is applied, so that
// dimensions will be from -1 to 1 on both x and y axes, but transformations will be applied
// in a predictable manner.
this.transformationMatrix = new Matrix(transformationMatrix); this.transformationMatrix = new Matrix(transformationMatrix);
return this; return this;
} }

View File

@ -115,6 +115,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
return false; return false;
} }
if (!transformationRequest.transformationMatrix.isIdentity()) { if (!transformationRequest.transformationMatrix.isIdentity()) {
// TODO(b/201293185, b/214010296): Move FrameProcessor transformationMatrix calculation /
// adjustments out of the VideoTranscodingSamplePipeline, so that we can skip transcoding when
// adjustments result in identity matrices.
return false; return false;
} }
return true; return true;