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

Side by Side Diff: cc/surfaces/display.h

Issue 2411793008: Adds BeginFrameControl via DevTools.
Patch Set: BFC prototype v2 with allow_latency_opts and waiting for BFOs. Created 4 years, 1 month 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/surfaces/BUILD.gn ('k') | cc/surfaces/display.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CC_SURFACES_DISPLAY_H_ 5 #ifndef CC_SURFACES_DISPLAY_H_
6 #define CC_SURFACES_DISPLAY_H_ 6 #define CC_SURFACES_DISPLAY_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "cc/output/output_surface_client.h" 12 #include "cc/output/output_surface_client.h"
13 #include "cc/resources/returned_resource.h" 13 #include "cc/resources/returned_resource.h"
14 #include "cc/scheduler/begin_frame_source.h"
15 #include "cc/surfaces/display_scheduler.h" 14 #include "cc/surfaces/display_scheduler.h"
16 #include "cc/surfaces/frame_sink_id.h" 15 #include "cc/surfaces/frame_sink_id.h"
17 #include "cc/surfaces/surface_aggregator.h" 16 #include "cc/surfaces/surface_aggregator.h"
18 #include "cc/surfaces/surface_id.h" 17 #include "cc/surfaces/surface_id.h"
19 #include "cc/surfaces/surface_manager.h" 18 #include "cc/surfaces/surface_manager.h"
20 #include "cc/surfaces/surfaces_export.h" 19 #include "cc/surfaces/surfaces_export.h"
21 #include "gpu/command_buffer/common/texture_in_use_response.h" 20 #include "gpu/command_buffer/common/texture_in_use_response.h"
22 #include "ui/events/latency_info.h" 21 #include "ui/events/latency_info.h"
23 #include "ui/gfx/color_space.h" 22 #include "ui/gfx/color_space.h"
24 23
25 namespace gpu { 24 namespace gpu {
26 class GpuMemoryBufferManager; 25 class GpuMemoryBufferManager;
27 } 26 }
28 27
29 namespace gfx { 28 namespace gfx {
30 class Size; 29 class Size;
31 } 30 }
32 31
33 namespace cc { 32 namespace cc {
34 33
35 class BeginFrameSource; 34 class BeginFrameSource;
36 class DirectRenderer; 35 class DirectRenderer;
36 class DisplayBeginFrameSource;
37 class DisplayClient; 37 class DisplayClient;
38 class OutputSurface; 38 class OutputSurface;
39 class RendererSettings; 39 class RendererSettings;
40 class ResourceProvider; 40 class ResourceProvider;
41 class SharedBitmapManager; 41 class SharedBitmapManager;
42 class SoftwareRenderer; 42 class SoftwareRenderer;
43 class Surface; 43 class Surface;
44 class SurfaceAggregator; 44 class SurfaceAggregator;
45 class SurfaceIdAllocator; 45 class SurfaceIdAllocator;
46 class SurfaceFactory; 46 class SurfaceFactory;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; 91 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override;
92 void OnSurfaceCreated(const SurfaceId& surface_id, 92 void OnSurfaceCreated(const SurfaceId& surface_id,
93 const gfx::Size& frame, 93 const gfx::Size& frame,
94 float device_scale_factor) override; 94 float device_scale_factor) override;
95 95
96 bool has_scheduler() const { return !!scheduler_; } 96 bool has_scheduler() const { return !!scheduler_; }
97 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } 97 DirectRenderer* renderer_for_testing() const { return renderer_.get(); }
98 98
99 void ForceImmediateDrawAndSwapIfPossible(); 99 void ForceImmediateDrawAndSwapIfPossible();
100 100
101 // Swap the Display's current BeginFrameSource with the provided one. The
102 // provided unique_ptr will be updated to point to the previous source. Used
103 // to set an ExternalBeginFrameSource for manual control over BeginFrames
104 // through DevTools.
105 void SwapBeginFrameSource(
106 std::unique_ptr<BeginFrameSource>* begin_frame_source);
107
101 private: 108 private:
102 void InitializeRenderer(); 109 void InitializeRenderer();
103 void UpdateRootSurfaceResourcesLocked(); 110 void UpdateRootSurfaceResourcesLocked();
104 void DidLoseContextProvider(); 111 void DidLoseContextProvider();
105 112
106 SharedBitmapManager* const bitmap_manager_; 113 SharedBitmapManager* const bitmap_manager_;
107 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; 114 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_;
108 const RendererSettings settings_; 115 const RendererSettings settings_;
109 116
110 DisplayClient* client_ = nullptr; 117 DisplayClient* client_ = nullptr;
111 SurfaceManager* surface_manager_ = nullptr; 118 SurfaceManager* surface_manager_ = nullptr;
112 const FrameSinkId frame_sink_id_; 119 const FrameSinkId frame_sink_id_;
113 SurfaceId current_surface_id_; 120 SurfaceId current_surface_id_;
114 gfx::Size current_surface_size_; 121 gfx::Size current_surface_size_;
115 float device_scale_factor_ = 1.f; 122 float device_scale_factor_ = 1.f;
116 gfx::ColorSpace device_color_space_; 123 gfx::ColorSpace device_color_space_;
117 bool visible_ = false; 124 bool visible_ = false;
118 bool swapped_since_resize_ = false; 125 bool swapped_since_resize_ = false;
119 bool output_is_secure_ = false; 126 bool output_is_secure_ = false;
120 127
121 // The begin_frame_source_ is often known by the output_surface_ and 128 // The begin_frame_source_ is often known by the output_surface_ and
122 // the scheduler_. 129 // the scheduler_.
123 std::unique_ptr<BeginFrameSource> begin_frame_source_; 130 std::unique_ptr<DisplayBeginFrameSource> begin_frame_source_;
124 std::unique_ptr<OutputSurface> output_surface_; 131 std::unique_ptr<OutputSurface> output_surface_;
125 std::unique_ptr<DisplayScheduler> scheduler_; 132 std::unique_ptr<DisplayScheduler> scheduler_;
126 std::unique_ptr<ResourceProvider> resource_provider_; 133 std::unique_ptr<ResourceProvider> resource_provider_;
127 std::unique_ptr<SurfaceAggregator> aggregator_; 134 std::unique_ptr<SurfaceAggregator> aggregator_;
128 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; 135 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
129 std::unique_ptr<DirectRenderer> renderer_; 136 std::unique_ptr<DirectRenderer> renderer_;
130 SoftwareRenderer* software_renderer_ = nullptr; 137 SoftwareRenderer* software_renderer_ = nullptr;
131 std::vector<ui::LatencyInfo> stored_latency_info_; 138 std::vector<ui::LatencyInfo> stored_latency_info_;
132 139
133 private: 140 private:
134 DISALLOW_COPY_AND_ASSIGN(Display); 141 DISALLOW_COPY_AND_ASSIGN(Display);
135 }; 142 };
136 143
137 } // namespace cc 144 } // namespace cc
138 145
139 #endif // CC_SURFACES_DISPLAY_H_ 146 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW
« no previous file with comments | « cc/surfaces/BUILD.gn ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698