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

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

Issue 2403573002: cc: Introduce mechanism to observe CompositorFrames submitted to new surfaceIDs (Closed)
Patch Set: Updated changes missed Created 4 years, 2 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 | « no previous file | 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 class SurfaceAggregator; 44 class SurfaceAggregator;
45 class SurfaceIdAllocator; 45 class SurfaceIdAllocator;
46 class SurfaceFactory; 46 class SurfaceFactory;
47 class TextureMailboxDeleter; 47 class TextureMailboxDeleter;
48 48
49 // A Display produces a surface that can be used to draw to a physical display 49 // A Display produces a surface that can be used to draw to a physical display
50 // (OutputSurface). The client is responsible for creating and sizing the 50 // (OutputSurface). The client is responsible for creating and sizing the
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 SurfaceDamageObserver { 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 std::unique_ptr<BeginFrameSource> begin_frame_source, 61 std::unique_ptr<BeginFrameSource> begin_frame_source,
62 std::unique_ptr<OutputSurface> output_surface, 62 std::unique_ptr<OutputSurface> output_surface,
63 std::unique_ptr<DisplayScheduler> scheduler, 63 std::unique_ptr<DisplayScheduler> scheduler,
64 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter); 64 std::unique_ptr<TextureMailboxDeleter> texture_mailbox_deleter);
(...skipping 27 matching lines...) Expand all
92 void DidLoseOutputSurface() override; 92 void DidLoseOutputSurface() override;
93 void SetExternalTilePriorityConstraints( 93 void SetExternalTilePriorityConstraints(
94 const gfx::Rect& viewport_rect, 94 const gfx::Rect& viewport_rect,
95 const gfx::Transform& transform) override; 95 const gfx::Transform& transform) override;
96 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override; 96 void SetMemoryPolicy(const ManagedMemoryPolicy& policy) override;
97 void SetTreeActivationCallback(const base::Closure& callback) override; 97 void SetTreeActivationCallback(const base::Closure& callback) override;
98 void OnDraw(const gfx::Transform& transform, 98 void OnDraw(const gfx::Transform& transform,
99 const gfx::Rect& viewport, 99 const gfx::Rect& viewport,
100 bool resourceless_software_draw) override; 100 bool resourceless_software_draw) override;
101 101
102 // SurfaceDamageObserver implementation. 102 // SurfaceObserver implementation.
103 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override; 103 void OnSurfaceDamaged(const SurfaceId& surface, bool* changed) override;
104 void OnSurfaceCreated(const SurfaceId& surface_id,
105 const gfx::Size& frame,
106 float device_scale_factor) override;
104 107
105 bool has_scheduler() const { return !!scheduler_; } 108 bool has_scheduler() const { return !!scheduler_; }
106 DirectRenderer* renderer_for_testing() const { return renderer_.get(); } 109 DirectRenderer* renderer_for_testing() const { return renderer_.get(); }
107 110
108 void ForceImmediateDrawAndSwapIfPossible(); 111 void ForceImmediateDrawAndSwapIfPossible();
109 112
110 private: 113 private:
111 void InitializeRenderer(); 114 void InitializeRenderer();
112 void UpdateRootSurfaceResourcesLocked(); 115 void UpdateRootSurfaceResourcesLocked();
113 116
(...skipping 24 matching lines...) Expand all
138 SoftwareRenderer* software_renderer_ = nullptr; 141 SoftwareRenderer* software_renderer_ = nullptr;
139 std::vector<ui::LatencyInfo> stored_latency_info_; 142 std::vector<ui::LatencyInfo> stored_latency_info_;
140 143
141 private: 144 private:
142 DISALLOW_COPY_AND_ASSIGN(Display); 145 DISALLOW_COPY_AND_ASSIGN(Display);
143 }; 146 };
144 147
145 } // namespace cc 148 } // namespace cc
146 149
147 #endif // CC_SURFACES_DISPLAY_H_ 150 #endif // CC_SURFACES_DISPLAY_H_
OLDNEW
« no previous file with comments | « no previous file | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698