This is required for moving tab capture into VIZ. The idea is to add an option to request the result of a copy request be uniformly scaled.
Proposed API (addition to viz::CopyOutputRequest):
// Optionally specify that the result should be uniformly scaled. |numerator|
// and |denominator| describe the scale ratio: Downscale for num < denom,
// upscale for num > denom, or no scaling for num == denom. The setter method
// will reduce these values by dividing both by their common muliples (e.g.,
// 1600:400 will become 4:1).
void SetScaleRatio(int numerator, int denominator);
const std::tuple<int, int>& scale_ratio() const { return scale_ratio_; }
bool is_scaled() const {
return std::get<0>(scale_ratio_) != std::get<1>(scale_ratio_);
}
This is follow-up to track an action item from this code review: https://chromium-review.googlesource.com/c/chromium/src/+/637003/6
Comment 1 by bugdroid1@chromium.org
, Sep 9 2017