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..17d500bd36c96352d352b73b26816ea95f9498d1 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,19 @@ ReadbackYUVInterface* GLHelper::CopyTextureToImpl::CreateReadbackPipelineYUV( |
| if (supported == GLHelperReadbackSupport::SWIZZLE) |
| swizzle = kSwizzleBGRA; |
| + // Tests show that the two up-scaling methods perform comparable speeds on the |
|
miu
2016/03/29 20:08:52
This comment should provide a little more context
xjz
2016/03/29 21:14:50
Yuri: Thanks for the suggestion. But do you want t
miu
2016/03/31 21:44:05
Ah, no. :) Actually, we should just leave out th
xjz
2016/03/31 23:03:39
Done.
|
| + // tested machines. So we choose "best" up-scaling method by default to get |
| + // the best quality. |
| + // The three down-scaling methods perform close speeds on high end machines, |
| + // but not on other machines. The "best" method could be up to 96% slower than |
| + // the "good" one, and the "good" method could be up to 250% slower than the |
| + // "fast" one. As we don't have criteria to determine the proper scaling |
| + // method in flight, and generally the down-scaling is more often needed on |
| + // low end machines, we choose the "fast" down-scaling method by default. |
| + GLHelper::ScalerQuality quality = ((src_size.width() < dst_size.width()) && |
|
miu
2016/03/29 20:08:52
Should this be:
GLHelper::ScalerQuality quality
xjz
2016/03/29 21:14:50
The scaling is done in two separate dimensions. My
miu
2016/03/31 21:44:05
Sounds good.
|
| + (src_size.height() < dst_size.height())) |
| + ? GLHelper::SCALER_QUALITY_BEST |
| + : GLHelper::SCALER_QUALITY_FAST; |
| 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 +1223,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 +1230,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 |