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

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

Issue 2854163003: [cc] Plumb BeginFrameAcks through SurfaceManager to DisplayScheduler. (Closed)
Patch Set: Pass ack via SurfaceDamaged, add back tests. 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 bool SurfaceHasUndrawnFrame(const SurfaceId& surface_id) const override;
81 81
82 // OutputSurfaceClient implementation. 82 // OutputSurfaceClient implementation.
83 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override; 83 void SetNeedsRedrawRect(const gfx::Rect& damage_rect) override;
84 void DidReceiveSwapBuffersAck() override; 84 void DidReceiveSwapBuffersAck() override;
85 void DidReceiveTextureInUseResponses( 85 void DidReceiveTextureInUseResponses(
86 const gpu::TextureInUseResponses& responses) override; 86 const gpu::TextureInUseResponses& responses) override;
87 87
88 // SurfaceObserver implementation. 88 // SurfaceObserver implementation.
89 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; 89 void OnSurfaceDamaged(const SurfaceId& surface,
90 const BeginFrameAck& ack,
91 bool* changed) override;
90 void OnSurfaceCreated(const SurfaceInfo& surface_info) override; 92 void OnSurfaceCreated(const SurfaceInfo& surface_info) override;
91 void OnSurfaceDiscarded(const SurfaceId& surface_id) override; 93 void OnSurfaceDiscarded(const SurfaceId& surface_id) override;
94 void OnSurfaceDestroyed(const SurfaceId& surface_id) override;
95 void OnSurfaceDamageExpected(const SurfaceId& surface_id,
96 const BeginFrameArgs& args) override;
92 97
93 bool has_scheduler() const { return !!scheduler_; } 98 bool has_scheduler() const { return !!scheduler_; }
94 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } 99 DirectRenderer* renderer_for_testing() const { return renderer_.get(); }
95 100
96 void ForceImmediateDrawAndSwapIfPossible(); 101 void ForceImmediateDrawAndSwapIfPossible();
97 102
98 private: 103 private:
99 void InitializeRenderer(); 104 void InitializeRenderer();
100 void UpdateRootSurfaceResourcesLocked(); 105 void UpdateRootSurfaceResourcesLocked();
101 void DidLoseContextProvider(); 106 void DidLoseContextProvider();
(...skipping 26 matching lines...) Expand all
128 SoftwareRenderer* software_renderer_ = nullptr; 133 SoftwareRenderer* software_renderer_ = nullptr;
129 std::vector<ui::LatencyInfo> stored_latency_info_; 134 std::vector<ui::LatencyInfo> stored_latency_info_;
130 135
131 private: 136 private:
132 DISALLOW_COPY_AND_ASSIGN(Display); 137 DISALLOW_COPY_AND_ASSIGN(Display);
133 }; 138 };
134 139
135 } // namespace cc 140 } // namespace cc
136 141
137 #endif // CC_SURFACES_DISPLAY_H_ 142 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698