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

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

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: Track state per surface. 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
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 22 matching lines...) Expand all
33 namespace cc { 33 namespace cc {
34 34
35 class BeginFrameSource; 35 class BeginFrameSource;
36 class DirectRenderer; 36 class DirectRenderer;
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 SurfaceAggregator;
44 class TextureMailboxDeleter; 43 class TextureMailboxDeleter;
45 44
46 // A Display produces a surface that can be used to draw to a physical display 45 // A Display produces a surface that can be used to draw to a physical display
47 // (OutputSurface). The client is responsible for creating and sizing the 46 // (OutputSurface). The client is responsible for creating and sizing the
48 // surface IDs used to draw into the display and deciding when to draw. 47 // surface IDs used to draw into the display and deciding when to draw.
49 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient, 48 class CC_SURFACES_EXPORT Display : public DisplaySchedulerClient,
50 public OutputSurfaceClient, 49 public OutputSurfaceClient,
51 public SurfaceObserver { 50 public SurfaceObserver {
52 public: 51 public:
53 // The |begin_frame_source| and |scheduler| may be null (together). In that 52 // The |begin_frame_source| and |scheduler| may be null (together). In that
(...skipping 17 matching lines...) Expand all
71 void SetVisible(bool visible); 70 void SetVisible(bool visible);
72 void Resize(const gfx::Size& new_size); 71 void Resize(const gfx::Size& new_size);
73 void SetColorSpace(const gfx::ColorSpace& blending_color_space, 72 void SetColorSpace(const gfx::ColorSpace& blending_color_space,
74 const gfx::ColorSpace& device_color_space); 73 const gfx::ColorSpace& device_color_space);
75 void SetOutputIsSecure(bool secure); 74 void SetOutputIsSecure(bool secure);
76 75
77 const SurfaceId& CurrentSurfaceId(); 76 const SurfaceId& CurrentSurfaceId();
78 77
79 // DisplaySchedulerClient implementation. 78 // DisplaySchedulerClient implementation.
80 bool DrawAndSwap() override; 79 bool DrawAndSwap() override;
80 const SurfaceAggregator::SurfaceIndexMap& GetPreviousContainedSurfaces()
81 override;
81 82
82 // OutputSurfaceClient implementation. 83 // OutputSurfaceClient implementation.
83 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; 84 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override;
84 void DidReceiveSwapBuffersAck() override; 85 void DidReceiveSwapBuffersAck() override;
85 void DidReceiveTextureInUseResponses( 86 void DidReceiveTextureInUseResponses(
86 const gpu::TextureInUseResponses& responses) override; 87 const gpu::TextureInUseResponses& responses) override;
87 88
88 // SurfaceObserver implementation. 89 // SurfaceObserver implementation.
89 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; 90 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override;
90 void OnSurfaceCreated(const SurfaceInfo& surface_info) override; 91 void OnSurfaceCreated(const SurfaceInfo& surface_info) override;
92 void OnSurfaceProducerStateChanged(const SurfaceId& surface_id) override;
91 93
92 bool has_scheduler() const { return !!scheduler_; } 94 bool has_scheduler() const { return !!scheduler_; }
93 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } 95 DirectRenderer* renderer_for_testing() const { return renderer_.get(); }
94 96
95 void ForceImmediateDrawAndSwapIfPossible(); 97 void ForceImmediateDrawAndSwapIfPossible();
96 98
97 private: 99 private:
98 void InitializeRenderer(); 100 void InitializeRenderer();
99 void UpdateRootSurfaceResourcesLocked(); 101 void UpdateRootSurfaceResourcesLocked();
100 void DidLoseContextProvider(); 102 void DidLoseContextProvider();
(...skipping 26 matching lines...) Expand all
127 SoftwareRenderer* software_renderer_ = nullptr; 129 SoftwareRenderer* software_renderer_ = nullptr;
128 std::vector<ui::LatencyInfo> stored_latency_info_; 130 std::vector<ui::LatencyInfo> stored_latency_info_;
129 131
130 private: 132 private:
131 DISALLOW_COPY_AND_ASSIGN(Display); 133 DISALLOW_COPY_AND_ASSIGN(Display);
132 }; 134 };
133 135
134 } // namespace cc 136 } // namespace cc
135 137
136 #endif // CC_SURFACES_DISPLAY_H_ 138 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698