Chromium Code Reviews| Index: content/browser/compositor/gl_helper.cc |
| diff --git a/content/browser/compositor/gl_helper.cc b/content/browser/compositor/gl_helper.cc |
| index 55493e900689ba6bcf421056e29fefb1645ab875..2b89dfeead033dd86f7afdae045c70bf037bf6a5 100644 |
| --- a/content/browser/compositor/gl_helper.cc |
| +++ b/content/browser/compositor/gl_helper.cc |
| @@ -182,7 +182,6 @@ class GLHelper::CopyTextureToImpl |
| GLHelper::ScalerQuality quality); |
| ReadbackYUVInterface* CreateReadbackPipelineYUV( |
| - GLHelper::ScalerQuality quality, |
| const gfx::Size& src_size, |
| const gfx::Rect& src_subrect, |
| const gfx::Size& dst_size, |
| @@ -1181,7 +1180,6 @@ bool GLHelper::IsReadbackConfigSupported(SkColorType color_type) { |
| } |
| ReadbackYUVInterface* GLHelper::CopyTextureToImpl::CreateReadbackPipelineYUV( |
| - GLHelper::ScalerQuality quality, |
| const gfx::Size& src_size, |
| const gfx::Rect& src_subrect, |
| const gfx::Size& dst_size, |
| @@ -1201,6 +1199,20 @@ ReadbackYUVInterface* GLHelper::CopyTextureToImpl::CreateReadbackPipelineYUV( |
| if (supported == GLHelperReadbackSupport::SWIZZLE) |
| swizzle = kSwizzleBGRA; |
| + // "The YUV readback pipeline is used by real-time video capture of |
| + // tabs/windows/desktops. Therefore, the scaler chosen here is based on |
| + // performance measurements of full end-to-end systems. When down-scaling, |
| + // always use the "fast" scaler because it performs well on both low- and |
| + // high- end machines, provides decent image quality, and doesn't overwhelm |
| + // downstream video encoders with too much entropy (which can drastically |
| + // increase CPU utilization). When up-scaling, always use "best" because the |
| + // quality improvement is huge with insignificant performance penalty. Note |
| + // that this strategy differs from single-frame snapshot capture (i.e., using |
| + // the Skia/RGB code path). |
| + GLHelper::ScalerQuality quality = ((src_size.width() < dst_size.width()) && |
| + (src_size.height() < dst_size.height())) |
| + ? GLHelper::SCALER_QUALITY_BEST |
| + : GLHelper::SCALER_QUALITY_FAST; |
|
piman
2016/04/06 18:32:47
If SCALER_QUALITY_GOOD is not used any more, can y
xjz
2016/04/06 18:44:05
SCALER_QUALITY_GOOD is used as the default scaler
piman
2016/04/06 19:20:07
If that the case, then can you leave the policy de
xjz
2016/04/06 23:03:38
Done.
|
| if (max_draw_buffers_ >= 2 && use_mrt) { |
| return new ReadbackYUV_MRT(gl_, this, helper_->scaler_impl_.get(), quality, |
| src_size, src_subrect, dst_size, flip_vertically, |
| @@ -1212,7 +1224,6 @@ ReadbackYUVInterface* GLHelper::CopyTextureToImpl::CreateReadbackPipelineYUV( |
| } |
| ReadbackYUVInterface* GLHelper::CreateReadbackPipelineYUV( |
| - ScalerQuality quality, |
| const gfx::Size& src_size, |
| const gfx::Rect& src_subrect, |
| const gfx::Size& dst_size, |
| @@ -1220,7 +1231,7 @@ ReadbackYUVInterface* GLHelper::CreateReadbackPipelineYUV( |
| bool use_mrt) { |
| InitCopyTextToImpl(); |
| return copy_texture_to_impl_->CreateReadbackPipelineYUV( |
| - quality, src_size, src_subrect, dst_size, flip_vertically, use_mrt); |
| + src_size, src_subrect, dst_size, flip_vertically, use_mrt); |
| } |
| } // namespace content |