Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: content/browser/renderer_host/delegated_frame_host.cc

Issue 1690013002: Remove --tab-capture-upscale/downscale-quality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address piman's comments. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/delegated_frame_host.cc
diff --git a/content/browser/renderer_host/delegated_frame_host.cc b/content/browser/renderer_host/delegated_frame_host.cc
index ea900a876051ffa6affcb45ddb77ba75d3e15b98..e103e320e66f7419de686cfe8c13eaa08899594e 100644
--- a/content/browser/renderer_host/delegated_frame_host.cc
+++ b/content/browser/renderer_host/delegated_frame_host.cc
@@ -684,22 +684,19 @@ void DelegatedFrameHost::CopyFromCompositingSurfaceHasResultForVideo(
yuv_readback_pipeline->scaler()->SrcSize() != result_rect.size() ||
yuv_readback_pipeline->scaler()->SrcSubrect() != result_rect ||
yuv_readback_pipeline->scaler()->DstSize() != region_in_frame.size()) {
- GLHelper::ScalerQuality quality = GLHelper::SCALER_QUALITY_FAST;
- std::string quality_switch = switches::kTabCaptureDownscaleQuality;
- // If we're scaling up, we can use the "best" quality.
- if (result_rect.size().width() < region_in_frame.size().width() &&
- result_rect.size().height() < region_in_frame.size().height())
- quality_switch = switches::kTabCaptureUpscaleQuality;
-
- std::string switch_value =
- base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- quality_switch);
- if (switch_value == "fast")
- quality = GLHelper::SCALER_QUALITY_FAST;
- else if (switch_value == "good")
- quality = GLHelper::SCALER_QUALITY_GOOD;
- else if (switch_value == "best")
- quality = GLHelper::SCALER_QUALITY_BEST;
+ // 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.
+ GLHelper::ScalerQuality quality =
+ ((result_rect.size().width() < region_in_frame.size().width()) &&
+ (result_rect.size().height() < region_in_frame.size().height()))
+ ? GLHelper::SCALER_QUALITY_BEST
+ : GLHelper::SCALER_QUALITY_FAST;
dfh->yuv_readback_pipeline_.reset(gl_helper->CreateReadbackPipelineYUV(
quality, result_rect.size(), result_rect, region_in_frame.size(), true,
« no previous file with comments | « chrome/browser/extensions/api/tab_capture/tab_capture_performancetest.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698