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

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

Issue 2468633002: Replaced cc::Display::SetSurfaceId() with SetLocalFrameId() (Closed)
Patch Set: rebase and minor bug fixes 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/direct_compositor_frame_sink_unittest.cc ('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
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 // surface IDs used to draw into the display and deciding when to draw. 51 // surface IDs used to draw into the display and deciding when to draw.
52 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, 52 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
53 public OutputSurfaceClient, 53 public OutputSurfaceClient,
54 public SurfaceObserver { 54 public SurfaceObserver {
55 public: 55 public:
56 // The |begin_frame_source| and |scheduler| may be null (together). In that 56 // The |begin_frame_source| and |scheduler| may be null (together). In that
57 // case, DrawAndSwap must be called externally when needed. 57 // case, DrawAndSwap must be called externally when needed.
58 Display(SharedBitmapManager* bitmap_manager, 58 Display(SharedBitmapManager* bitmap_manager,
59 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager, 59 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager,
60 const RendererSettings& settings, 60 const RendererSettings& settings,
61 const FrameSinkId& frame_sink_id,
61 std::unique_ptr<BeginFrameSource> begin_frame_source, 62 std::unique_ptr<BeginFrameSource> begin_frame_source,
62 std::unique_ptr<OutputSurface> output_surface, 63 std::unique_ptr<OutputSurface> output_surface,
63 std::unique_ptr<DisplayScheduler> scheduler, 64 std::unique_ptr<DisplayScheduler> scheduler,
64 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); 65 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter);
65 66
66 ~Display() override; 67 ~Display() override;
67 68
68 void Initialize(DisplayClient* client, 69 void Initialize(DisplayClient* client, SurfaceManager* surface_manager);
69 SurfaceManager* surface_manager,
70 const FrameSinkId& frame_sink_id);
71 70
72 // device_scale_factor is used to communicate to the external window system 71 // device_scale_factor is used to communicate to the external window system
73 // what scale this was rendered at. 72 // what scale this was rendered at.
74 void SetSurfaceId(const SurfaceId& id, float device_scale_factor); 73 void SetLocalFrameId(const LocalFrameId& id, float device_scale_factor);
75 void SetVisible(bool visible); 74 void SetVisible(bool visible);
76 void Resize(const gfx::Size& new_size); 75 void Resize(const gfx::Size& new_size);
77 void SetColorSpace(const gfx::ColorSpace& color_space); 76 void SetColorSpace(const gfx::ColorSpace& color_space);
78 void SetOutputIsSecure(bool secure); 77 void SetOutputIsSecure(bool secure);
79 78
80 const SurfaceId& CurrentSurfaceId(); 79 const SurfaceId& CurrentSurfaceId();
81 80
82 // DisplaySchedulerClient implementation. 81 // DisplaySchedulerClient implementation.
83 bool DrawAndSwap() override; 82 bool DrawAndSwap() override;
84 83
(...skipping 18 matching lines...) Expand all
103 void InitializeRenderer(); 102 void InitializeRenderer();
104 void UpdateRootSurfaceResourcesLocked(); 103 void UpdateRootSurfaceResourcesLocked();
105 void DidLoseContextProvider(); 104 void DidLoseContextProvider();
106 105
107 SharedBitmapManager* const bitmap_manager_; 106 SharedBitmapManager* const bitmap_manager_;
108 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_; 107 gpu::GpuMemoryBufferManager* const gpu_memory_buffer_manager_;
109 const RendererSettings settings_; 108 const RendererSettings settings_;
110 109
111 DisplayClient* client_ = nullptr; 110 DisplayClient* client_ = nullptr;
112 SurfaceManager* surface_manager_ = nullptr; 111 SurfaceManager* surface_manager_ = nullptr;
113 FrameSinkId frame_sink_id_; 112 const FrameSinkId frame_sink_id_;
114 SurfaceId current_surface_id_; 113 SurfaceId current_surface_id_;
115 gfx::Size current_surface_size_; 114 gfx::Size current_surface_size_;
116 float device_scale_factor_ = 1.f; 115 float device_scale_factor_ = 1.f;
117 gfx::ColorSpace device_color_space_; 116 gfx::ColorSpace device_color_space_;
118 bool visible_ = false; 117 bool visible_ = false;
119 bool swapped_since_resize_ = false; 118 bool swapped_since_resize_ = false;
120 bool output_is_secure_ = false; 119 bool output_is_secure_ = false;
121 120
122 // The begin_frame_source_ is often known by the output_surface_ and 121 // The begin_frame_source_ is often known by the output_surface_ and
123 // the scheduler_. 122 // the scheduler_.
124 std::unique_ptr<BeginFrameSource> begin_frame_source_; 123 std::unique_ptr<BeginFrameSource> begin_frame_source_;
125 std::unique_ptr<OutputSurface> output_surface_; 124 std::unique_ptr<OutputSurface> output_surface_;
126 std::unique_ptr<DisplayScheduler> scheduler_; 125 std::unique_ptr<DisplayScheduler> scheduler_;
127 std::unique_ptr<ResourceProvider> resource_provider_; 126 std::unique_ptr<ResourceProvider> resource_provider_;
128 std::unique_ptr<SurfaceAggregator> aggregator_; 127 std::unique_ptr<SurfaceAggregator> aggregator_;
129 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_; 128 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter_;
130 std::unique_ptr<DirectRenderer> renderer_; 129 std::unique_ptr<DirectRenderer> renderer_;
131 SoftwareRenderer* software_renderer_ = nullptr; 130 SoftwareRenderer* software_renderer_ = nullptr;
132 std::vector<ui::LatencyInfo> stored_latency_info_; 131 std::vector<ui::LatencyInfo> stored_latency_info_;
133 132
134 private: 133 private:
135 DISALLOW_COPY_AND_ASSIGN(Display); 134 DISALLOW_COPY_AND_ASSIGN(Display);
136 }; 135 };
137 136
138 } // namespace cc 137 } // namespace cc
139 138
140 #endif // CC_SURFACES_DISPLAY_H_ 139 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW
« no previous file with comments | « cc/surfaces/direct_compositor_frame_sink_unittest.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698