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

Side by Side Diff: cc/output/output_surface.h

Issue 1304303002: Mac Overlays: Add sandwich strategy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@overlay_debug
Patch Set: One more time Created 5 years, 4 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_OUTPUT_OUTPUT_SURFACE_H_ 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_
6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // Called by the compositor on the compositor thread. This is a place where 113 // Called by the compositor on the compositor thread. This is a place where
114 // thread-specific data for the output surface can be initialized, since from 114 // thread-specific data for the output surface can be initialized, since from
115 // this point on the output surface will only be used on the compositor 115 // this point on the output surface will only be used on the compositor
116 // thread. 116 // thread.
117 virtual bool BindToClient(OutputSurfaceClient* client); 117 virtual bool BindToClient(OutputSurfaceClient* client);
118 118
119 virtual void EnsureBackbuffer(); 119 virtual void EnsureBackbuffer();
120 virtual void DiscardBackbuffer(); 120 virtual void DiscardBackbuffer();
121 121
122 virtual void Reshape(const gfx::Size& size, float scale_factor); 122 virtual void Reshape(const gfx::Size& size, float scale_factor);
123 virtual gfx::Size SurfaceSize() const; 123 gfx::Size SurfaceSize() const { return surface_size_; }
alexst (slow to review) 2015/08/25 18:49:38 surface_size(), hacker style since it's simple, al
ccameron 2015/08/26 21:36:13 I agree -- mind if I do this in a separate CL (cau
alexst (slow to review) 2015/08/26 21:54:18 No problem, probably better in a separate CL anywa
124 float device_scale_factor() const { return device_scale_factor_; }
124 125
125 // If supported, this causes a ReclaimResources for all resources that are 126 // If supported, this causes a ReclaimResources for all resources that are
126 // currently in use. 127 // currently in use.
127 virtual void ForceReclaimResources() {} 128 virtual void ForceReclaimResources() {}
128 129
129 virtual void BindFramebuffer(); 130 virtual void BindFramebuffer();
130 131
131 // The implementation may destroy or steal the contents of the CompositorFrame 132 // The implementation may destroy or steal the contents of the CompositorFrame
132 // passed in (though it will not take ownership of the CompositorFrame 133 // passed in (though it will not take ownership of the CompositorFrame
133 // itself). For successful swaps, the implementation must call 134 // itself). For successful swaps, the implementation must call
134 // OutputSurfaceClient::DidSwapBuffers() and eventually 135 // OutputSurfaceClient::DidSwapBuffers() and eventually
135 // DidSwapBuffersComplete(). 136 // DidSwapBuffersComplete().
136 virtual void SwapBuffers(CompositorFrame* frame) = 0; 137 virtual void SwapBuffers(CompositorFrame* frame) = 0;
137 virtual void OnSwapBuffersComplete(); 138 virtual void OnSwapBuffersComplete();
138 139
139 // Notifies frame-rate smoothness preference. If true, all non-critical 140 // Notifies frame-rate smoothness preference. If true, all non-critical
140 // processing should be stopped, or lowered in priority. 141 // processing should be stopped, or lowered in priority.
141 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} 142 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {}
142 143
143 bool HasClient() { return !!client_; } 144 bool HasClient() { return !!client_; }
144 145
145 // Get the class capable of informing cc of hardware overlay capability. 146 // Get the class capable of informing cc of hardware overlay capability.
146 virtual OverlayCandidateValidator* GetOverlayCandidateValidator() const; 147 virtual OverlayCandidateValidator* GetOverlayCandidateValidator() const;
147 148
149 // Get the texture for the main image's overlay.
150 virtual unsigned GetOverlayTextureId() const;
151
148 void DidLoseOutputSurface(); 152 void DidLoseOutputSurface();
149 void SetMemoryPolicy(const ManagedMemoryPolicy& policy); 153 void SetMemoryPolicy(const ManagedMemoryPolicy& policy);
150 154
151 // Support for a pull-model where draws are requested by the output surface. 155 // Support for a pull-model where draws are requested by the output surface.
152 // 156 //
153 // OutputSurface::Invalidate is called by the compositor to notify that 157 // OutputSurface::Invalidate is called by the compositor to notify that
154 // there's new content. 158 // there's new content.
155 virtual void Invalidate() {} 159 virtual void Invalidate() {}
156 160
157 // Updates the worker context provider's visibility, freeing GPU resources if 161 // Updates the worker context provider's visibility, freeing GPU resources if
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 bool external_stencil_test_enabled_; 195 bool external_stencil_test_enabled_;
192 196
193 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; 197 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_;
194 198
195 DISALLOW_COPY_AND_ASSIGN(OutputSurface); 199 DISALLOW_COPY_AND_ASSIGN(OutputSurface);
196 }; 200 };
197 201
198 } // namespace cc 202 } // namespace cc
199 203
200 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ 204 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698