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

Unified Diff: content/renderer/gpu/render_widget_compositor.cc

Issue 2285083004: Refactor renderer LayerTreeSettings generating code to common. (Closed)
Patch Set: Minor fix. Created 4 years, 4 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
« content/common/compositor_util.h ('K') | « content/content_common.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/render_widget_compositor.cc
diff --git a/content/renderer/gpu/render_widget_compositor.cc b/content/renderer/gpu/render_widget_compositor.cc
index 82e555b9d7e8d5d0914c39327709519759033985..c1ef5e0a9876e2e84eb6f54be312ff2b1e7cc7b4 100644
--- a/content/renderer/gpu/render_widget_compositor.cc
+++ b/content/renderer/gpu/render_widget_compositor.cc
@@ -41,6 +41,7 @@
#include "cc/trees/latency_info_swap_promise_monitor.h"
#include "cc/trees/layer_tree_host.h"
#include "cc/trees/remote_proto_channel.h"
+#include "content/common/compositor_util.h"
#include "content/common/content_switches_internal.h"
#include "content/common/gpu/client/context_provider_command_buffer.h"
#include "content/public/common/content_client.h"
@@ -344,14 +345,8 @@ cc::LayerTreeSettings RenderWidgetCompositor::GenerateLayerTreeSettings(
settings.image_decode_tasks_enabled =
compositor_deps->AreImageDecodeTasksEnabled();
- if (cmd.HasSwitch(cc::switches::kTopControlsShowThreshold)) {
- std::string top_threshold_str =
- cmd.GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold);
- double show_threshold;
- if (base::StringToDouble(top_threshold_str, &show_threshold) &&
- show_threshold >= 0.f && show_threshold <= 1.f)
- settings.top_controls_show_threshold = show_threshold;
- }
+ // Build LayerTreeSettings from command line args.
+ CompositorUtil::GenerateLayerTreeSettings(settings, cmd);
Khushal 2016/08/29 20:21:14 Do you want to just call it SetTopControlsSettings
xingliu 2016/08/29 20:44:33 Done.
if (cmd.HasSwitch(cc::switches::kTopControlsHideThreshold)) {
std::string top_threshold_str =
« content/common/compositor_util.h ('K') | « content/content_common.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698