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

Side by Side Diff: cc/test/test_compositor_frame_sink.cc

Issue 2854953006: Move disable_display_vsync out of RendererSettings (Closed)
Patch Set: Correct typo Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « cc/test/test_compositor_frame_sink.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/test/test_compositor_frame_sink.h" 5 #include "cc/test/test_compositor_frame_sink.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "cc/output/begin_frame_args.h" 11 #include "cc/output/begin_frame_args.h"
12 #include "cc/output/compositor_frame_sink_client.h" 12 #include "cc/output/compositor_frame_sink_client.h"
13 #include "cc/output/copy_output_request.h" 13 #include "cc/output/copy_output_request.h"
14 #include "cc/output/direct_renderer.h" 14 #include "cc/output/direct_renderer.h"
15 #include "cc/output/output_surface.h" 15 #include "cc/output/output_surface.h"
16 #include "cc/output/texture_mailbox_deleter.h" 16 #include "cc/output/texture_mailbox_deleter.h"
17 #include "cc/surfaces/compositor_frame_sink_support.h" 17 #include "cc/surfaces/compositor_frame_sink_support.h"
18 18
19 namespace cc { 19 namespace cc {
20 20
21 static constexpr FrameSinkId kCompositorFrameSinkId(1, 1); 21 static constexpr FrameSinkId kCompositorFrameSinkId(1, 1);
22 22
23 TestCompositorFrameSink::TestCompositorFrameSink( 23 TestCompositorFrameSink::TestCompositorFrameSink(
24 scoped_refptr<ContextProvider> compositor_context_provider, 24 scoped_refptr<ContextProvider> compositor_context_provider,
25 scoped_refptr<ContextProvider> worker_context_provider, 25 scoped_refptr<ContextProvider> worker_context_provider,
26 SharedBitmapManager* shared_bitmap_manager, 26 SharedBitmapManager* shared_bitmap_manager,
27 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 27 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
28 const RendererSettings& renderer_settings, 28 const RendererSettings& renderer_settings,
29 scoped_refptr<base::SingleThreadTaskRunner> task_runner, 29 scoped_refptr<base::SingleThreadTaskRunner> task_runner,
30 bool synchronous_composite) 30 bool synchronous_composite,
31 bool disable_display_vsync)
31 : CompositorFrameSink(std::move(compositor_context_provider), 32 : CompositorFrameSink(std::move(compositor_context_provider),
32 std::move(worker_context_provider), 33 std::move(worker_context_provider),
33 gpu_memory_buffer_manager, 34 gpu_memory_buffer_manager,
34 shared_bitmap_manager), 35 shared_bitmap_manager),
35 synchronous_composite_(synchronous_composite), 36 synchronous_composite_(synchronous_composite),
37 disable_display_vsync_(disable_display_vsync),
36 renderer_settings_(renderer_settings), 38 renderer_settings_(renderer_settings),
37 task_runner_(std::move(task_runner)), 39 task_runner_(std::move(task_runner)),
38 frame_sink_id_(kCompositorFrameSinkId), 40 frame_sink_id_(kCompositorFrameSinkId),
39 surface_manager_(new SurfaceManager), 41 surface_manager_(new SurfaceManager),
40 local_surface_id_allocator_(new LocalSurfaceIdAllocator()), 42 local_surface_id_allocator_(new LocalSurfaceIdAllocator()),
41 external_begin_frame_source_(this), 43 external_begin_frame_source_(this),
42 weak_ptr_factory_(this) { 44 weak_ptr_factory_(this) {
43 // Always use sync tokens so that code paths in resource provider that deal 45 // Always use sync tokens so that code paths in resource provider that deal
44 // with sync tokens are tested. 46 // with sync tokens are tested.
45 capabilities_.delegated_sync_points_required = true; 47 capabilities_.delegated_sync_points_required = true;
(...skipping 12 matching lines...) Expand all
58 if (!CompositorFrameSink::BindToClient(client)) 60 if (!CompositorFrameSink::BindToClient(client))
59 return false; 61 return false;
60 62
61 std::unique_ptr<OutputSurface> display_output_surface = 63 std::unique_ptr<OutputSurface> display_output_surface =
62 test_client_->CreateDisplayOutputSurface(context_provider()); 64 test_client_->CreateDisplayOutputSurface(context_provider());
63 bool display_context_shared_with_compositor = 65 bool display_context_shared_with_compositor =
64 display_output_surface->context_provider() == context_provider(); 66 display_output_surface->context_provider() == context_provider();
65 67
66 std::unique_ptr<DisplayScheduler> scheduler; 68 std::unique_ptr<DisplayScheduler> scheduler;
67 if (!synchronous_composite_) { 69 if (!synchronous_composite_) {
68 if (renderer_settings_.disable_display_vsync) { 70 if (disable_display_vsync_) {
69 begin_frame_source_.reset(new BackToBackBeginFrameSource( 71 begin_frame_source_.reset(new BackToBackBeginFrameSource(
70 base::MakeUnique<DelayBasedTimeSource>(task_runner_.get()))); 72 base::MakeUnique<DelayBasedTimeSource>(task_runner_.get())));
71 } else { 73 } else {
72 begin_frame_source_.reset(new DelayBasedBeginFrameSource( 74 begin_frame_source_.reset(new DelayBasedBeginFrameSource(
73 base::MakeUnique<DelayBasedTimeSource>(task_runner_.get()))); 75 base::MakeUnique<DelayBasedTimeSource>(task_runner_.get())));
74 begin_frame_source_->SetAuthoritativeVSyncInterval( 76 begin_frame_source_->SetAuthoritativeVSyncInterval(
75 base::TimeDelta::FromMilliseconds(1000.f / 77 base::TimeDelta::FromMilliseconds(1000.f /
76 renderer_settings_.refresh_rate)); 78 renderer_settings_.refresh_rate));
77 } 79 }
78 scheduler.reset(new DisplayScheduler( 80 scheduler.reset(new DisplayScheduler(
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 support_->SetNeedsBeginFrame(needs_begin_frames); 197 support_->SetNeedsBeginFrame(needs_begin_frames);
196 } 198 }
197 199
198 void TestCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {} 200 void TestCompositorFrameSink::OnDidFinishFrame(const BeginFrameAck& ack) {}
199 201
200 void TestCompositorFrameSink::SendCompositorFrameAckToClient() { 202 void TestCompositorFrameSink::SendCompositorFrameAckToClient() {
201 client_->DidReceiveCompositorFrameAck(); 203 client_->DidReceiveCompositorFrameAck();
202 } 204 }
203 205
204 } // namespace cc 206 } // namespace cc
OLDNEW
« no previous file with comments | « cc/test/test_compositor_frame_sink.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698