Commit ef135af2 authored by kylechar's avatar kylechar Committed by Commit Bot

Remove LayerTreeFrameSink |must_always_swap|.

Forcing LayerTreeHostImpl to always swap shouldn't be necessary for the
browser UI compositor anymore. LayerTreeHostImpl has been changed to
always submit a CompositorFrame if the set of referenced surfaces has
changed.

It appears |must_always_swap| isn't necessary for layout tests either as
they still pass without it.

Bug: 851616
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I032264a23ba3b8c880f10d777cbe7b24372f0347
Reviewed-on: https://chromium-review.googlesource.com/1136804Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575777}
parent 3924c582
......@@ -44,17 +44,6 @@ class LayerTreeFrameSinkClient;
class CC_EXPORT LayerTreeFrameSink : public viz::SharedBitmapReporter,
public viz::ContextLostObserver {
public:
struct Capabilities {
Capabilities() = default;
// True if we must always swap, even if there is no damage to the frame.
// Needed for both the browser compositor as well as layout tests.
// TODO(ericrk): This should be test-only for layout tests, but tab
// capture has issues capturing offscreen tabs whithout this. We should
// remove this dependency. crbug.com/680196
bool must_always_swap = false;
};
// Constructor for GL-based and/or software resources.
//
// |compositor_task_runner| is used to post worker context lost callback and
......@@ -92,8 +81,6 @@ class CC_EXPORT LayerTreeFrameSink : public viz::SharedBitmapReporter,
bool HasClient() { return !!client_; }
const Capabilities& capabilities() const { return capabilities_; }
// The viz::ContextProviders may be null if frames should be submitted with
// software SharedMemory resources.
viz::ContextProvider* context_provider() const {
......@@ -138,7 +125,6 @@ class CC_EXPORT LayerTreeFrameSink : public viz::SharedBitmapReporter,
LayerTreeFrameSinkClient* client_ = nullptr;
struct LayerTreeFrameSink::Capabilities capabilities_;
scoped_refptr<viz::ContextProvider> context_provider_;
scoped_refptr<viz::RasterContextProvider> worker_context_provider_;
scoped_refptr<base::SingleThreadTaskRunner> compositor_task_runner_;
......
......@@ -968,12 +968,10 @@ bool LayerTreeHostImpl::HasDamage() const {
root_surface->GetDamageRect().Intersects(root_surface->content_rect());
bool hud_wants_to_draw_ = active_tree->hud_layer() &&
active_tree->hud_layer()->IsAnimatingHUDContents();
bool must_always_swap =
layer_tree_frame_sink_->capabilities().must_always_swap;
return root_surface_has_visible_damage ||
active_tree_->property_trees()->effect_tree.HasCopyRequests() ||
must_always_swap || hud_wants_to_draw_;
hud_wants_to_draw_;
}
DrawResult LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
......
......@@ -46,7 +46,6 @@ DirectLayerTreeFrameSink::DirectLayerTreeFrameSink(
use_viz_hit_test_(use_viz_hit_test),
weak_factory_(this) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
capabilities_.must_always_swap = true;
}
DirectLayerTreeFrameSink::~DirectLayerTreeFrameSink() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment