Move SetAllowGpuRasterization from WebLayerTreeView to WebWidgetClient (11/n)

Rename the method to SetAllowGpuRasterization() to be much more
explicit about what the method does. Move the logic for deciding if
gpu raster is disallowed up to WebViewImpl, instead of splitting it
between WebViewImpl and ViewportDescription, since it is already
derivable from the ViewportDescription public API. And rewrite it with
and if statement to make it easier to follow.

Drops the branch on if (layer_tree_view_) for handling the commented
case 2 of doing layout after closing the WebWidget because I believe
that should be resolved by dcheng's solution here:
https://crrev.com/c/1416450/9..13/third_party/blink/renderer/core/frame/frame_test_helpers.cc

The WebLayerTreeView is a shortcut past the WebWidgetClient that is
not needed now that we always composite. This works toward eliminating
this extra API layer.

More importantly this helps us Close/Restart the WebWidget parts of
WebViewImpl by not requiring plumbing 2 pointers with slightly different
lifetimes (WebLayerTreeView is created inside the Init of the
WebWidgetClient). This will help avoid a bunch of complexity in
creating WebFrameWidgets and other WebWidgets.

[email protected]

Bug: 912193
Change-Id: I9278d80192a593f829915d3c1fc208b6a99a6d50
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1555354
Commit-Queue: danakj <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Cr-Commit-Position: refs/heads/master@{#651328}
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index f41433f..1755b34 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -3313,6 +3313,11 @@
   widget_input_handler_manager_->FallbackCursorModeSetCursorVisibility(visible);
 }
 
+void RenderWidget::SetAllowGpuRasterization(bool allow_gpu_raster) {
+  layer_tree_view_->layer_tree_host()->SetHasGpuRasterizationTrigger(
+      allow_gpu_raster);
+}
+
 void RenderWidget::SetPageScaleFactorAndLimits(float page_scale_factor,
                                                float minimum,
                                                float maximum) {